From: jenkins-bot Date: Wed, 9 Jan 2013 08:24:16 +0000 (+0000) Subject: Merge "Miscellaneous profiling fixes" X-Git-Tag: 1.31.0-rc.0~21098 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=5e2eb7f385e22fe3e2a482b77960369d4fc24f96;hp=dcd83202a8d458bf346c81ae85bc39132aec8df1;p=lhc%2Fweb%2Fwiklou.git Merge "Miscellaneous profiling fixes" --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 0e6eafb557..410fa3a187 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1283,7 +1283,7 @@ class EditPage { $status = Status::newGood(); - wfProfileIn( __METHOD__ ); + wfProfileIn( __METHOD__ ); wfProfileIn( __METHOD__ . '-checks' ); if ( !wfRunHooks( 'EditPage::attemptSave', array( $this ) ) ) { @@ -1291,7 +1291,7 @@ class EditPage { $status->fatal( 'hookaborted' ); $status->value = self::AS_HOOK_ERROR; wfProfileOut( __METHOD__ . '-checks' ); - wfProfileOut( __METHOD__ ); + wfProfileOut( __METHOD__ ); return $status; } @@ -1301,6 +1301,7 @@ class EditPage { } catch ( MWContentSerializationException $ex ) { $status->fatal( 'content-failed-to-parse', $this->contentModel, $this->contentFormat, $ex->getMessage() ); $status->value = self::AS_PARSE_ERROR; + wfProfileOut( __METHOD__ . '-checks' ); wfProfileOut( __METHOD__ ); return $status; } @@ -1313,7 +1314,7 @@ class EditPage { $status->setResult( false, $code ); wfProfileOut( __METHOD__ . '-checks' ); - wfProfileOut( __METHOD__ ); + wfProfileOut( __METHOD__ ); return $status; } diff --git a/includes/Linker.php b/includes/Linker.php index 7d84a6a001..6b0d4442ef 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1936,7 +1936,7 @@ class Linker { $outText .= ''; } - wfProfileOut( __METHOD__ ); + wfProfileOut( __METHOD__ ); return $outText; } @@ -1962,7 +1962,7 @@ class Linker { } $outText .= ''; } - wfProfileOut( __METHOD__ ); + wfProfileOut( __METHOD__ ); return $outText; } diff --git a/includes/User.php b/includes/User.php index fad9af8d7b..ed3fe7630f 100644 --- a/includes/User.php +++ b/includes/User.php @@ -293,6 +293,7 @@ class User { wfRunHooks( 'UserLoadAfterLoadFromSession', array( $this ) ); break; default: + wfProfileOut( __METHOD__ ); throw new MWException( "Unrecognised value for User->mFrom: \"{$this->mFrom}\"" ); } wfProfileOut( __METHOD__ ); diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index 36a1126ca2..8708608eb6 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -133,7 +133,7 @@ class DatabaseMysql extends DatabaseBase { substr( $password, 0, 3 ) . "..., error: " . $error . "\n" ); wfProfileOut( __METHOD__ ); - $this->reportConnectionError( $error ); + return $this->reportConnectionError( $error ); } if ( $dbName != '' ) { @@ -146,7 +146,7 @@ class DatabaseMysql extends DatabaseBase { "from client host " . wfHostname() . "\n" ); wfProfileOut( __METHOD__ ); - $this->reportConnectionError( "Error selecting database $dbName" ); + return $this->reportConnectionError( "Error selecting database $dbName" ); } } diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index 8ba5f4f80b..2858cd9aa2 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -579,7 +579,7 @@ class LoadBalancer { wfProfileIn( __METHOD__ ); if ( $wiki !== false ) { $conn = $this->openForeignConnection( $i, $wiki ); - wfProfileOut( __METHOD__); + wfProfileOut( __METHOD__ ); return $conn; } if ( isset( $this->mConns['local'][$i][0] ) ) { diff --git a/includes/parser/Parser_LinkHooks.php b/includes/parser/Parser_LinkHooks.php index e4f5d1262a..d1ca8aac72 100644 --- a/includes/parser/Parser_LinkHooks.php +++ b/includes/parser/Parser_LinkHooks.php @@ -149,8 +149,8 @@ class Parser_LinkHooks extends Parser { $holders = new LinkHolderArray( $this ); if( is_null( $this->mTitle ) ) { - wfProfileOut( __METHOD__ ); wfProfileOut( __METHOD__.'-setup' ); + wfProfileOut( __METHOD__ ); throw new MWException( __METHOD__.": \$this->mTitle is null\n" ); } @@ -224,10 +224,12 @@ class Parser_LinkHooks extends Parser { wfProfileIn( __METHOD__ ); $wt = isset($paramText) ? "[[$titleText|$paramText]]" : "[[$titleText]]"; wfProfileIn( __METHOD__."-misc" ); + # Don't allow internal links to pages containing # PROTO: where PROTO is a valid URL protocol; these # should be external links. if( preg_match('/^\b(?i:' . wfUrlProtocols() . ')/', $titleText) ) { + wfProfileOut( __METHOD__."-misc" ); wfProfileOut( __METHOD__ ); return $wt; }