* Print profiling with stack empty but collated list full
authorDomas Mituzas <midom@users.mediawiki.org>
Fri, 30 Dec 2005 23:13:31 +0000 (23:13 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Fri, 30 Dec 2005 23:13:31 +0000 (23:13 +0000)
* Silently ignore DB writes if db is unreachable

includes/Profiling.php

index 92e1565..ca81ec0 100755 (executable)
@@ -109,7 +109,7 @@ class Profiler {
                global $wgDebugFunctionEntry;
                $wgDebugFunctionEntry = false;
 
-               if (!count($this->mStack)) {
+               if (!count($this->mStack) && !count($this->mCollated)) {
                        return "No profiling output\n";
                }
                $this->close();
@@ -323,6 +323,8 @@ class Profiler {
 
                $fname = 'Profiler::logToDB';
                $dbw = & wfGetDB(DB_MASTER);
+               if (!is_object($dbw))
+                       return false;
                $profiling = $dbw->tableName('profiling');
 
                $name = substr($name, 0, 255);