Fix whitespace, documentation

This commit is contained in:
Sam Reed 2011-07-09 03:49:25 +00:00
parent a65d263fed
commit 4fc982ebd9
6 changed files with 31 additions and 23 deletions

View file

@ -769,7 +769,7 @@ class LinksUpdate {
function getTitle() {
return $this->mTitle;
}
/**
* Return the list of images used as generated by the parser
*/

View file

@ -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 );
}
}

View file

@ -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;
}
}

View file

@ -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);

View file

@ -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'] );

View file

@ -227,7 +227,7 @@ class RefreshLinks extends Maintenance {
$dbw->commit();
}
/*
/**
* Removes non-existing links from pages from pagelinks, imagelinks,
* categorylinks, templatelinks and externallinks tables.
*