r73436 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73435‎ | r73436 | r73437 >
Date:01:45, 21 September 2010
Author:tomasz
Status:deferred
Tags:
Comment:
Sync up deployment for testing changes
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/CentralNotice (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerListLoader.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialCentralNotice.php (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/CentralNotice/patches/patch-notice_countries.sql (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerListLoader.php
@@ -64,9 +64,11 @@
6565 * Generate JSON for the specified site
6666 */
6767 function getJsonList() {
 68+ global $cnDebug;
6869
6970 // Quick short circuit to be able to show preferred notices
7071 $templates = array();
 72+ $cnDebug = ' //';
7173
7274 if ( $this->language == 'en' && $this->project != null ) {
7375 // See if we have any preferred notices for all of en
@@ -76,6 +78,7 @@
7779 // Pull banners
7880 $templates = CentralNoticeDB::selectTemplatesAssigned( $notices );
7981 }
 82+ $cnDebug .= ' 1';
8083 }
8184
8285 if ( !$templates && $this->project == 'wikipedia' ) {
@@ -86,14 +89,16 @@
8790 // Pull banners
8891 $templates = CentralNoticeDB::selectTemplatesAssigned( $notices );
8992 }
 93+ $cnDebug .= ' 2';
9094 }
9195
9296 // Didn't find any preferred matches so do an old style lookup
9397 if ( !$templates ) {
9498 $templates = CentralNotice::selectNoticeTemplates( $this->project, $this->language, $this->location );
 99+ $cnDebug .= ' 3';
95100 }
96101
97 - return FormatJson::encode( $templates );
 102+ return FormatJson::encode( $templates ) . $cnDebug;
98103 }
99104
100105 }
Index: branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.php
@@ -51,6 +51,8 @@
5252 // smallish if you will. :)
5353 $wgNoticeServerTimeout = 0;
5454
 55+$cnDebug = '';
 56+
5557 // Source for live counter information
5658 $wgNoticeCounterSource = "http://donate.wikimedia.org/counter.php";
5759
Index: branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialCentralNotice.php
@@ -1005,6 +1005,8 @@
10061006 * @return A 2D array of running banners with associated weights and settings
10071007 */
10081008 static function selectNoticeTemplates( $project, $language, $location = null ) {
 1009+ global $cnDebug, $wgDBname;
 1010+
10091011 $campaigns = array();
10101012 $dbr = wfGetDB( DB_SLAVE );
10111013 $encTimestamp = $dbr->addQuotes( $dbr->timestamp() );
@@ -1065,6 +1067,7 @@
10661068 $campaigns[] = $row->not_id;
10671069 }
10681070 }
 1071+ $cnDebug .= ' campaigns: '.count( $campaigns ).' database: '.$wgDBname;
10691072
10701073 $templates = array();
10711074 if ( $campaigns ) {
Index: branches/wmf/1.16wmf4/extensions/CentralNotice/patches/patch-notice_countries.sql
@@ -5,4 +5,4 @@
66 nc_country varchar(2) NOT NULL
77 ) /*$wgDBTableOptions*/;
88 CREATE UNIQUE INDEX /*i*/nc_notice_id_country ON /*$wgDBprefix*/cn_notice_countries (nc_notice_id, nc_country);
9 -ALTER TABLE /*$wgDBprefix*/cn_notices ADD not_geo BOOLEAN NOT NULL DEFAULT '0' AFTER not_locked;
 9+ALTER TABLE /*$wgDBprefix*/cn_notices ADD not_geo bool NOT NULL DEFAULT '0' AFTER not_locked;
Property changes on: branches/wmf/1.16wmf4/extensions/CentralNotice
___________________________________________________________________
Modified: svn:mergeinfo
1010 Merged /trunk/extensions/CentralNotice:r73433,73435

Status & tagging log