http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88561

Revision: 88561
Author:   ialex
Date:     2011-05-22 08:32:40 +0000 (Sun, 22 May 2011)
Log Message:
-----------
Fixes for wfGetDB() calls:
* its name is wfGetDB(), not wfGetDb()
* changed obsolete constants DB_READ and DB_WRITE to respectively DB_SLAVE and 
DB_MASTER
* removed PHP4-isms

Modified Paths:
--------------
    trunk/extensions/WikiAtHome/ApiWikiAtHome.php
    trunk/extensions/WikiAtHome/WahJobManager.php

Modified: trunk/extensions/WikiAtHome/ApiWikiAtHome.php
===================================================================
--- trunk/extensions/WikiAtHome/ApiWikiAtHome.php       2011-05-22 08:24:07 UTC 
(rev 88560)
+++ trunk/extensions/WikiAtHome/ApiWikiAtHome.php       2011-05-22 08:32:40 UTC 
(rev 88561)
@@ -159,7 +159,7 @@
                }
                //issue the jobDone to the Manager:
                WahJobManager :: updateJobDone($job, $wgUser->getId());
-               $dbw = &wfGetDb( DB_READ );
+               $dbw = wfGetDB( DB_SLAVE );
 
                //check if its the "last" job shell out a Join command
                $wjm = WahJobManager::newFromSet( $jobSet );

Modified: trunk/extensions/WikiAtHome/WahJobManager.php
===================================================================
--- trunk/extensions/WikiAtHome/WahJobManager.php       2011-05-22 08:24:07 UTC 
(rev 88560)
+++ trunk/extensions/WikiAtHome/WahJobManager.php       2011-05-22 08:32:40 UTC 
(rev 88561)
@@ -48,7 +48,7 @@
        function getSet(){
                if( isset( $this->mSetRow ) )
                        return $this->mSetRow;
-               $dbr = &wfGetDb( DB_READ );
+               $dbr = &wfGetDB( DB_SLAVE );
                //grab the jobset
                $this->mSetRow = $dbr->selectRow('wah_jobset',
                        '*',
@@ -72,7 +72,7 @@
                        //return 0 percent done
                        return 0;
                }else{
-                       $dbr = &wfGetDb( DB_READ );
+                       $dbr = wfGetDB( DB_SLAVE );
                        //quick check if we are done at the set level:
                        if( $setRow->set_done_time ){
                                if( $this->doSetFileCheck() ){
@@ -122,7 +122,7 @@
         */
        static function getNewJob( $jobset_id = false , $reqMode = 'AtHome'){
                global $wgNumberOfClientsPerJobSet, $wgJobTimeOut, $wgUser, 
$wgJobTypeConfig;
-               $dbr = wfGetDb( DB_READ );
+               $dbr = wfGetDB( DB_SLAVE );
 
                //its always best to assigning from jobset (since the user 
already has the data)
                if( $jobset_id ){
@@ -235,8 +235,8 @@
         */
        static function assignJob( & $job, $jobSet = false, $doUpdate=true ){
                global $wgUser;
-               $dbr = wfGetDb( DB_READ );
-               $dbw = wfGetDb( DB_WRITE );
+               $dbr = wfGetDB( DB_SLAVE );
+               $dbw = wfGetDB( DB_MASTER );
                if( $jobSet == false ){
                        $jobSet = self::getJobSetById( $job->job_set_id );
                }
@@ -281,7 +281,7 @@
                return $job;
        }
        static function getJobSetById( $set_id ){
-               $dbr = wfGetDb( DB_READ );
+               $dbr = wfGetDB( DB_SLAVE );
                return  $dbr->selectRow('wah_jobset', '*',
                        array(
                                'set_id' => $set_id
@@ -290,7 +290,7 @@
                );
        }
        static function getJobById( $job_id ){
-               $dbr = wfGetDb( DB_READ );
+               $dbr = wfGetDB( DB_SLAVE );
                return $dbr->selectRow('wah_jobqueue', '*',
                        array(
                                'job_id' => $job_id
@@ -304,7 +304,7 @@
        function doJobSetup(){
                global $wgDerivativeSettings, $wgJobTypeConfig;
                $fname = 'WahJobManager::doJobSetup';
-               $dbw = &wfGetDb( DB_WRITE );
+               $dbw = wfGetDB( DB_MASTER );
 
                if( $wgJobTypeConfig[ $this->getJobTypeKey() ]['chunkDuration'] 
== 0){
                        $set_job_count = 1;
@@ -380,7 +380,7 @@
                //if its in the "sequence" namespace then its a flatten job
        }
        function updateSetDone($jobSet, $user_id=0){
-               $dbw = &wfGetDb( DB_WRITE );
+               $dbw = wfGetDB( DB_MASTER );
                $dbw->update('wah_jobset',
                        array(
                                'set_done_time' => time()
@@ -395,7 +395,7 @@
                );
        }
        function updateJobDone(&$job, $user_id=0){
-               $dbw = &wfGetDb( DB_WRITE );
+               $dbw = wfGetDB( DB_MASTER );
                //update the jobqueue table with job done time & user
                $dbw->update('wah_jobqueue',
                        array(


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to