From: Alexandre Emsenhuber Date: Mon, 23 Nov 2009 18:20:26 +0000 (+0000) Subject: removed trailing whitespaces X-Git-Tag: 1.31.0-rc.0~38728 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=d0e8b1f9ac7d3f151d5ab9311c592d606d97d5d7;p=lhc%2Fweb%2Fwiklou.git removed trailing whitespaces --- diff --git a/maintenance/nextJobDB.php b/maintenance/nextJobDB.php index 2244532bae..75855bb3e3 100644 --- a/maintenance/nextJobDB.php +++ b/maintenance/nextJobDB.php @@ -29,6 +29,7 @@ class nextJobDB extends Maintenance { $this->mDescription = "Pick a database that has pending jobs"; $this->addOption( 'type', "The type of job to search for", false, true ); } + public function execute() { global $wgMemc; $type = $this->getOption( 'type', false ); @@ -36,18 +37,18 @@ class nextJobDB extends Maintenance { ? "jobqueue:dbs" : "jobqueue:dbs:$type"; $pendingDBs = $wgMemc->get( $mckey ); - + # If we didn't get it from the cache if( !$pendingDBs ) { $pendingDBs = $this->getPendingDbs( $type ); $wgMemc->get( $mckey, $pendingDBs, 300 ); } - # If we've got a pending job in a db, display it. + # If we've got a pending job in a db, display it. if ( $pendingDBs ) { $this->output( $pendingDBs[mt_rand(0, count( $pendingDBs ) - 1)] ); } } - + /** * Get all databases that have a pending job * @param $type String Job type @@ -62,12 +63,11 @@ class nextJobDB extends Maintenance { $lb = wfGetLB( $db ); $dbsByMaster[$lb->getServerName(0)][] = $db; } - + foreach ( $dbsByMaster as $master => $dbs ) { $dbConn = wfGetDB( DB_MASTER, array(), $dbs[0] ); - $stype = $dbConn->addQuotes($type); - - + $stype = $dbConn->addQuotes( $type ); + # Padding row for MySQL bug $sql = "(SELECT '-------------------------------------------' as db)"; foreach ( $dbs as $wikiId ) { diff --git a/maintenance/updateSpecialPages.php b/maintenance/updateSpecialPages.php index fd1b2cac61..8e5e45d13b 100644 --- a/maintenance/updateSpecialPages.php +++ b/maintenance/updateSpecialPages.php @@ -65,18 +65,18 @@ class UpdateSpecialPages extends Maintenance { foreach( $wgQueryPages as $page ) { @list( $class, $special, $limit ) = $page; - + # --list : just show the name of pages if( $this->hasOption('list') ) { $this->output( "$special\n" ); continue; } - + if ( !$this->hasOption('override') && $wgDisableQueryPageUpdate && in_array( $special, $wgDisableQueryPageUpdate ) ) { $this->output( sprintf( "%-30s disabled\n", $special ) ); continue; } - + $specialObj = SpecialPage::getPage( $special ); if ( !$specialObj ) { $this->output( "No such special page: $special\n" ); @@ -87,7 +87,7 @@ class UpdateSpecialPages extends Maintenance { require_once( $file ); } $queryPage = new $class; - + if( !$this->hasOption('only') || $this->getOption('only') == $queryPage->getName() ) { $this->output( sprintf( '%-30s ', $special ) ); if ( $queryPage->isExpensive() ) { @@ -99,7 +99,7 @@ class UpdateSpecialPages extends Maintenance { $this->output( "FAILED: database error\n" ); } else { $this->output( "got $num rows in " ); - + $elapsed = ($t2[0] - $t1[0]) + ($t2[1] - $t1[1]); $hours = intval( $elapsed / 3600 ); $minutes = intval( $elapsed % 3600 / 60 );