<?php
/**
- * Run this script periodically if you have miser mode enabled, to refresh the
- * caches
+ * Update for cached special pages.
+ * Run this script periodically if you have miser mode enabled.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
require_once( __DIR__ . '/Maintenance.php' );
+/**
+ * Maintenance script to update cached special pages.
+ *
+ * @ingroup Maintenance
+ */
class UpdateSpecialPages extends Maintenance {
public function __construct() {
parent::__construct();
$this->error( "Uncallable function $call!" );
continue;
}
+ $this->output( sprintf( '%-30s ', $special ) );
$t1 = explode( ' ', microtime() );
call_user_func( $call, $dbw );
$t2 = explode( ' ', microtime() );
- $this->output( sprintf( '%-30s ', $special ) );
$elapsed = ( $t2[0] - $t1[0] ) + ( $t2[1] - $t1[1] );
$hours = intval( $elapsed / 3600 );
$minutes = intval( $elapsed % 3600 / 60 );
}
if ( !$this->hasOption( 'only' ) || $this->getOption( 'only' ) == $queryPage->getName() ) {
- $this->output( sprintf( '%-30s ', $special ) );
+ $this->output( sprintf( '%-30s ', $special ) );
if ( $queryPage->isExpensive() ) {
$t1 = explode( ' ', microtime() );
# Do the query
$this->output( sprintf( "%.2fs\n", $seconds ) );
}
# Reopen any connections that have closed
- if ( !wfGetLB()->pingAll() ) {
+ if ( !wfGetLB()->pingAll() ) {
$this->output( "\n" );
do {
$this->error( "Connection failed, reconnecting in 10 seconds..." );
}
$maintClass = "UpdateSpecialPages";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;