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

Revision: 73445
Author:   tomasz
Date:     2010-09-21 03:04:22 +0000 (Tue, 21 Sep 2010)

Log Message:
-----------
Syncing up to head of trunk

Modified Paths:
--------------
    branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.db.php
    branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerLoader.php

Property Changed:
----------------
    branches/wmf/1.16wmf4/extensions/CentralNotice/


Property changes on: branches/wmf/1.16wmf4/extensions/CentralNotice
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/wmf-deployment/extensions/CentralNotice:60970
/trunk/extensions/CentralNotice:62820-67552,67557,67559-71720,71725-71731,71734-71739,71748-71753,71774-71997,72058-72131,72136-73406,73433,73435,73437,73439,73441-73442
/trunk/phase3/extensions/CentralNotice:63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816
   + /branches/wmf-deployment/extensions/CentralNotice:60970
/trunk/extensions/CentralNotice:62820-67552,67557,67559-71720,71725-71731,71734-71739,71748-71753,71774-71997,72058-72131,72136-73406,73433,73435,73437,73439,73441-73442,73444
/trunk/phase3/extensions/CentralNotice:63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816

Modified: branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.db.php
===================================================================
--- branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.db.php 
2010-09-21 03:02:04 UTC (rev 73444)
+++ branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.db.php 
2010-09-21 03:04:22 UTC (rev 73445)
@@ -19,11 +19,12 @@
         * By default returns enabled campaigns, if $enabled set to false, 
returns both enabled and disabled campaigns
         */
        static function getNotices( $project = false, $language = false, $date 
= false, $enabled = true, $preferred = false, $location = false ) {
+               global $wgCentralDBname;
        
                $notices = array();
                
                // Database setup
-               $dbr = wfGetDB( DB_SLAVE );
+               $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname );
                
                if ( !$date ) {
                        $encTimestamp = $dbr->addQuotes( $dbr->timestamp() );
@@ -122,7 +123,9 @@
         * Given one or more campaign ids, return all banners bound to them
         */
        static function selectTemplatesAssigned( $campaigns ) {
-               $dbr = wfGetDB( DB_SLAVE );
+               global $wgCentralDBname;
+               
+               $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname );
 
                if ( $campaigns ) {
                        // Pull templates based on join with assignments

Modified: branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerLoader.php
===================================================================
--- branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerLoader.php      
2010-09-21 03:02:04 UTC (rev 73444)
+++ branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerLoader.php      
2010-09-21 03:04:22 UTC (rev 73445)
@@ -16,12 +16,8 @@
        }
        
        function execute( $par ) {
-               global $wgOut, $wgRequest, $wgDBname, $wgCentralDBname;
+               global $wgOut, $wgRequest;
                
-               // Temporarily switch to central wiki database
-               $localDBname = $wgDBname;
-               $wgDBname = $wgCentralDBname;
-               
                $wgOut->disable();
                $this->sendHeaders();
                
@@ -48,9 +44,6 @@
                } else {
                        echo "<!-- No banner specified -->";
                }
-               
-               // Switch back to local wiki database
-               $wgDBname = $localDBname;
        }
        
        /**



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

Reply via email to