Shopware + PHPStorm: Easier Xdebug in administration

You are trying to debug your Shopware 6 but your breakpoints are hit all the time, because the admin worker is doing stuff and turning it off makes everything even worse?

Just ignore most of the request with a condition on your breakpoint. In PHPStorm you can right click on a breakpoint and then click on “More”, you see this window:

Screenshot of PHPStorms Breakpoint window, showing the breakpoints on the left and on the right options, especially turned on Condition with the content "!in_array($_SERVER['REQUEST_URI'], ['/api/notification/message?limit=5', '/api/_action/message-queue/consume', '/api/_action/scheduled-task/run', '/api/oauth/token', '/api/_info/queue.json', '/api/_info/config-me?keys[]=notification.lastReadAt'])"

Turn on "Condition" and then add the following, which ignores all kinds of requests:
!in_array(
    $_SERVER['REQUEST_URI'],
    [
        '/api/notification/message?limit=5',
        '/api/_action/message-queue/consume',
        '/api/_action/scheduled-task/run',
        '/api/oauth/token',
        '/api/_info/queue.json',
        '/api/_info/config-me?keys[]=notification.lastReadAt'
    ]
)

Have more fun debugging! And good luck.

One thought on “Shopware + PHPStorm: Easier Xdebug in administration

Leave a Reply