$options doesn't exist in PurgeList
authorSam Reed <reedy@users.mediawiki.org>
Sat, 27 Nov 2010 14:18:54 +0000 (14:18 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 27 Nov 2010 14:18:54 +0000 (14:18 +0000)
Change to getOptions, and addOption in Constructor

maintenance/doMaintenance.php
maintenance/purgeList.php

index bf51c2c..794776d 100644 (file)
@@ -69,7 +69,7 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
        $callback = MW_CONFIG_CALLBACK;
        # PHP 5.1 doesn't support "class::method" for call_user_func, so split it
        if ( strpos( $callback, '::' ) !== false ) {
-               $callback = explode( '::', $callback, 2);
+               $callback = explode( '::', $callback, 2 );
        }
        call_user_func( $callback );
 } elseif ( file_exists( "$IP/wmf-config/wikimedia-mode" ) ) {
index 9842c7a..e75e2d7 100644 (file)
@@ -26,6 +26,7 @@ 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() {
@@ -42,7 +43,7 @@ class PurgeList extends Maintenance {
                                        $url = $title->getFullUrl();
                                        $this->output( "$url\n" );
                                        $urls[] = $url;
-                                       if ( isset( $options['purge'] ) ) {
+                                       if ( $this->getOptions( 'purge' ) ) {
                                                $title->invalidateCache();
                                        }
                                } else {