Overslaan naar inhoud
  • +31 653-919-302
Cafayate.Net
  • 0
  • 0
  • Aanmelden
  • Nederlands English (US) Español (AR)
  • Contact
  • Startpagina
  • Blog
  • Vacatures
  • Contact
Cafayate.Net
  • 0
  • 0
    • Startpagina
    • Blog
    • Vacatures
    • Contact
  • +31 653-919-302
  • Nederlands English (US) Español (AR)
  • Aanmelden
  • Contact

Akeneo Disabling the Bootstrap File and Class Caching

  • Alle blogs
  • Tech Blog
  • Akeneo Disabling the Bootstrap File and Class Caching
  • 5 maart 2021 in
    Administrator

    And to make the production environment as fast as possible, Symfony creates big PHP files in your cache containing the aggregation of PHP classes your project needs for every request. However, this behavior can confuse your debugger, because the same class can be located in two different places: the original class file and the big file which aggregates lots of classes.

    This recipe shows you how you can tweak this caching mechanism to make it friendlier when you need to debug code that involves Symfony classes.

    The app_dev.php front controller reads as follows by default:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    // ...
    
    $loader = require __DIR__.'/../app/autoload.php';
    Debug::enable();
    
    $kernel = new AppKernel('dev', true);
    $kernel->loadClassCache();
    $request = Request::createFromGlobals();
    // ...
    

    To make your debugger happier, disable the loading of all PHP class caches by removing the call to loadClassCache():

    1
    2
    3
    4
    5
    6
    7
    8
    // ...
    
    $loader = require_once __DIR__.'/../app/autoload.php';
    Debug::enable();
    
    $kernel = new AppKernel('dev', true);
    // $kernel->loadClassCache();
    $request = Request::createFromGlobals();
    

    If you disable the PHP caches, don’t forget to revert after your debugging session.

    Some IDEs do not like the fact that some classes are stored in different locations. To avoid problems, you can tell your IDE to ignore the PHP cache file.

    in Tech Blog
    Check your DNS records with dig

    Ontworpen voor bedrijven

    We zijn een team van gepassioneerde mensen met als doel levens te verbeteren met vernieuwende producten. We ontwikkelen geweldige oplossingen voor al je zakelijke uitdagingen. Onze producten zijn ontworpen voor kleine tot middelgrote bedrijven die hun prestaties willen optimaliseren.

    Neem contact op

    Plantexel
    Pedernera
    Salta Capital 
    Argentina

    • +31 653-919-302
    • [email protected]
    Volg ons
    Copyright © Plantexel
    Nederlands | English (US) | Español (AR)