Debugging Drupal 8: Essential skills for beginners

marvoey

Many use ”legacy” ways of non-interactive debugging based on php-native commands like print_r(), var_dump(), debug_print_backtrace() or commands provided by contributed modules or themes like dpm() or dump() inside of twig templates but they have significant drawbacks compared to real interactive debugging. To name a few:

  • The output is going to be very confusing on big data structures.
  • It risks leaving debug commands in production code.
  • There is no possibility to inject debug command into generated files (e.g. from twig).
  • The calls stack is not interactive.
  • Nobody knows what happens on the next line (until we reload the page).

It is definitely worthwhile to invest time into a proper debugging setup, as the investment will definitely yield significant returns in the long run. In this session I will go over the steps involved in setting up an interactive debugging environment in two popular IDEs - PHPStrom and Eclipse PDT.

AUDIENCE
Beginner
SCHEDULE INFO
2017
Proposed
Design, UX, and Accessibility