summaryrefslogtreecommitdiff
path: root/maintenance/updateSpecialPages.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
committerPierre Schmitz <pierre@archlinux.de>2011-12-03 13:29:22 +0100
commitca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch)
treeec04cc15b867bc21eedca904cea9af0254531a11 /maintenance/updateSpecialPages.php
parenta22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff)
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing
Diffstat (limited to 'maintenance/updateSpecialPages.php')
-rw-r--r--maintenance/updateSpecialPages.php25
1 files changed, 15 insertions, 10 deletions
diff --git a/maintenance/updateSpecialPages.php b/maintenance/updateSpecialPages.php
index 3e5df982..ddf1601b 100644
--- a/maintenance/updateSpecialPages.php
+++ b/maintenance/updateSpecialPages.php
@@ -33,8 +33,8 @@ class UpdateSpecialPages extends Maintenance {
}
public function execute() {
- global $IP, $wgOut, $wgSpecialPageCacheUpdates, $wgQueryPages, $wgQueryCacheLimit, $wgDisableQueryPageUpdate;
- $wgOut->disable();
+ global $IP, $wgSpecialPageCacheUpdates, $wgQueryPages, $wgQueryCacheLimit, $wgDisableQueryPageUpdate;
+
$dbw = wfGetDB( DB_MASTER );
foreach ( $wgSpecialPageCacheUpdates as $special => $call ) {
@@ -58,14 +58,15 @@ class UpdateSpecialPages extends Maintenance {
}
$this->output( sprintf( "completed in %.2fs\n", $seconds ) );
# Wait for the slave to catch up
- wfWaitForSlaves( 5 );
+ wfWaitForSlaves();
}
// This is needed to initialise $wgQueryPages
require_once( "$IP/includes/QueryPage.php" );
foreach ( $wgQueryPages as $page ) {
- @list( $class, $special, $limit ) = $page;
+ list( $class, $special ) = $page;
+ $limit = isset( $page[2] ) ? $page[2] : null;
# --list : just show the name of pages
if ( $this->hasOption( 'list' ) ) {
@@ -78,16 +79,20 @@ class UpdateSpecialPages extends Maintenance {
continue;
}
- $specialObj = SpecialPage::getPage( $special );
+ $specialObj = SpecialPageFactory::getPage( $special );
if ( !$specialObj ) {
$this->output( "No such special page: $special\n" );
exit;
}
- if ( !class_exists( $class ) ) {
- $file = $specialObj->getFile();
- require_once( $file );
+ if ( $specialObj instanceof QueryPage ) {
+ $queryPage = $specialObj;
+ } else {
+ if ( !class_exists( $class ) ) {
+ $file = $specialObj->getFile();
+ require_once( $file );
+ }
+ $queryPage = new $class;
}
- $queryPage = new $class;
if ( !$this->hasOption( 'only' ) || $this->getOption( 'only' ) == $queryPage->getName() ) {
$this->output( sprintf( '%-30s ', $special ) );
@@ -126,7 +131,7 @@ class UpdateSpecialPages extends Maintenance {
$dbw->commit();
}
# Wait for the slave to catch up
- wfWaitForSlaves( 5 );
+ wfWaitForSlaves();
} else {
$this->output( "cheap, skipped\n" );
}