]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
tell people how to debug database queries
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Thu, 5 Nov 2009 08:58:08 +0000 (08:58 +0000)
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>
Thu, 5 Nov 2009 08:58:08 +0000 (08:58 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@525 b3834d28-1941-0410-a4f8-b48e95affb8f

doc/developers/debugging [new file with mode: 0644]
src/SemanticScuttle/Service/Factory.php

diff --git a/doc/developers/debugging b/doc/developers/debugging
new file mode 100644 (file)
index 0000000..7f84da6
--- /dev/null
@@ -0,0 +1,20 @@
+How to debug SemanticScuttle
+============================
+
+
+Database queries
+----------------
+In config.php, enable debugMode.
+Further, add the following there:
+-------
+register_shutdown_function(
+    create_function('', <<<FNC
+\$GLOBALS['db'] = SemanticScuttle_Service_Factory::getDb();
+\$GLOBALS['db']->sql_report('display');
+FNC
+    )
+);
+------
+To see database queries in SemanticScuttle, add
+> ?explain=1
+to your URL.
index 2461575d06c37bef57e70fc8fb52093043801068..a0732514cee9a272f59275ae25905ed4b208017b 100644 (file)
@@ -134,5 +134,18 @@ class SemanticScuttle_Service_Factory
         self::$db = $db;
     }
 
+
+
+    /**
+     * Returns sql database object
+     *
+     * @return void
+     */
+    public static function getDb()
+    {
+        self::loadDb();
+        return self::$db;
+    }
+
 }
 ?>