r91779 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91778‎ | r91779 | r91780 >
Date:03:49, 9 July 2011
Author:reedy
Status:ok
Tags:
Comment:
Fix whitespace, documentation
Modified paths:
  • /trunk/phase3/includes/LinksUpdate.php (modified) (history)
  • /trunk/phase3/includes/filerepo/LocalFile.php (modified) (history)
  • /trunk/phase3/includes/search/SearchEngine.php (modified) (history)
  • /trunk/phase3/includes/search/SearchPostgres.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchanges.php (modified) (history)
  • /trunk/phase3/maintenance/refreshLinks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/refreshLinks.php
@@ -227,7 +227,7 @@
228228 $dbw->commit();
229229 }
230230
231 - /*
 231+ /**
232232 * Removes non-existing links from pages from pagelinks, imagelinks,
233233 * categorylinks, templatelinks and externallinks tables.
234234 *
Index: trunk/phase3/includes/search/SearchEngine.php
@@ -473,11 +473,13 @@
474474 */
475475 public static function getOpenSearchTemplate() {
476476 global $wgOpenSearchTemplate, $wgServer;
477 - if ( $wgOpenSearchTemplate ) {
 477+ if ( $wgOpenSearchTemplate ) {
478478 return $wgOpenSearchTemplate;
479479 } else {
480480 $ns = implode( '|', SearchEngine::defaultNamespaces() );
481 - if ( !$ns ) $ns = "0";
 481+ if ( !$ns ) {
 482+ $ns = "0";
 483+ }
482484 return $wgServer . wfScript( 'api' ) . '?action=opensearch&search={searchTerms}&namespace=' . $ns;
483485 }
484486 }
Index: trunk/phase3/includes/search/SearchPostgres.php
@@ -29,7 +29,12 @@
3030 * @ingroup Search
3131 */
3232 class SearchPostgres extends SearchEngine {
 33+
3334 /**
 35+ * @var DatabasePostgres
 36+ */
 37+ protected $db;
 38+ /**
3439 * Creates an instance of this class
3540 * @param $db DatabaseSqlite: database object
3641 */
@@ -56,6 +61,7 @@
5762 }
5863 return new PostgresSearchResultSet( $resultSet, $this->searchTerms );
5964 }
 65+
6066 function searchText( $term ) {
6167 $q = $this->searchQuery( $term, 'textvector', 'old_text' );
6268 $olderror = error_reporting(E_ERROR);
Index: trunk/phase3/includes/filerepo/LocalFile.php
@@ -365,7 +365,7 @@
366366 if ( $handler ) {
367367 $validity = $handler->isMetadataValid( $this, $this->metadata );
368368 if ( $validity === MediaHandler::METADATA_BAD
369 - || ( $validity === MediaHandler::METADATA_COMPATIBLE && $wgUpdateCompatibleMetadata )
 369+ || ( $validity === MediaHandler::METADATA_COMPATIBLE && $wgUpdateCompatibleMetadata )
370370 ) {
371371 $this->upgradeRow();
372372 $this->upgraded = true;
@@ -691,7 +691,7 @@
692692 if ( in_array( $ext, $wgExcludeFromThumbnailPurge ) ) {
693693 continue;
694694 }
695 -
 695+
696696 # Check that the base file name is part of the thumb name
697697 # This is a basic sanity check to avoid erasing unrelated directories
698698 if ( strpos( $file, $this->getName() ) !== false ) {
@@ -1053,7 +1053,7 @@
10541054 }
10551055
10561056 /**
1057 - * Move or copy a file to a specified location. Returns a FileRepoStatus
 1057+ * Move or copy a file to a specified location. Returns a FileRepoStatus
10581058 * object with the archive name in the "value" member on success.
10591059 *
10601060 * The archive name should be passed through to recordUpload for database
@@ -1068,7 +1068,7 @@
10691069 */
10701070 function publishTo( $srcPath, $dstRel, $flags = 0 ) {
10711071 $this->lock();
1072 -
 1072+
10731073 $archiveName = wfTimestamp( TS_MW ) . '!'. $this->getName();
10741074 $archiveRel = 'archive/' . $this->getHashPath() . $archiveName;
10751075 $flags = $flags & File::DELETE_SOURCE ? LocalRepo::DELETE_SOURCE : 0;
@@ -1971,17 +1971,17 @@
19721972
19731973 return $status;
19741974 }
1975 -
 1975+
19761976 /**
1977 - * Cleanup a failed batch. The batch was only partially successful, so
 1977+ * Cleanup a failed batch. The batch was only partially successful, so
19781978 * rollback by removing all items that were succesfully copied.
1979 - *
 1979+ *
19801980 * @param Status $storeStatus
19811981 * @param array $storeBatch
19821982 */
19831983 function cleanupFailedBatch( $storeStatus, $storeBatch ) {
1984 - $cleanupBatch = array();
1985 -
 1984+ $cleanupBatch = array();
 1985+
19861986 foreach ( $storeStatus->success as $i => $success ) {
19871987 // Check if this item of the batch was successfully copied
19881988 if ( $success ) {
@@ -2075,7 +2075,7 @@
20762076 $triplets = $this->getMoveTriplets();
20772077
20782078 $triplets = $this->removeNonexistentFiles( $triplets );
2079 -
 2079+
20802080 // Copy the files into their new location
20812081 $statusMove = $repo->storeBatch( $triplets );
20822082 wfDebugLog( 'imagemove', "Moved files for {$this->file->name}: {$statusMove->successCount} successes, {$statusMove->failCount} failures" );
@@ -2097,10 +2097,10 @@
20982098 return $statusDb;
20992099 }
21002100 $this->db->commit();
2101 -
 2101+
21022102 // Everything went ok, remove the source files
21032103 $this->cleanupSource( $triplets );
2104 -
 2104+
21052105 $status->merge( $statusDb );
21062106 $status->merge( $statusMove );
21072107
@@ -2196,9 +2196,9 @@
21972197
21982198 return $filteredTriplets;
21992199 }
2200 -
 2200+
22012201 /**
2202 - * Cleanup a partially moved array of triplets by deleting the target
 2202+ * Cleanup a partially moved array of triplets by deleting the target
22032203 * files. Called if something went wrong half way.
22042204 */
22052205 function cleanupTarget( $triplets ) {
@@ -2207,13 +2207,13 @@
22082208 foreach ( $triplets as $triplet ) {
22092209 $pairs[] = array( $triplet[1], $triplet[2] );
22102210 }
2211 -
 2211+
22122212 $this->file->repo->cleanupBatch( $pairs );
22132213 }
2214 -
 2214+
22152215 /**
22162216 * Cleanup a fully moved array of triplets by deleting the source files.
2217 - * Called at the end of the move process if everything else went ok.
 2217+ * Called at the end of the move process if everything else went ok.
22182218 */
22192219 function cleanupSource( $triplets ) {
22202220 // Create source file names from the triplets
@@ -2221,7 +2221,7 @@
22222222 foreach ( $triplets as $triplet ) {
22232223 $files[] = $triplet[0];
22242224 }
2225 -
 2225+
22262226 $this->file->repo->cleanupBatch( $files );
22272227 }
22282228 }
Index: trunk/phase3/includes/LinksUpdate.php
@@ -769,7 +769,7 @@
770770 function getTitle() {
771771 return $this->mTitle;
772772 }
773 -
 773+
774774 /**
775775 * Return the list of images used as generated by the parser
776776 */
Index: trunk/phase3/includes/specials/SpecialRecentchanges.php
@@ -329,7 +329,7 @@
330330 $namespaces[] = $opts['namespace'];
331331
332332 $inversionSuffix = $opts['invert'] ? '!' : '';
333 -
 333+
334334 if( $opts['associated'] ) {
335335 # namespace association (bug 2429)
336336 $namespaces[] = MWNamespace::getAssociated( $opts['namespace'] );

Status & tagging log