X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateCategory.php;h=66553bc6bfe9b095aac9be677ca39ca8188207a5;hb=937ae6444a683a3b0aaf14c21f529ad0e91419ef;hp=4c8cdaa18a59c011ed9279f37019d7b58f98466c;hpb=f10c9815e69b59844c178d218640bd1ac0435896;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateCategory.php b/maintenance/populateCategory.php index 4c8cdaa18a..66553bc6bf 100644 --- a/maintenance/populateCategory.php +++ b/maintenance/populateCategory.php @@ -51,21 +51,26 @@ When the script has finished, it will make a note of this in the database, and will not run again without the --force option. TEXT; # ' - $this->addOption( 'begin', 'Only do categories whose names are alphabetically after the provided name', 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', false, true ); + $this->addOption( + 'begin', + 'Only do categories whose names are alphabetically after the provided name', + false, + true + ); + $this->addOption( + 'throttle', + 'Wait this many milliseconds after each category. Default: 0', + false, + true + ); $this->addOption( 'force', 'Run regardless of whether the database says it\'s been run already' ); } 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 ) { @@ -77,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; } } @@ -126,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; } }