Yet more additions of wfProfileOut()
authorPlatonides <platonides@users.mediawiki.org>
Thu, 10 Feb 2011 16:39:53 +0000 (16:39 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Thu, 10 Feb 2011 16:39:53 +0000 (16:39 +0000)
includes/AjaxDispatcher.php
includes/Article.php
includes/Export.php
includes/Title.php
includes/db/DatabaseIbm_db2.php
includes/db/LoadBalancer.php
includes/job/RefreshLinksJob.php
includes/resourceloader/ResourceLoaderFileModule.php
includes/specials/SpecialAllmessages.php
thumb.php

index 5ee14a5..0f1d74b 100644 (file)
@@ -133,7 +133,7 @@ class AjaxDispatcher {
                        }
                }
 
-               wfProfileOut( __METHOD__ );
                $wgOut = null;
+               wfProfileOut( __METHOD__ );
        }
 }
index e13afc9..1ec33b3 100644 (file)
@@ -1913,6 +1913,7 @@ class Article {
                        if ( !$rev ) {
                                wfDebug( "Article::replaceSection asked for bogus section (page: " .
                                        $this->getId() . "; section: $section; edittime: $edittime)\n" );
+                               wfProfileOut( __METHOD__ );
                                return null;
                        }
 
@@ -2097,12 +2098,12 @@ class Article {
                        $flags & EDIT_MINOR, null, null, &$flags, &$status ) ) )
                {
                        wfDebug( __METHOD__ . ": ArticleSave hook aborted save!\n" );
-                       wfProfileOut( __METHOD__ );
 
                        if ( $status->isOK() ) {
                                $status->fatal( 'edit-hook-aborted' );
                        }
 
+                       wfProfileOut( __METHOD__ );
                        return $status;
                }
 
index 06e4565..e7cd4d3 100644 (file)
@@ -177,8 +177,8 @@ class WikiExporter {
                                "</id>" .
                                "</contributor>";
                }
-               wfProfileOut( __METHOD__ );
                $this->author_list .= "</contributors>";
+               wfProfileOut( __METHOD__ );
        }
 
        protected function dumpFrom( $cond = '' ) {
index ca5aa66..dfadd7a 100644 (file)
@@ -2103,8 +2103,6 @@ class Title {
                        Title::purgeExpiredRestrictions();
                }
 
-               wfProfileOut( __METHOD__ );
-
                if ( $getPages ) {
                        $this->mCascadeSources = $sources;
                        $this->mCascadingRestrictions = $pagerestrictions;
@@ -2112,6 +2110,7 @@ class Title {
                        $this->mHasCascadingRestrictions = $sources;
                }
 
+               wfProfileOut( __METHOD__ );
                return array( $sources, $pagerestrictions );
        }
 
index a2a2be0..941a66f 100644 (file)
@@ -280,7 +280,7 @@ class DatabaseIbm_db2 extends DatabaseBase {
                $this->setDB2Option( 'rowcount', 'DB2_ROWCOUNT_PREFETCH_ON',
                        self::STMT_OPTION );
 
-               parent::__construct( $server, $user, $password, $dbName, $flags );
+               parent::__construct( $server, $user, $password, $dbName, DBO_TRX | $flags );
        }
 
        /**
@@ -344,6 +344,7 @@ ERROR;
                }
 
                if ( strlen( $user ) < 1 ) {
+                       wfProfileOut( __METHOD__ );
                        return null;
                }
 
@@ -371,6 +372,8 @@ ERROR;
                                "Server: $server, Database: $dbName, User: $user, Password: "
                                . substr( $password, 0, 3 ) . "...\n" );
                        $this->installPrint( $this->lastError() . "\n" );
+
+                       wfProfileOut( __METHOD__ );
                        return null;
                }
 
index 15a0ad3..847d834 100644 (file)
@@ -428,6 +428,7 @@ class LoadBalancer {
                        if ( $i === false ) {
                                $this->mLastError = 'No working slave server: ' . $this->mLastError;
                                $this->reportConnectionError( $this->mErrorConnection );
+                               wfProfileOut( __METHOD__ );
                                return false;
                        }
                }
index 2e1e85a..cc91fa8 100644 (file)
@@ -99,6 +99,8 @@ class RefreshLinksJob2 extends Job {
                                $jobs[] = new RefreshLinksJob( $title, '' );
                        }
                        Job::batchInsert( $jobs );
+
+                       wfProfileOut( __METHOD__ );
                        return true;
                }
                # Re-parse each page that transcludes this page and update their tracking links...
index b2454f7..701a603 100644 (file)
@@ -353,6 +353,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                // If a module is nothing but a list of dependencies, we need to avoid 
                // giving max() an empty array
                if ( count( $files ) === 0 ) {
+                       wfProfileOut( __METHOD__ );
                        return $this->modifiedTime[$context->getHash()] = 1;
                }
                
@@ -362,6 +363,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                $this->modifiedTime[$context->getHash()] = max( 
                        $filesMtime, 
                        $this->getMsgBlobMtime( $context->getLanguage() ) );
+
                wfProfileOut( __METHOD__ );
                return $this->modifiedTime[$context->getHash()];
        }
index fdacd80..d475d5f 100644 (file)
@@ -202,8 +202,8 @@ class AllmessagesTablePager extends TablePager {
 
                // Normalise message names so they look like page titles
                $messageNames = array_map( array( $this->lang, 'ucfirst' ), $messageNames );
-               wfProfileIn( __METHOD__ );
 
+               wfProfileOut( __METHOD__ );
                return $messageNames;
        }
 
index 64f24c1..1a1dee4 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -56,11 +56,13 @@ function wfThumbMain() {
                $bits = explode( '!', $fileName, 2 );
                if( !isset($bits[1]) ) {
                        wfThumbError( 404, wfMsg( 'badtitletext' ) );
+                       wfProfileOut( __METHOD__ );
                        return;
                }
                $title = Title::makeTitleSafe( NS_FILE, $bits[1] );
                if( is_null($title) ) {
                        wfThumbError( 404, wfMsg( 'badtitletext' ) );
+                       wfProfileOut( __METHOD__ );
                        return;
                }
                $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $fileName );
@@ -73,6 +75,7 @@ function wfThumbMain() {
                if ( !$img->getTitle()->userCanRead() ) {
                        wfThumbError( 403, 'Access denied. You do not have permission to access ' . 
                                'the source file.' );
+                       wfProfileOut( __METHOD__ );
                        return;
                }
                $headers[] = 'Cache-Control: private';
@@ -81,15 +84,18 @@ function wfThumbMain() {
 
        if ( !$img ) {
                wfThumbError( 404, wfMsg( 'badtitletext' ) );
+               wfProfileOut( __METHOD__ );
                return;
        }
        if ( !$img->exists() ) {
                wfThumbError( 404, 'The source file for the specified thumbnail does not exist.' );
+               wfProfileOut( __METHOD__ );
                return;
        }
        $sourcePath = $img->getPath();
        if ( $sourcePath === false ) {
                wfThumbError( 500, 'The source file is not locally accessible.' );
+               wfProfileOut( __METHOD__ );
                return;
        }
 
@@ -105,6 +111,7 @@ function wfThumbMain() {
                wfRestoreWarnings();
                if ( $stat['mtime'] <= $imsUnix ) {
                        header( 'HTTP/1.1 304 Not Modified' );
+                       wfProfileOut( __METHOD__ );
                        return;
                }
        }
@@ -116,11 +123,13 @@ function wfThumbMain() {
 
                        if ( is_file( $thumbPath ) ) {
                                wfStreamFile( $thumbPath, $headers );
+                               wfProfileOut( __METHOD__ );
                                return;
                        }
                }
        } catch ( MWException $e ) {
                wfThumbError( 500, $e->getHTML() );
+               wfProfileOut( __METHOD__ );
                return;
        }