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
Merge "Treat langtags in SVG switch case-insensitively"
[lhc/web/wiklou.git]
/
maintenance
/
rebuildFileCache.php
diff --git
a/maintenance/rebuildFileCache.php
b/maintenance/rebuildFileCache.php
index
3520279
..
19d8d06
100644
(file)
--- a/
maintenance/rebuildFileCache.php
+++ b/
maintenance/rebuildFileCache.php
@@
-41,7
+41,7
@@
class RebuildFileCache extends Maintenance {
}
public function finalSetup() {
}
public function finalSetup() {
- global $wgDebugToolbar, $wgUseFileCache
, $wgReadOnly
;
+ global $wgDebugToolbar, $wgUseFileCache;
$this->enabled = $wgUseFileCache;
// Script will handle capturing output and saving it itself
$this->enabled = $wgUseFileCache;
// Script will handle capturing output and saving it itself
@@
-50,7
+50,8
@@
class RebuildFileCache extends Maintenance {
// Has to be done before Setup.php initialize MWDebug
$wgDebugToolbar = false;
// Avoid DB writes (like enotif/counters)
// Has to be done before Setup.php initialize MWDebug
$wgDebugToolbar = false;
// Avoid DB writes (like enotif/counters)
- $wgReadOnly = 'Building cache'; // avoid DB writes (like enotif/counters)
+ MediaWiki\MediaWikiServices::getInstance()->getReadOnlyMode()
+ ->setReason( 'Building cache' );
parent::finalSetup();
}
parent::finalSetup();
}
@@
-77,7
+78,8
@@
class RebuildFileCache extends Maintenance {
$this->output( "Building content page file cache from page {$start}!\n" );
$dbr = $this->getDB( DB_REPLICA );
$this->output( "Building content page file cache from page {$start}!\n" );
$dbr = $this->getDB( DB_REPLICA );
- $overwrite = $this->getOption( 'overwrite', false );
+ $batchSize = $this->getBatchSize();
+ $overwrite = $this->hasOption( 'overwrite' );
$start = ( $start > 0 )
? $start
: $dbr->selectField( 'page', 'MIN(page_id)', false, __METHOD__ );
$start = ( $start > 0 )
? $start
: $dbr->selectField( 'page', 'MIN(page_id)', false, __METHOD__ );
@@
-91,9
+93,9
@@
class RebuildFileCache extends Maintenance {
$_SERVER['HTTP_ACCEPT_ENCODING'] = 'bgzip'; // hack, no real client
# Do remaining chunk
$_SERVER['HTTP_ACCEPT_ENCODING'] = 'bgzip'; // hack, no real client
# Do remaining chunk
- $end += $
this->mB
atchSize - 1;
+ $end += $
b
atchSize - 1;
$blockStart = $start;
$blockStart = $start;
- $blockEnd = $start + $
this->mB
atchSize - 1;
+ $blockEnd = $start + $
b
atchSize - 1;
$dbw = $this->getDB( DB_MASTER );
// Go through each page and save the output
$dbw = $this->getDB( DB_MASTER );
// Go through each page and save the output
@@
-170,8
+172,8
@@
class RebuildFileCache extends Maintenance {
}
$this->commitTransaction( $dbw, __METHOD__ ); // commit any changes (just for sanity)
}
$this->commitTransaction( $dbw, __METHOD__ ); // commit any changes (just for sanity)
- $blockStart += $
this->mB
atchSize;
- $blockEnd += $
this->mB
atchSize;
+ $blockStart += $
b
atchSize;
+ $blockEnd += $
b
atchSize;
}
$this->output( "Done!\n" );
}
}
$this->output( "Done!\n" );
}