From: Sam Reed Date: Sat, 9 Jul 2011 03:49:25 +0000 (+0000) Subject: Fix whitespace, documentation X-Git-Tag: 1.31.0-rc.0~28966 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;ds=sidebyside;h=4fc982ebd977dd32b3cd5236904faadc94e3c8a5;hp=a65d263fedd6e8f71cc1aa2add829df38589f32f;p=lhc%2Fweb%2Fwiklou.git Fix whitespace, documentation --- diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index a982aec79f..7b85040c01 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -769,7 +769,7 @@ class LinksUpdate { function getTitle() { return $this->mTitle; } - + /** * Return the list of images used as generated by the parser */ diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index 56a2185947..9f51c34325 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -365,7 +365,7 @@ class LocalFile extends File { if ( $handler ) { $validity = $handler->isMetadataValid( $this, $this->metadata ); if ( $validity === MediaHandler::METADATA_BAD - || ( $validity === MediaHandler::METADATA_COMPATIBLE && $wgUpdateCompatibleMetadata ) + || ( $validity === MediaHandler::METADATA_COMPATIBLE && $wgUpdateCompatibleMetadata ) ) { $this->upgradeRow(); $this->upgraded = true; @@ -691,7 +691,7 @@ class LocalFile extends File { if ( in_array( $ext, $wgExcludeFromThumbnailPurge ) ) { continue; } - + # Check that the base file name is part of the thumb name # This is a basic sanity check to avoid erasing unrelated directories if ( strpos( $file, $this->getName() ) !== false ) { @@ -1053,7 +1053,7 @@ class LocalFile extends File { } /** - * Move or copy a file to a specified location. Returns a FileRepoStatus + * Move or copy a file to a specified location. Returns a FileRepoStatus * object with the archive name in the "value" member on success. * * The archive name should be passed through to recordUpload for database @@ -1068,7 +1068,7 @@ class LocalFile extends File { */ function publishTo( $srcPath, $dstRel, $flags = 0 ) { $this->lock(); - + $archiveName = wfTimestamp( TS_MW ) . '!'. $this->getName(); $archiveRel = 'archive/' . $this->getHashPath() . $archiveName; $flags = $flags & File::DELETE_SOURCE ? LocalRepo::DELETE_SOURCE : 0; @@ -1971,17 +1971,17 @@ class LocalFileRestoreBatch { return $status; } - + /** - * Cleanup a failed batch. The batch was only partially successful, so + * Cleanup a failed batch. The batch was only partially successful, so * rollback by removing all items that were succesfully copied. - * + * * @param Status $storeStatus * @param array $storeBatch */ function cleanupFailedBatch( $storeStatus, $storeBatch ) { - $cleanupBatch = array(); - + $cleanupBatch = array(); + foreach ( $storeStatus->success as $i => $success ) { // Check if this item of the batch was successfully copied if ( $success ) { @@ -2075,7 +2075,7 @@ class LocalFileMoveBatch { $triplets = $this->getMoveTriplets(); $triplets = $this->removeNonexistentFiles( $triplets ); - + // Copy the files into their new location $statusMove = $repo->storeBatch( $triplets ); wfDebugLog( 'imagemove', "Moved files for {$this->file->name}: {$statusMove->successCount} successes, {$statusMove->failCount} failures" ); @@ -2097,10 +2097,10 @@ class LocalFileMoveBatch { return $statusDb; } $this->db->commit(); - + // Everything went ok, remove the source files $this->cleanupSource( $triplets ); - + $status->merge( $statusDb ); $status->merge( $statusMove ); @@ -2196,9 +2196,9 @@ class LocalFileMoveBatch { return $filteredTriplets; } - + /** - * Cleanup a partially moved array of triplets by deleting the target + * Cleanup a partially moved array of triplets by deleting the target * files. Called if something went wrong half way. */ function cleanupTarget( $triplets ) { @@ -2207,13 +2207,13 @@ class LocalFileMoveBatch { foreach ( $triplets as $triplet ) { $pairs[] = array( $triplet[1], $triplet[2] ); } - + $this->file->repo->cleanupBatch( $pairs ); } - + /** * Cleanup a fully moved array of triplets by deleting the source files. - * Called at the end of the move process if everything else went ok. + * Called at the end of the move process if everything else went ok. */ function cleanupSource( $triplets ) { // Create source file names from the triplets @@ -2221,7 +2221,7 @@ class LocalFileMoveBatch { foreach ( $triplets as $triplet ) { $files[] = $triplet[0]; } - + $this->file->repo->cleanupBatch( $files ); } } diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index 96d6de714d..1293353ebe 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -473,11 +473,13 @@ class SearchEngine { */ public static function getOpenSearchTemplate() { global $wgOpenSearchTemplate, $wgServer; - if ( $wgOpenSearchTemplate ) { + if ( $wgOpenSearchTemplate ) { return $wgOpenSearchTemplate; } else { $ns = implode( '|', SearchEngine::defaultNamespaces() ); - if ( !$ns ) $ns = "0"; + if ( !$ns ) { + $ns = "0"; + } return $wgServer . wfScript( 'api' ) . '?action=opensearch&search={searchTerms}&namespace=' . $ns; } } diff --git a/includes/search/SearchPostgres.php b/includes/search/SearchPostgres.php index 62bc232316..cfe283b28d 100644 --- a/includes/search/SearchPostgres.php +++ b/includes/search/SearchPostgres.php @@ -29,6 +29,11 @@ * @ingroup Search */ class SearchPostgres extends SearchEngine { + + /** + * @var DatabasePostgres + */ + protected $db; /** * Creates an instance of this class * @param $db DatabaseSqlite: database object @@ -56,6 +61,7 @@ class SearchPostgres extends SearchEngine { } return new PostgresSearchResultSet( $resultSet, $this->searchTerms ); } + function searchText( $term ) { $q = $this->searchQuery( $term, 'textvector', 'old_text' ); $olderror = error_reporting(E_ERROR); diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index da7babe67a..c5d16807bf 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -329,7 +329,7 @@ class SpecialRecentChanges extends IncludableSpecialPage { $namespaces[] = $opts['namespace']; $inversionSuffix = $opts['invert'] ? '!' : ''; - + if( $opts['associated'] ) { # namespace association (bug 2429) $namespaces[] = MWNamespace::getAssociated( $opts['namespace'] ); diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php index c41bf3583a..0515ef1b3b 100644 --- a/maintenance/refreshLinks.php +++ b/maintenance/refreshLinks.php @@ -227,7 +227,7 @@ class RefreshLinks extends Maintenance { $dbw->commit(); } - /* + /** * Removes non-existing links from pages from pagelinks, imagelinks, * categorylinks, templatelinks and externallinks tables. *