X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FpopulateCategory.php;h=ab0ca1ede42548f87427ff7ab34d4219c3dca3c0;hb=f0edb3e368a5fc69218d20f76f1538b68f37db42;hp=ae54d698a6b04c211f97eac91c8f491667a51497;hpb=f6cbdfb5e2c3ffc05858612e219a24e22bdbc72e;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateCategory.php b/maintenance/populateCategory.php index ae54d698a6..ab0ca1ede4 100644 --- a/maintenance/populateCategory.php +++ b/maintenance/populateCategory.php @@ -22,7 +22,7 @@ * @author Simetrical */ -require_once( __DIR__ . '/Maintenance.php' ); +require_once __DIR__ . '/Maintenance.php'; /** * Mainteance script to populate the category table. @@ -51,9 +51,24 @@ 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( + '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( 'force', 'Run regardless of whether the database says it\'s been run already' ); } @@ -77,8 +92,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,20 +142,21 @@ 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; } } } $maintClass = "PopulateCategory"; -require_once( RUN_MAINTENANCE_IF_MAIN ); +require_once RUN_MAINTENANCE_IF_MAIN;