X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateCategory.php;h=65d272b30392238c7db1ba0ed4f6c91949646914;hb=b8caeb626cc6be0e2924cbee944acfa89ec59773;hp=15087f8c1d6c59f84cf686d293dcc677288a1004;hpb=229e1f4fdbda91f10f5ce78f0d35db973c714b1d;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateCategory.php b/maintenance/populateCategory.php index 15087f8c1d..65d272b303 100644 --- a/maintenance/populateCategory.php +++ b/maintenance/populateCategory.php @@ -25,7 +25,7 @@ require_once __DIR__ . '/Maintenance.php'; /** - * Mainteance script to populate the category table. + * Maintenance script to populate the category table. * * @ingroup Maintenance */ @@ -57,12 +57,6 @@ TEXT; false, true ); - $this->addOption( - 'max-slave-lag', - 'If slave lag exceeds this many seconds, wait until it drops before continuing. Default: 10', - false, - true - ); $this->addOption( 'throttle', 'Wait this many milliseconds after each category. Default: 0', @@ -74,13 +68,9 @@ TEXT; public function execute() { $begin = $this->getOption( 'begin', '' ); - $maxSlaveLag = $this->getOption( 'max-slave-lag', 10 ); $throttle = $this->getOption( 'throttle', 0 ); $force = $this->getOption( 'force', false ); - $this->doPopulateCategory( $begin, $maxSlaveLag, $throttle, $force ); - } - private function doPopulateCategory( $begin, $maxlag, $throttle, $force ) { $dbw = wfGetDB( DB_MASTER ); if ( !$force ) { @@ -92,8 +82,9 @@ TEXT; ); if ( $row ) { $this->output( "Category table already populated. Use php " . - "maintenance/populateCategory.php\n--force from the command line " . - "to override.\n" ); + "maintenance/populateCategory.php\n--force from the command line " . + "to override.\n" ); + return true; } } @@ -141,16 +132,17 @@ TEXT; } if ( $dbw->insert( - 'updatelog', - array( 'ul_key' => 'populate category' ), - __METHOD__, - 'IGNORE' - ) - ) { + 'updatelog', + array( 'ul_key' => 'populate category' ), + __METHOD__, + 'IGNORE' + ) ) { $this->output( "Category population complete.\n" ); + return true; } else { $this->output( "Could not insert category population row.\n" ); + return false; } }