6

I tried debugging with Symfony2 before and dealing with the cache is a big pain in the head I'm debugging with Netbeans and XDebug, is there a way to AUTOMATICALLY disable the cache and Debug in a better way?

1 Answer 1

10

I added this code (based on this official documentation) in my app_dev.php in order to achieve exactly what I asked:

Changed:

$loader = require_once __DIR__.'/../app/bootstrap.php.cache';

with:

if( !isset($_COOKIE['XDEBUG_SESSION']) )
    $loader = require_once __DIR__.'/../app/bootstrap.php.cache';
else
    $loader = require_once __DIR__.'/../app/autoload.php';

and

$kernel->loadClassCache();

with

if( !isset($_COOKIE['XDEBUG_SESSION']) )
    $kernel->loadClassCache();
Sign up to request clarification or add additional context in comments.

1 Comment

May want to add relevant info for the console too. =)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.