X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FupdateSpecialPages.php;h=d67ef6bb1a4820ab73b5c6c5cc467f891bbb8018;hb=ed07e7d9baa6a98e428be5556bb798e6c4b75642;hp=fae9063c00fef4c2020a43e9417b656fe584668d;hpb=166191535f486569277e95b7e6a3850b5db6757d;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/updateSpecialPages.php b/maintenance/updateSpecialPages.php index fae9063c00..d67ef6bb1a 100644 --- a/maintenance/updateSpecialPages.php +++ b/maintenance/updateSpecialPages.php @@ -34,8 +34,8 @@ class UpdateSpecialPages extends Maintenance { parent::__construct(); $this->addOption( 'list', 'List special page names' ); $this->addOption( 'only', 'Only update "page"; case sensitive, ' . - 'check correct case by calling this script with --list or on ' . - 'includes/QueryPage.php. Ex: --only=BrokenRedirects', false, true ); + 'check correct case by calling this script with --list. ' . + 'Ex: --only=BrokenRedirects', false, true ); $this->addOption( 'override', 'Also update pages that have updates disabled' ); } @@ -81,16 +81,16 @@ class UpdateSpecialPages extends Maintenance { if ( !$this->hasOption( 'only' ) || $this->getOption( 'only' ) == $queryPage->getName() ) { $this->output( sprintf( '%-30s [QueryPage] ', $special ) ); if ( $queryPage->isExpensive() ) { - $t1 = explode( ' ', microtime() ); + $t1 = microtime( true ); # Do the query $num = $queryPage->recache( $limit === null ? $wgQueryCacheLimit : $limit ); - $t2 = explode( ' ', microtime() ); + $t2 = microtime( true ); if ( $num === false ) { $this->output( "FAILED: database error\n" ); } else { $this->output( "got $num rows in " ); - $elapsed = ( $t2[0] - $t1[0] ) + ( $t2[1] - $t1[1] ); + $elapsed = $t2 - $t1; $hours = intval( $elapsed / 3600 ); $minutes = intval( $elapsed % 3600 / 60 ); $seconds = $elapsed - $hours * 3600 - $minutes * 60; @@ -139,12 +139,12 @@ class UpdateSpecialPages extends Maintenance { continue; } $this->output( sprintf( '%-30s [callback] ', $special ) ); - $t1 = explode( ' ', microtime() ); + $t1 = microtime( true ); call_user_func( $call, $dbw ); - $t2 = explode( ' ', microtime() ); + $t2 = microtime( true ); $this->output( "completed in " ); - $elapsed = ( $t2[0] - $t1[0] ) + ( $t2[1] - $t1[1] ); + $elapsed = $t2 - $t1; $hours = intval( $elapsed / 3600 ); $minutes = intval( $elapsed % 3600 / 60 ); $seconds = $elapsed - $hours * 3600 - $minutes * 60;