Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
JimBurnett Posted December 12, 2018 Posted December 12, 2018 Hello, I asked this already in the Development Assistance community but I just have a hard time believing that you are developing software without the ability to set a breakpoint within your hook in an IDE, so I thought I would run it by you guys too just to be sure. I am using VS Code to write & debug the software using xampp 7.2 and xdebug. I notice that when I step through the code, I can set breakpoints in any of the standard files, but when it gets to my hook, I cannot set breakpoints. VS Code opens up the eval section in "eval.php" and I can see the code for my hook and I can step over, step into any of the code. However, if I try to set a breakpoint in the eval.php then it doesn't actually stop at the breakpoint. Right now, I'm just typing "xdebug_break();" wherever I want a breakpoint. It works, but that's annoying since I have to edit the code every time. i.e., setting a breakpoint in vs code at line 239 of Front.php will work: but setting a breakpoint in either the hook file (emsso.php) or the "in-memory-file" (eval.php) doesn't work. The program continues to execute without stopping at the breakpoint.
silenceheaven Posted December 13, 2018 Posted December 13, 2018 The hooks are executed in the method monkeyPatch in init.php and it first reads the content of those files, does a string replacement to set the order for execution, and then eval's the code. The IDE may not be able to target that specific line due to the placed halt of execution no longer being valid at runtime, but I can't say for certain. I see there's an extension for VS Code for xdebug you could give a try: https://github.com/felixfbecker/vscode-php-debug
Aiwa Posted December 13, 2018 Posted December 13, 2018 The best solution would be to include a source file with your app, your own defined class. Use the hook to collect the data you need, pass it to your object to do with what you need. You can put the break points in your class methods.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.