diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
commit | 9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch) | |
tree | 46d1a0dee7febef5c2d57a9f7b972be16a163b3d /maintenance/purgeList.php | |
parent | 78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff) |
update to MediaWiki 1.17.0
Diffstat (limited to 'maintenance/purgeList.php')
-rw-r--r-- | maintenance/purgeList.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/maintenance/purgeList.php b/maintenance/purgeList.php index 7168a203..17be6d3d 100644 --- a/maintenance/purgeList.php +++ b/maintenance/purgeList.php @@ -20,29 +20,30 @@ * @ingroup Maintenance */ -require_once( dirname(__FILE__) . '/Maintenance.php' ); +require_once( dirname( __FILE__ ) . '/Maintenance.php' ); class PurgeList extends Maintenance { public function __construct() { parent::__construct(); $this->mDescription = "Send purge requests for listed pages to squid"; + $this->addOption( 'purge', 'Whether to update page touched.' , false, false ); } public function execute() { $stdin = $this->getStdin(); $urls = array(); - while( !feof( $stdin ) ) { + while ( !feof( $stdin ) ) { $page = trim( fgets( $stdin ) ); if ( substr( $page, 0, 7 ) == 'http://' ) { $urls[] = $page; - } elseif( $page !== '' ) { + } elseif ( $page !== '' ) { $title = Title::newFromText( $page ); - if( $title ) { + if ( $title ) { $url = $title->getFullUrl(); $this->output( "$url\n" ); $urls[] = $url; - if( isset( $options['purge'] ) ) { + if ( $this->getOptions( 'purge' ) ) { $title->invalidateCache(); } } else { @@ -60,4 +61,4 @@ class PurgeList extends Maintenance { } $maintClass = "PurgeList"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); |