r81896 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81895‎ | r81896 | r81897 >
Date:16:39, 10 February 2011
Author:platonides
Status:ok (Comments)
Tags:
Comment:
Yet more additions of wfProfileOut()
Modified paths:
  • /trunk/phase3/includes/AjaxDispatcher.php (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/Export.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseIbm_db2.php (modified) (history)
  • /trunk/phase3/includes/db/LoadBalancer.php (modified) (history)
  • /trunk/phase3/includes/job/RefreshLinksJob.php (modified) (history)
  • /trunk/phase3/includes/resourceloader/ResourceLoaderFileModule.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAllmessages.php (modified) (history)
  • /trunk/phase3/thumb.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -1913,6 +1913,7 @@
19141914 if ( !$rev ) {
19151915 wfDebug( "Article::replaceSection asked for bogus section (page: " .
19161916 $this->getId() . "; section: $section; edittime: $edittime)\n" );
 1917+ wfProfileOut( __METHOD__ );
19171918 return null;
19181919 }
19191920
@@ -2097,12 +2098,12 @@
20982099 $flags & EDIT_MINOR, null, null, &$flags, &$status ) ) )
20992100 {
21002101 wfDebug( __METHOD__ . ": ArticleSave hook aborted save!\n" );
2101 - wfProfileOut( __METHOD__ );
21022102
21032103 if ( $status->isOK() ) {
21042104 $status->fatal( 'edit-hook-aborted' );
21052105 }
21062106
 2107+ wfProfileOut( __METHOD__ );
21072108 return $status;
21082109 }
21092110
Index: trunk/phase3/includes/AjaxDispatcher.php
@@ -133,7 +133,7 @@
134134 }
135135 }
136136
 137+ $wgOut = null;
137138 wfProfileOut( __METHOD__ );
138 - $wgOut = null;
139139 }
140140 }
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php
@@ -280,7 +280,7 @@
281281 $this->setDB2Option( 'rowcount', 'DB2_ROWCOUNT_PREFETCH_ON',
282282 self::STMT_OPTION );
283283
284 - parent::__construct( $server, $user, $password, $dbName, $flags );
 284+ parent::__construct( $server, $user, $password, $dbName, DBO_TRX | $flags );
285285 }
286286
287287 /**
@@ -344,6 +344,7 @@
345345 }
346346
347347 if ( strlen( $user ) < 1 ) {
 348+ wfProfileOut( __METHOD__ );
348349 return null;
349350 }
350351
@@ -371,6 +372,8 @@
372373 "Server: $server, Database: $dbName, User: $user, Password: "
373374 . substr( $password, 0, 3 ) . "...\n" );
374375 $this->installPrint( $this->lastError() . "\n" );
 376+
 377+ wfProfileOut( __METHOD__ );
375378 return null;
376379 }
377380
Index: trunk/phase3/includes/db/LoadBalancer.php
@@ -428,6 +428,7 @@
429429 if ( $i === false ) {
430430 $this->mLastError = 'No working slave server: ' . $this->mLastError;
431431 $this->reportConnectionError( $this->mErrorConnection );
 432+ wfProfileOut( __METHOD__ );
432433 return false;
433434 }
434435 }
Index: trunk/phase3/includes/Export.php
@@ -177,8 +177,8 @@
178178 "</id>" .
179179 "</contributor>";
180180 }
 181+ $this->author_list .= "</contributors>";
181182 wfProfileOut( __METHOD__ );
182 - $this->author_list .= "</contributors>";
183183 }
184184
185185 protected function dumpFrom( $cond = '' ) {
Index: trunk/phase3/includes/resourceloader/ResourceLoaderFileModule.php
@@ -353,6 +353,7 @@
354354 // If a module is nothing but a list of dependencies, we need to avoid
355355 // giving max() an empty array
356356 if ( count( $files ) === 0 ) {
 357+ wfProfileOut( __METHOD__ );
357358 return $this->modifiedTime[$context->getHash()] = 1;
358359 }
359360
@@ -362,6 +363,7 @@
363364 $this->modifiedTime[$context->getHash()] = max(
364365 $filesMtime,
365366 $this->getMsgBlobMtime( $context->getLanguage() ) );
 367+
366368 wfProfileOut( __METHOD__ );
367369 return $this->modifiedTime[$context->getHash()];
368370 }
Index: trunk/phase3/includes/Title.php
@@ -2103,8 +2103,6 @@
21042104 Title::purgeExpiredRestrictions();
21052105 }
21062106
2107 - wfProfileOut( __METHOD__ );
2108 -
21092107 if ( $getPages ) {
21102108 $this->mCascadeSources = $sources;
21112109 $this->mCascadingRestrictions = $pagerestrictions;
@@ -2112,6 +2110,7 @@
21132111 $this->mHasCascadingRestrictions = $sources;
21142112 }
21152113
 2114+ wfProfileOut( __METHOD__ );
21162115 return array( $sources, $pagerestrictions );
21172116 }
21182117
Index: trunk/phase3/includes/job/RefreshLinksJob.php
@@ -99,6 +99,8 @@
100100 $jobs[] = new RefreshLinksJob( $title, '' );
101101 }
102102 Job::batchInsert( $jobs );
 103+
 104+ wfProfileOut( __METHOD__ );
103105 return true;
104106 }
105107 # Re-parse each page that transcludes this page and update their tracking links...
Index: trunk/phase3/includes/specials/SpecialAllmessages.php
@@ -202,8 +202,8 @@
203203
204204 // Normalise message names so they look like page titles
205205 $messageNames = array_map( array( $this->lang, 'ucfirst' ), $messageNames );
206 - wfProfileIn( __METHOD__ );
207206
 207+ wfProfileOut( __METHOD__ );
208208 return $messageNames;
209209 }
210210
Index: trunk/phase3/thumb.php
@@ -56,11 +56,13 @@
5757 $bits = explode( '!', $fileName, 2 );
5858 if( !isset($bits[1]) ) {
5959 wfThumbError( 404, wfMsg( 'badtitletext' ) );
 60+ wfProfileOut( __METHOD__ );
6061 return;
6162 }
6263 $title = Title::makeTitleSafe( NS_FILE, $bits[1] );
6364 if( is_null($title) ) {
6465 wfThumbError( 404, wfMsg( 'badtitletext' ) );
 66+ wfProfileOut( __METHOD__ );
6567 return;
6668 }
6769 $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $fileName );
@@ -73,6 +75,7 @@
7476 if ( !$img->getTitle()->userCanRead() ) {
7577 wfThumbError( 403, 'Access denied. You do not have permission to access ' .
7678 'the source file.' );
 79+ wfProfileOut( __METHOD__ );
7780 return;
7881 }
7982 $headers[] = 'Cache-Control: private';
@@ -81,15 +84,18 @@
8285
8386 if ( !$img ) {
8487 wfThumbError( 404, wfMsg( 'badtitletext' ) );
 88+ wfProfileOut( __METHOD__ );
8589 return;
8690 }
8791 if ( !$img->exists() ) {
8892 wfThumbError( 404, 'The source file for the specified thumbnail does not exist.' );
 93+ wfProfileOut( __METHOD__ );
8994 return;
9095 }
9196 $sourcePath = $img->getPath();
9297 if ( $sourcePath === false ) {
9398 wfThumbError( 500, 'The source file is not locally accessible.' );
 99+ wfProfileOut( __METHOD__ );
94100 return;
95101 }
96102
@@ -105,6 +111,7 @@
106112 wfRestoreWarnings();
107113 if ( $stat['mtime'] <= $imsUnix ) {
108114 header( 'HTTP/1.1 304 Not Modified' );
 115+ wfProfileOut( __METHOD__ );
109116 return;
110117 }
111118 }
@@ -116,11 +123,13 @@
117124
118125 if ( is_file( $thumbPath ) ) {
119126 wfStreamFile( $thumbPath, $headers );
 127+ wfProfileOut( __METHOD__ );
120128 return;
121129 }
122130 }
123131 } catch ( MWException $e ) {
124132 wfThumbError( 500, $e->getHTML() );
 133+ wfProfileOut( __METHOD__ );
125134 return;
126135 }
127136

Follow-up revisions

RevisionCommit summaryAuthorDate
r819211.17wmf1: MFT r81729, r81890, r81891, r81892, r81893, r81894, r81896, r81897,...catrope22:42, 10 February 2011
r84548MFT r80892, r81143, partial r81896, r84532demon20:10, 22 March 2011
r85148MFT: r80495, r80610, r80765, r81177, r81490, r81692, r81707, r81729, r81765, ...demon20:11, 1 April 2011

Comments

#Comment by Catrope (talk | contribs)   22:24, 10 February 2011
-		parent::__construct( $server, $user, $password, $dbName, $flags );
+		parent::__construct( $server, $user, $password, $dbName, DBO_TRX | $flags );

?

#Comment by Platonides (talk | contribs)   22:53, 10 February 2011

I didn't intend to commit that. It was in my Working Copy from when I looked at r80892, which (inadvertedly?) removed the forcing of DBO_TRX in DatabaseIbm_db2.php

The fact is, I have no idea if it was needed for anything or not (r80892#c13571).

#Comment by 😂 (talk | contribs)   03:24, 11 February 2011

It's db2, does that really deserve a fixme?

#Comment by 😂 (talk | contribs)   13:51, 30 March 2011

This was never a problem, Platonides was correct. (Maybe not *necessary*, but restores 1.16 behavior). Already merged in r84584.

#Comment by 😂 (talk | contribs)   13:52, 30 March 2011

Actually adding 1.17 back, only the db/ parts of this were merged.

Status & tagging log