]> git.mjollnir.org Git - moodle.git/commitdiff
New xmldb_debug($message, $object) added. It's the official hook
authorstronk7 <stronk7>
Sat, 28 Oct 2006 15:20:14 +0000 (15:20 +0000)
committerstronk7 <stronk7>
Sat, 28 Oct 2006 15:20:14 +0000 (15:20 +0000)
provided by XMLDB's debug() function. MDL-7261

lib/datalib.php

index c8da862c0bb29d42f8c0f4ab022d7212778a8cc0..1f1a576a845560e2b7e3da8b6c4a08cbbefa011d 100644 (file)
@@ -1517,5 +1517,20 @@ function category_parent_visible($parent = 0) {
     return $v;
 }
 
+/**
+ * This function is the official hook inside XMLDB stuff to delegate its debug to one 
+ * external function.
+ *
+ * Any script can avoid calls to this function by defining XMLDB_SKIP_DEBUG_HOOK before
+ * using XMLDB classes. Obviously, also, if this function doesn't exist, it isn't invoked ;-)
+ *
+ * @param $message string contains the error message
+ * @param $object object XMLDB object that fired the debug
+ */
+function xmldb_debug($message, $object) {
+
+    error_log($message);
+}
+
 // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
 ?>