Current implementation of xmldb_dbg() has some drawbacks.
First of all, it's used directly by XMLDB objects, and that creates one dependency from such XMLDB pure objects to one function outside them. This must be avoided.
More yet, in the XMLDB editor we don't use ddllib at all (it isn't included nor required) and current location for the xmldb_dbg() function is exactly that (ddllib.php). It works is the standard install/upgrade process (because there such function is included) but not in the editor.
So, this is the plan I'm going to implement right now:
- Create one debug($message) function inside the XMLDBObject class (the root one).
- Implement one hook in the function so, if the 'xmldb_debug' debug function is found anywhere, call it.
- Create the new 'xmldb_debug' function in datalib.php. It will perform one simple error_log() call
- Change all the current xmldb_dbg() uses to $this-> xmldb_debug
- Drop xmldb_dbg() from ddllib.php
P.S.: All this is because, since 2 days ago, main install.xml file in broken in HEAD and the editor is unusable. My initial thoughts were about to simply require_once(ddllib.php) in code, but I think the solution above is cleaner an maintains the independency of the editor.