]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14679 fixing old TODOs and adding more CLI support
authorskodak <skodak>
Sat, 13 Jun 2009 09:16:30 +0000 (09:16 +0000)
committerskodak <skodak>
Sat, 13 Jun 2009 09:16:30 +0000 (09:16 +0000)
lib/dml/moodle_database.php

index 3f4f2c3514deae6fd074e2c8f820743152f41d84..000a9d49a7bb5f523e01c6223c2f3196f163a72f 100644 (file)
@@ -372,13 +372,21 @@ abstract class moodle_database {
         if (!$this->get_debug()) {
             return;
         }
-        //TODO: detect CLI mode and skip s() ;-)
-        echo "<hr />\n";
-        echo s($sql)."\n";
-        if (!is_null($params)) {
-            echo "[".s(var_export($params, true))."]\n";
+        if (CLI_SCRIPT) {
+            echo "--------------------------------\n";
+            echo $sql."\n";
+            if (!is_null($params)) {
+                echo "[".var_export($params, true)."]\n";
+            }
+            echo "--------------------------------\n";
+        } else {
+            echo "<hr />\n";
+            echo s($sql)."\n";
+            if (!is_null($params)) {
+                echo "[".s(var_export($params, true))."]\n";
+            }
+            echo "<hr />\n";
         }
-        echo "<hr />\n";
     }
 
     /**
@@ -735,7 +743,7 @@ abstract class moodle_database {
      * @param bool $state
      */
     public function set_logging($state) {
-        // TODO: adodb sql logging shares one table without prefix per db - this is no longer acceptable :-(
+        // adodb sql logging shares one table without prefix per db - this is no longer acceptable :-(
         // we must create one table shared by all drivers
     }