I am trying to write my first MediaWiki extension and need to debug it somehow. What is the easiest way to do this? Message display, file entry, etc. Will be fine. I just want to slowly move around the code and see where it breaks and what the contents of the variable are.
I tried (from http://www.mediawiki.org/wiki/Manual:How_to_debug#Useful_debugging_functions )
// ...somewhere in your code if ( true ) { wfDebugLog( 'myext', 'Something is not right: ' . print_r( 'asdf', true ) ); }
in the extensions /myext/myext.php and added to LocalSettings.php
require_once( 'extensions/myext/myext.php' );
but then my wiki doesn't work at all (error 500). With the above code, everything is fine from myext.php (with $ wgExtensionCredits in myext.php, I can see myext in Special: Version).
Is it right to do it (then what a mistake), or is there a better / easier way to get started?
source share