Stanford Drupal Camp
15+ Ways to Debug Drupal 8
Zakiya Khabir Drupal Developer, Chapter Three
15+ Ways to Debug Drupal 8 Zakiya Khabir Drupal Developer, Chapter - - PowerPoint PPT Presentation
Stanford Drupal Camp 15+ Ways to Debug Drupal 8 Zakiya Khabir Drupal Developer, Chapter Three Why this talk? End of dpm() Kint complaints Rumors of a better way Audience D7 front-enders New to Drupal Current D8 devs
Zakiya Khabir Drupal Developer, Chapter Three
developed
scalability/changing-php-memory-limits
drupal-8-0
Use it every day. Use it sometimes. Wouldn’t recommend Requires Xdebug. Requires Composer.
Find path to log at /admin/reports/status/php Make sure error reporting is on!
Reference: github.com/chapter-three/drupal-8-theming/blob/master/exercise_01- intro-debug.md
Reference: github.com/arshad/drupal-template-helper
Docs: hechoendrupal.gitbooks.io/drupal-console/content/en/commands/help.html
Reference: twig.sensiolabs.org/doc/functions/dump.html
questions/211928/how-can-i-make-kint-load- faster-when-debugging-twig-templates
Reference: drupalize.me/blog/201406/web-profiler-drupal-8
Use Composer to install. drupal.org/project/twig_xdebug Step by Step: chapterthree.com/blog/debug-drupal-8-twig-templates-twigxdebug-module
using {{ breakpoint() }}
recommended package. Product description page has errors.
by default
“Remember that you are debugging generated php files. This has some implications in comparison to
“usual” php files:
file in the generated folder of the Twig template. It may be confusing to determine the “actual” php file we want debug, as the generated php filenames are hashed. The quickest way to get around this is to set a breakpoint to all php files in the directory, at the beginning of doDisplay()
page with a new template), then locate this newly generated php file and set the breakpoint inside.
breakpoints again to the newly generated php files. After cache clear
in the generated PHP files!”
drupal-8-with-phpstorm-and-xdebug/25/08/2016/16586
in php: $fp = fopen(DRUPAL_ROOT . '/file.txt', 'w'); fwrite($fp, print_r($variables, TRUE)); fwrite($fp, print_r("--END--\n", TRUE)); fclose($fp); in terminal: $ cd path/to/drupal $ tail -f file.txt
$ drush ws --tail (last 10 watchdog log messages)
justdrupal.com/php-code-sniffer-in-phpstorm-for-drupal
make you better developer.
@zakiyadesigns or zakiya@chapterthree.com