Before I get into it I'm sorry for the newbie question but I'm new to Moodle and php development. I'm attempting to figure out how to debug the code in event handlers.
Really what I'm looking for is how to debug code in an event handler since I don't call the page directly and am not able to get output from the functions that it's running (that I'm currently aware of).
I know this is likely off topic for this forum but I'm not really sure where to turn for this.
Make sure xdebug is installed on the development computer where you are testing this, then open up your IDE and put a breakpoint at the start of your event handler. If that isn't hit, put a breakpoint on the code that triggers the event and step through it.
If, for some reason, you really can't install xdebug and step through the code (which is something that is essential for any serious PHP development), try using fopen and fwrite to dump information into a log file, whilst the event is happening.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments