dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix broken select() call in rebuildFileCache.php
[lhc/web/wiklou.git]
/
maintenance
/
rebuildFileCache.php
diff --git
a/maintenance/rebuildFileCache.php
b/maintenance/rebuildFileCache.php
index
38556ed
..
b278e98
100644
(file)
--- a/
maintenance/rebuildFileCache.php
+++ b/
maintenance/rebuildFileCache.php
@@
-70,14
+70,14
@@
class RebuildFileCache extends Maintenance {
$this->output( "Building content page file cache from page {$start}!\n" );
$this->output( "Building content page file cache from page {$start}!\n" );
- $dbr = $this->getDB( DB_
SLAVE
);
+ $dbr = $this->getDB( DB_
REPLICA
);
$overwrite = $this->getOption( 'overwrite', false );
$start = ( $start > 0 )
? $start
$overwrite = $this->getOption( 'overwrite', false );
$start = ( $start > 0 )
? $start
- : $dbr->selectField( 'page', 'MIN(page_id)', false, __
FUNCTION
__ );
+ : $dbr->selectField( 'page', 'MIN(page_id)', false, __
METHOD
__ );
$end = ( $end > 0 )
? $end
$end = ( $end > 0 )
? $end
- : $dbr->selectField( 'page', 'MAX(page_id)', false, __
FUNCTION
__ );
+ : $dbr->selectField( 'page', 'MAX(page_id)', false, __
METHOD
__ );
if ( !$start ) {
$this->error( "Nothing to do.", true );
}
if ( !$start ) {
$this->error( "Nothing to do.", true );
}
@@
-93,9
+93,11
@@
class RebuildFileCache extends Maintenance {
// Go through each page and save the output
while ( $blockEnd <= $end ) {
// Get the pages
// Go through each page and save the output
while ( $blockEnd <= $end ) {
// Get the pages
- $res = $dbr->select( 'page', [ 'page_namespace', 'page_title', 'page_id' ],
+ $res = $dbr->select( 'page',
+ [ 'page_namespace', 'page_title', 'page_id' ],
[ 'page_namespace' => MWNamespace::getContentNamespaces(),
"page_id BETWEEN $blockStart AND $blockEnd" ],
[ 'page_namespace' => MWNamespace::getContentNamespaces(),
"page_id BETWEEN $blockStart AND $blockEnd" ],
+ __METHOD__,
[ 'ORDER BY' => 'page_id ASC', 'USE INDEX' => 'PRIMARY' ]
);
[ 'ORDER BY' => 'page_id ASC', 'USE INDEX' => 'PRIMARY' ]
);
@@
-119,7
+121,7
@@
class RebuildFileCache extends Maintenance {
// If the article is cacheable, then load it
if ( $article->isFileCacheable() ) {
// If the article is cacheable, then load it
if ( $article->isFileCacheable() ) {
- $cache =
HTMLFileCache::newFromTitl
e( $title, 'view' );
+ $cache =
new HTMLFileCach
e( $title, 'view' );
if ( $cache->isCacheGood() ) {
if ( $overwrite ) {
$rebuilt = true;
if ( $cache->isCacheGood() ) {
if ( $overwrite ) {
$rebuilt = true;