WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an...
Transcript of WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an...
![Page 1: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/1.jpg)
(Php)Storming WordPress A remote debugging experience
![Page 2: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/2.jpg)
Introduction/ Andrea Fuggetta
/ Senior software engineer at Ndevr, Inc. - https://ndevr.io/
/ Some of the projects I worked on:
![Page 3: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/3.jpg)
About Us/ Since 2015
/ Distributed
/ 50% Located in NY/NJ Metro
/ Average experience over 15 years
![Page 4: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/4.jpg)
Outline/ Tools and software/ Setting up Xdebug/ Setting up PhpStorm/ Setting up your terminal/ Let’s code! – Debugging case scenarios:
/ WordPress theme/ WP-CLI application/ PHPUnit test
/ References/ Q&A
![Page 5: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/5.jpg)
Tools and software/ PhpStorm/ Google Chrome w/ Xdebug helper/ Terminal/ Vagrant/ Xdebug/ PHPUnit/ WP-CLI
![Page 6: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/6.jpg)
Setting up Xdebug/ Info on https://xdebug.org/docs/install
/ Installation on Mac OSX via Homebrew:# brew install <php-version>-xdebug
/ Installation on Linux via apt-get:# sudo apt-get install <php-version>-xdebug
/ Php.ini:Add: zend_extension="/path-to/xdebug.so"
[Xdebug]
xdebug.remote_enable=1
xdebug.remote_port=“9000”
![Page 7: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/7.jpg)
Debugging/ Breakpoint: line break where an application suspends execution allowing you to examine data/ Step-over: runs code in current line and moves to next code statement/ Step-into: moves into functions/methods if any are present in current line/ Step-out: runs current function/method and returns to previous execution point
Listens for connections
![Page 8: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/8.jpg)
Setting up PhpStorm/ Enable external connections and set correct port
/ More info can be found at https://www.jetbrains.com/help/phpstorm/2016.2/configuring-xdebug.html
![Page 9: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/9.jpg)
Setting up PhpStorm/ Zero-configuration debugging/ Create a new remote debug configuration/ Important things to remember:
/ Host/ Port / Path Mapping / Session ID
/ Hands on!
![Page 10: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/10.jpg)
Setting up your terminal/ Your terminal needs to send out the session ID
/ Hands on!
![Page 11: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/11.jpg)
Let’s code!/ WordPress theme/ WP-CLI application/ PHPUnit test
![Page 12: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/12.jpg)
References/ https://wordpress.org/ https://xdebug.org/ https://www.jetbrains.com/ https://phpunit.de/ http://wp-cli.org/ https://ndevr.io
![Page 13: WordCamp Cincinnati - A remote debugging …...Debugging / Breakpoint: line break where an application suspends execution allowing you to examine data / Step-over: runs code in current](https://reader034.fdocuments.in/reader034/viewer/2022043001/5f7c6c187ccd942e92679363/html5/thumbnails/13.jpg)
Thank You!Andrea Fuggetta/ Email: [email protected]/ LinkedIn: https://www.linkedin.com/in/andreafuggetta/ GitHub: https://github.com/afuggetta
Q&A
/ LinkedIn: https://www.linkedin.com/company/ndevr / GitHub: https://github.com/ndevrinc/ Twitter: https://twitter.com/ndevrinc
/ Slides http://bit.ly/debugpstorm