Moodle 3.1- Event Handler Debugging

Rob

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.

davosmith

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Debugging JavaScript & css code: adding an event handler

From Dev

Adding event handler to feature in OpenLayers 3?

From Dev

Open Layers 3 Zoom map event handler

From Dev

Understanding actionscript 3 custom event handler

From Dev

GCD function event handler for DispatchSource in Swift 3?

From Dev

Doing AutoScroll with ScrollViewer.ScrollToEnd() only worked while debugging, event handler too simple

From Dev

Allow UnhandledException event handler to run when debugging using Visual Studio 2013 Ultimate

From Dev

Passing event to event handler

From Dev

Common event handler for all Google Maps v3 markers

From Dev

How to remove d3.behavior.drag().on("drag",...) event handler

From Dev

Understanding this custom event handler and unity3d

From Dev

implement event handler after other event handler

From Dev

Event handler inside event handler is multiplying

From Dev

Page load event debugging

From Dev

Event Handler act on Event source

From Dev

Moodle event observer not triggered in local plugin

From Dev

Overload event handler in javascript

From Dev

Redefining the context of an event handler

From Dev

Adding an Event Handler for a List

From Dev

lua mouse event handler

From Dev

OnChange event handler not working

From Dev

Click event not posting to handler

From Dev

React: this is null in event handler

From Dev

Not working handler on "onchange" event

From Dev

libavg custom event handler

From Dev

TypeScript click event handler

From Dev

Is there a replacement for .load() event handler?

From Dev

jQuery .on data or event handler?

From Dev

Throttle an Event Handler