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

Revision: 73435
Author:   kaldari
Date:     2010-09-21 01:41:10 +0000 (Tue, 21 Sep 2010)

Log Message:
-----------
some debugging output

Modified Paths:
--------------
    trunk/extensions/CentralNotice/CentralNotice.php
    trunk/extensions/CentralNotice/SpecialBannerListLoader.php
    trunk/extensions/CentralNotice/SpecialCentralNotice.php

Modified: trunk/extensions/CentralNotice/CentralNotice.php
===================================================================
--- trunk/extensions/CentralNotice/CentralNotice.php    2010-09-21 01:35:00 UTC 
(rev 73434)
+++ trunk/extensions/CentralNotice/CentralNotice.php    2010-09-21 01:41:10 UTC 
(rev 73435)
@@ -51,6 +51,8 @@
 // smallish if you will. :)
 $wgNoticeServerTimeout = 0;
 
+$cnDebug = '';
+
 // Source for live counter information
 $wgNoticeCounterSource = "http://donate.wikimedia.org/counter.php";;
 

Modified: trunk/extensions/CentralNotice/SpecialBannerListLoader.php
===================================================================
--- trunk/extensions/CentralNotice/SpecialBannerListLoader.php  2010-09-21 
01:35:00 UTC (rev 73434)
+++ trunk/extensions/CentralNotice/SpecialBannerListLoader.php  2010-09-21 
01:41:10 UTC (rev 73435)
@@ -64,9 +64,11 @@
         * Generate JSON for the specified site
         */
        function getJsonList() {
+               global $cnDebug;
                
                // Quick short circuit to be able to show preferred notices
                $templates = array();
+               $cnDebug = ' //';
 
                if ( $this->language == 'en' && $this->project != null ) {
                        // See if we have any preferred notices for all of en
@@ -76,6 +78,7 @@
                                // Pull banners
                                $templates = 
CentralNoticeDB::selectTemplatesAssigned( $notices );
                        }
+                       $cnDebug .= ' 1';
                }
 
                if ( !$templates && $this->project == 'wikipedia' ) {
@@ -86,14 +89,16 @@
                                // Pull banners
                                $templates = 
CentralNoticeDB::selectTemplatesAssigned( $notices );
                        }
+                       $cnDebug .= ' 2';
                }
 
                // Didn't find any preferred matches so do an old style lookup
                if ( !$templates )  {
                        $templates = CentralNotice::selectNoticeTemplates( 
$this->project, $this->language, $this->location );
+                       $cnDebug .= ' 3';
                }
                
-               return FormatJson::encode( $templates );
+               return FormatJson::encode( $templates ) . $cnDebug;
        }
        
 }

Modified: trunk/extensions/CentralNotice/SpecialCentralNotice.php
===================================================================
--- trunk/extensions/CentralNotice/SpecialCentralNotice.php     2010-09-21 
01:35:00 UTC (rev 73434)
+++ trunk/extensions/CentralNotice/SpecialCentralNotice.php     2010-09-21 
01:41:10 UTC (rev 73435)
@@ -1005,6 +1005,8 @@
         * @return A 2D array of running banners with associated weights and 
settings
         */
        static function selectNoticeTemplates( $project, $language, $location = 
null ) {
+               global $cnDebug, $wgDBname;
+               
                $campaigns = array();
                $dbr = wfGetDB( DB_SLAVE );
                $encTimestamp = $dbr->addQuotes( $dbr->timestamp() );
@@ -1065,6 +1067,7 @@
                                $campaigns[] = $row->not_id;
                        }
                }
+               $cnDebug .= ' campaigns: '.count( $campaigns ).' database: 
'.$wgDBname;
                
                $templates = array();
                if ( $campaigns ) {



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

Reply via email to