1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Run debug in phpStorm to step through XenForo

Discussion in 'XenForo Development Discussions' started by LPH, Dec 1, 2014.

  1. LPH

    LPH Well-Known Member

    I read a post suggesting the best way to learn XF code is to run debug and step it through XenForo.

    Does anyone have a link to a good tutorial on how to setup phpStorm with XenForo so debug can show what is happening in XF? Right now debug opens a blank browser and so the configuration must not be set properly.

    Maybe someone has a better way to go through the code to learn how to do these things:

    Return absolute url instead of relative path
    Create new templates / modify templates
    Create a new profile page with tab and links
    Create a new tab next to the "new post" "new showcase" "new media" ...
    Create a permissions options page
    Add a table for an add-on
    Write an XF thread into an external database for a different app.
    Start XF externally without using relative path....

    All done externally from XF but once my bridge is active then I have access to all XF methods and classes.

    Some of the above are described in other add-ons and tutorials here but specifically I'd like to learn the power behind the phpStorm tool to debug XF code.

    Or is that not even the right way to ask about how to learn the XF way ;)
  2. LPH

    LPH Well-Known Member

    Last edited: Dec 6, 2014
  3. Mr. Goodie2Shoes

    Mr. Goodie2Shoes Well-Known Member

    I haven't used any debugging mechanism... would also like to know how :)
    LPH likes this.
  4. LPH

    LPH Well-Known Member

    After a little bit of reading and watching videos, I figured out a way to get the Chrome xdebug extension and PhpStorm to connect, and set break points to get information into the debugger. Now it's taking the time to interpret what is being returned.

    Here is my little video:

    Note: I forgot to show that I clicked on the PhpStorm listening icon (phone icon) to start PhpStorm listening to the Chrome browser.

    sbj, Marcus and rainmotorsports like this.
  5. SneakyDave

    SneakyDave Well-Known Member

    Yes, the best I've seen it setup is to use the chrome xdebug extension, and turn on debugging for your licalhost installation.

    You'll also have to tell phpstorm to listen for xdebug connections, by clicking the phone icon. Then you can set breakpoints in phpstorm to any line of code in XenForo to analyze variables, code, session data, etc.

Share This Page