X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FpopulateCategory.php;h=508960d725d7ee465118f76ec08091826bb0b964;hb=8e0ef3e187b4b8ebe847dbc8ae1ec2b96ed58ae0;hp=87a46998e2ac7b028ae94b924d9f7fb65786ed71;hpb=3071f1fad720f1773864621158a0c59b73124896;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/populateCategory.php b/maintenance/populateCategory.php index 87a46998e2..508960d725 100644 --- a/maintenance/populateCategory.php +++ b/maintenance/populateCategory.php @@ -71,7 +71,7 @@ TEXT public function execute() { $begin = $this->getOption( 'begin', '' ); $throttle = $this->getOption( 'throttle', 0 ); - $force = $this->getOption( 'force', false ); + $force = $this->hasOption( 'force' ); $dbw = $this->getDB( DB_MASTER ); @@ -93,9 +93,9 @@ TEXT $throttle = intval( $throttle ); if ( $begin !== '' ) { - $where = 'cl_to > ' . $dbw->addQuotes( $begin ); + $where = [ 'cl_to > ' . $dbw->addQuotes( $begin ) ]; } else { - $where = null; + $where = [ '1 = 1' ]; } $i = 0; @@ -133,22 +133,16 @@ TEXT usleep( $throttle * 1000 ); } - if ( $dbw->insert( + $dbw->insert( 'updatelog', [ 'ul_key' => 'populate category' ], __METHOD__, - 'IGNORE' - ) ) { - $this->output( "Category population complete.\n" ); - - return true; - } else { - $this->output( "Could not insert category population row.\n" ); + [ 'IGNORE' ] + ); - return false; - } + return true; } } -$maintClass = "PopulateCategory"; +$maintClass = PopulateCategory::class; require_once RUN_MAINTENANCE_IF_MAIN;