diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-06-22 11:28:20 +0200 |
commit | 9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch) | |
tree | 46d1a0dee7febef5c2d57a9f7b972be16a163b3d /maintenance/nextJobDB.php | |
parent | 78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff) |
update to MediaWiki 1.17.0
Diffstat (limited to 'maintenance/nextJobDB.php')
-rw-r--r-- | maintenance/nextJobDB.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/maintenance/nextJobDB.php b/maintenance/nextJobDB.php index 75855bb3..8d8229e2 100644 --- a/maintenance/nextJobDB.php +++ b/maintenance/nextJobDB.php @@ -21,7 +21,7 @@ * @ingroup Maintenance */ -require_once( dirname(__FILE__) . '/Maintenance.php' ); +require_once( dirname( __FILE__ ) . '/Maintenance.php' ); class nextJobDB extends Maintenance { public function __construct() { @@ -39,13 +39,13 @@ class nextJobDB extends Maintenance { $pendingDBs = $wgMemc->get( $mckey ); # If we didn't get it from the cache - if( !$pendingDBs ) { + if ( !$pendingDBs ) { $pendingDBs = $this->getPendingDbs( $type ); - $wgMemc->get( $mckey, $pendingDBs, 300 ); + $wgMemc->set( $mckey, $pendingDBs, 300 ); } # If we've got a pending job in a db, display it. if ( $pendingDBs ) { - $this->output( $pendingDBs[mt_rand(0, count( $pendingDBs ) - 1)] ); + $this->output( $pendingDBs[mt_rand( 0, count( $pendingDBs ) - 1 )] ); } } @@ -61,10 +61,10 @@ class nextJobDB extends Maintenance { $dbsByMaster = array(); foreach ( $wgLocalDatabases as $db ) { $lb = wfGetLB( $db ); - $dbsByMaster[$lb->getServerName(0)][] = $db; + $dbsByMaster[$lb->getServerName( 0 )][] = $db; } - foreach ( $dbsByMaster as $master => $dbs ) { + foreach ( $dbsByMaster as $dbs ) { $dbConn = wfGetDB( DB_MASTER, array(), $dbs[0] ); $stype = $dbConn->addQuotes( $type ); @@ -100,4 +100,4 @@ class nextJobDB extends Maintenance { } $maintClass = "nextJobDb"; -require_once( DO_MAINTENANCE ); +require_once( RUN_MAINTENANCE_IF_MAIN ); |