From: Platonides Date: Thu, 10 Feb 2011 16:39:53 +0000 (+0000) Subject: Yet more additions of wfProfileOut() X-Git-Tag: 1.31.0-rc.0~32069 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=49074e8a5618e28baf312d8f8b41225542f4614e;p=lhc%2Fweb%2Fwiklou.git Yet more additions of wfProfileOut() --- diff --git a/includes/AjaxDispatcher.php b/includes/AjaxDispatcher.php index 5ee14a5007..0f1d74b598 100644 --- a/includes/AjaxDispatcher.php +++ b/includes/AjaxDispatcher.php @@ -133,7 +133,7 @@ class AjaxDispatcher { } } - wfProfileOut( __METHOD__ ); $wgOut = null; + wfProfileOut( __METHOD__ ); } } diff --git a/includes/Article.php b/includes/Article.php index e13afc90f3..1ec33b3892 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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; } diff --git a/includes/Export.php b/includes/Export.php index 06e4565427..e7cd4d3f2b 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -177,8 +177,8 @@ class WikiExporter { "" . ""; } - wfProfileOut( __METHOD__ ); $this->author_list .= ""; + wfProfileOut( __METHOD__ ); } protected function dumpFrom( $cond = '' ) { diff --git a/includes/Title.php b/includes/Title.php index ca5aa661c6..dfadd7ac85 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 ); } diff --git a/includes/db/DatabaseIbm_db2.php b/includes/db/DatabaseIbm_db2.php index a2a2be0b4e..941a66fda5 100644 --- a/includes/db/DatabaseIbm_db2.php +++ b/includes/db/DatabaseIbm_db2.php @@ -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; } diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index 15a0ad39f8..847d8347fe 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -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; } } diff --git a/includes/job/RefreshLinksJob.php b/includes/job/RefreshLinksJob.php index 2e1e85acbb..cc91fa81aa 100644 --- a/includes/job/RefreshLinksJob.php +++ b/includes/job/RefreshLinksJob.php @@ -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... diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index b2454f73af..701a6031eb 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -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()]; } diff --git a/includes/specials/SpecialAllmessages.php b/includes/specials/SpecialAllmessages.php index fdacd80942..d475d5fea4 100644 --- a/includes/specials/SpecialAllmessages.php +++ b/includes/specials/SpecialAllmessages.php @@ -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; } diff --git a/thumb.php b/thumb.php index 64f24c1877..1a1dee4618 100644 --- 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; }