* @ingroup Maintenance
*/
-require_once( __DIR__ . '/Maintenance.php' );
+require_once __DIR__ . '/Maintenance.php';
/**
* Maintenance script that sends purge requests for listed pages to squid.
if ( $this->hasOption( 'all' ) ) {
$this->purgeNamespace( false );
} elseif ( $this->hasOption( 'namespace' ) ) {
- $this->purgeNamespace( intval( $this->getOption( 'namespace') ) );
+ $this->purgeNamespace( intval( $this->getOption( 'namespace' ) ) );
} else {
$this->doPurge();
}
$this->output( "Done!\n" );
}
- /** Purge URL coming from stdin */
+ /**
+ * Purge URL coming from stdin
+ */
private function doPurge() {
$stdin = $this->getStdin();
$urls = array();
$this->sendPurgeRequest( $urls );
}
- /** Purge a namespace or all pages */
+ /**
+ * Purge a namespace or all pages
+ *
+ * @param int|bool $namespace
+ */
private function purgeNamespace( $namespace = false ) {
$dbr = wfGetDB( DB_SLAVE );
$startId = 0;
/**
* Helper to purge an array of $urls
- * @param $urls array List of URLS to purge from squids
+ * @param array $urls List of URLS to purge from squids
*/
private function sendPurgeRequest( $urls ) {
if ( $this->hasOption( 'delay' ) ) {
}
} else {
if ( $this->hasOption( 'verbose' ) ) {
- $this->output( implode( "\n", $urls ) . "\n" );
+ $this->output( implode( "\n", $urls ) . "\n" );
}
$u = new SquidUpdate( $urls );
$u->doUpdate();
}
}
-
}
$maintClass = "PurgeList";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;