dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a65d263
)
Fix whitespace, documentation
author
Sam Reed
<reedy@users.mediawiki.org>
Sat, 9 Jul 2011 03:49:25 +0000
(
03:49
+0000)
committer
Sam Reed
<reedy@users.mediawiki.org>
Sat, 9 Jul 2011 03:49:25 +0000
(
03:49
+0000)
includes/LinksUpdate.php
patch
|
blob
|
history
includes/filerepo/LocalFile.php
patch
|
blob
|
history
includes/search/SearchEngine.php
patch
|
blob
|
history
includes/search/SearchPostgres.php
patch
|
blob
|
history
includes/specials/SpecialRecentchanges.php
patch
|
blob
|
history
maintenance/refreshLinks.php
patch
|
blob
|
history
diff --git
a/includes/LinksUpdate.php
b/includes/LinksUpdate.php
index
a982aec
..
7b85040
100644
(file)
--- a/
includes/LinksUpdate.php
+++ b/
includes/LinksUpdate.php
@@
-769,7
+769,7
@@
class LinksUpdate {
function getTitle() {
return $this->mTitle;
}
function getTitle() {
return $this->mTitle;
}
-
+
/**
* Return the list of images used as generated by the parser
*/
/**
* Return the list of images used as generated by the parser
*/
diff --git
a/includes/filerepo/LocalFile.php
b/includes/filerepo/LocalFile.php
index
56a2185
..
9f51c34
100644
(file)
--- 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
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;
) {
$this->upgradeRow();
$this->upgraded = true;
@@
-691,7
+691,7
@@
class LocalFile extends File {
if ( in_array( $ext, $wgExcludeFromThumbnailPurge ) ) {
continue;
}
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 ) {
# 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
* 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();
*/
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;
$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;
}
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.
* rollback by removing all items that were succesfully copied.
- *
+ *
* @param Status $storeStatus
* @param array $storeBatch
*/
function cleanupFailedBatch( $storeStatus, $storeBatch ) {
* @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 ) {
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 );
$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" );
// 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();
return $statusDb;
}
$this->db->commit();
-
+
// Everything went ok, remove the source files
$this->cleanupSource( $triplets );
// Everything went ok, remove the source files
$this->cleanupSource( $triplets );
-
+
$status->merge( $statusDb );
$status->merge( $statusMove );
$status->merge( $statusDb );
$status->merge( $statusMove );
@@
-2196,9
+2196,9
@@
class LocalFileMoveBatch {
return $filteredTriplets;
}
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 ) {
* 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] );
}
foreach ( $triplets as $triplet ) {
$pairs[] = array( $triplet[1], $triplet[2] );
}
-
+
$this->file->repo->cleanupBatch( $pairs );
}
$this->file->repo->cleanupBatch( $pairs );
}
-
+
/**
* Cleanup a fully moved array of triplets by deleting the source files.
/**
* 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
*/
function cleanupSource( $triplets ) {
// Create source file names from the triplets
@@
-2221,7
+2221,7
@@
class LocalFileMoveBatch {
foreach ( $triplets as $triplet ) {
$files[] = $triplet[0];
}
foreach ( $triplets as $triplet ) {
$files[] = $triplet[0];
}
-
+
$this->file->repo->cleanupBatch( $files );
}
}
$this->file->repo->cleanupBatch( $files );
}
}
diff --git
a/includes/search/SearchEngine.php
b/includes/search/SearchEngine.php
index
96d6de7
..
1293353
100644
(file)
--- a/
includes/search/SearchEngine.php
+++ b/
includes/search/SearchEngine.php
@@
-473,11
+473,13
@@
class SearchEngine {
*/
public static function getOpenSearchTemplate() {
global $wgOpenSearchTemplate, $wgServer;
*/
public static function getOpenSearchTemplate() {
global $wgOpenSearchTemplate, $wgServer;
- if ( $wgOpenSearchTemplate )
{
+ if ( $wgOpenSearchTemplate ) {
return $wgOpenSearchTemplate;
} else {
$ns = implode( '|', SearchEngine::defaultNamespaces() );
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;
}
}
return $wgServer . wfScript( 'api' ) . '?action=opensearch&search={searchTerms}&namespace=' . $ns;
}
}
diff --git
a/includes/search/SearchPostgres.php
b/includes/search/SearchPostgres.php
index
62bc232
..
cfe283b
100644
(file)
--- a/
includes/search/SearchPostgres.php
+++ b/
includes/search/SearchPostgres.php
@@
-29,6
+29,11
@@
* @ingroup Search
*/
class SearchPostgres extends SearchEngine {
* @ingroup Search
*/
class SearchPostgres extends SearchEngine {
+
+ /**
+ * @var DatabasePostgres
+ */
+ protected $db;
/**
* Creates an instance of this class
* @param $db DatabaseSqlite: database object
/**
* 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 );
}
}
return new PostgresSearchResultSet( $resultSet, $this->searchTerms );
}
+
function searchText( $term ) {
$q = $this->searchQuery( $term, 'textvector', 'old_text' );
$olderror = error_reporting(E_ERROR);
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
da7babe
..
c5d1680
100644
(file)
--- a/
includes/specials/SpecialRecentchanges.php
+++ b/
includes/specials/SpecialRecentchanges.php
@@
-329,7
+329,7
@@
class SpecialRecentChanges extends IncludableSpecialPage {
$namespaces[] = $opts['namespace'];
$inversionSuffix = $opts['invert'] ? '!' : '';
$namespaces[] = $opts['namespace'];
$inversionSuffix = $opts['invert'] ? '!' : '';
-
+
if( $opts['associated'] ) {
# namespace association (bug 2429)
$namespaces[] = MWNamespace::getAssociated( $opts['namespace'] );
if( $opts['associated'] ) {
# namespace association (bug 2429)
$namespaces[] = MWNamespace::getAssociated( $opts['namespace'] );
diff --git
a/maintenance/refreshLinks.php
b/maintenance/refreshLinks.php
index
c41bf35
..
0515ef1
100644
(file)
--- a/
maintenance/refreshLinks.php
+++ b/
maintenance/refreshLinks.php
@@
-227,7
+227,7
@@
class RefreshLinks extends Maintenance {
$dbw->commit();
}
$dbw->commit();
}
- /*
+ /*
*
* Removes non-existing links from pages from pagelinks, imagelinks,
* categorylinks, templatelinks and externallinks tables.
*
* Removes non-existing links from pages from pagelinks, imagelinks,
* categorylinks, templatelinks and externallinks tables.
*