Adding more wfProfileOut()
authorPlatonides <platonides@users.mediawiki.org>
Thu, 10 Feb 2011 16:11:34 +0000 (16:11 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Thu, 10 Feb 2011 16:11:34 +0000 (16:11 +0000)
includes/BagOStuff.php
includes/Linker.php
includes/parser/Parser.php
includes/parser/Parser_LinkHooks.php
includes/parser/Tidy.php

index 7f40001..1caaa1c 100644 (file)
@@ -725,6 +725,7 @@ class DBABagOStuff extends BagOStuff {
 
                $handle = $this->getReader();
                if ( !$handle ) {
+                       wfProfileOut( __METHOD__ );
                        return null;
                }
 
@@ -755,6 +756,7 @@ class DBABagOStuff extends BagOStuff {
 
                $handle = $this->getWriter();
                if ( !$handle ) {
+                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
@@ -771,6 +773,7 @@ class DBABagOStuff extends BagOStuff {
 
                $handle = $this->getWriter();
                if ( !$handle ) {
+                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
@@ -789,6 +792,7 @@ class DBABagOStuff extends BagOStuff {
                $handle = $this->getWriter();
 
                if ( !$handle ) {
+                       wfProfileOut( __METHOD__ );
                        return false;
                }
 
index a74fb77..116ef50 100644 (file)
@@ -722,6 +722,7 @@ class Linker {
                                return $this->linkKnown( $title, "$prefix$text$inside", array(), $query ) . $trail;
                        }
                } else {
+                       wfProfileOut( __METHOD__ );
                        return "<!-- ERROR -->{$prefix}{$text}{$trail}";
                }
        }
@@ -1668,6 +1669,7 @@ class Linker {
         */
        public function accesskey( $name ) {
                if ( isset( $this->accesskeycache[$name] ) ) {
+                       wfProfileOut( __METHOD__ );
                        return $this->accesskeycache[$name];
                }
                wfProfileIn( __METHOD__ );
index 917f7dc..d343ba6 100644 (file)
@@ -2448,6 +2448,7 @@ class Parser {
                }
                if ( $stack > 0 ) {
                        wfDebug( __METHOD__.": Invalid input; not enough close tags (stack $stack, state $state)\n" );
+                       wfProfileOut( __METHOD__ );
                        return false;
                }
                wfProfileOut( __METHOD__ );
index 5d6ac78..7c17ce4 100644 (file)
@@ -265,9 +265,10 @@ class Parser_LinkHooks extends Parser
                if( $return === false ) {
                        # False (no link) was returned, output plain wikitext
                        # Build it again as the hook is allowed to modify $paramText
-                       return isset($paramText) ? "[[$titleText|$paramText]]" : "[[$titleText]]";
+                       $return = isset($paramText) ? "[[$titleText|$paramText]]" : "[[$titleText]]";
                }
                # Content was returned, return it
+               wfProfileOut( __METHOD__ );
                return $return;
        }
        
index d2b58f6..a745eac 100644 (file)
@@ -173,15 +173,13 @@ class MWTidy {
                        $retval = -1;   
                }
 
-               wfProfileOut( __METHOD__ );
-
                if( !$stderr && $cleansource == '' && $text != '' ) {
                        // Some kind of error happened, so we couldn't get the corrected text.
                        // Just give up; we'll use the source text and append a warning.
-                       return null;
-               } else {
-                       return $cleansource;
+                       $cleansource = null;
                }
+               wfProfileOut( __METHOD__ );
+               return $cleansource;
        }
 
        /**
@@ -199,6 +197,7 @@ class MWTidy {
 
                if( $stderr ) {
                        $retval = $tidy->getStatus();
+                       wfProfileOut( __METHOD__ );
                        return $tidy->errorBuffer;
                } else {
                        $tidy->cleanRepair();