Index: branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialBannerListLoader.php |
— | — | @@ -64,9 +64,11 @@ |
65 | 65 | * Generate JSON for the specified site |
66 | 66 | */ |
67 | 67 | function getJsonList() { |
| 68 | + global $cnDebug; |
68 | 69 | |
69 | 70 | // Quick short circuit to be able to show preferred notices |
70 | 71 | $templates = array(); |
| 72 | + $cnDebug = ' //'; |
71 | 73 | |
72 | 74 | if ( $this->language == 'en' && $this->project != null ) { |
73 | 75 | // See if we have any preferred notices for all of en |
— | — | @@ -76,6 +78,7 @@ |
77 | 79 | // Pull banners |
78 | 80 | $templates = CentralNoticeDB::selectTemplatesAssigned( $notices ); |
79 | 81 | } |
| 82 | + $cnDebug .= ' 1'; |
80 | 83 | } |
81 | 84 | |
82 | 85 | if ( !$templates && $this->project == 'wikipedia' ) { |
— | — | @@ -86,14 +89,16 @@ |
87 | 90 | // Pull banners |
88 | 91 | $templates = CentralNoticeDB::selectTemplatesAssigned( $notices ); |
89 | 92 | } |
| 93 | + $cnDebug .= ' 2'; |
90 | 94 | } |
91 | 95 | |
92 | 96 | // Didn't find any preferred matches so do an old style lookup |
93 | 97 | if ( !$templates ) { |
94 | 98 | $templates = CentralNotice::selectNoticeTemplates( $this->project, $this->language, $this->location ); |
| 99 | + $cnDebug .= ' 3'; |
95 | 100 | } |
96 | 101 | |
97 | | - return FormatJson::encode( $templates ); |
| 102 | + return FormatJson::encode( $templates ) . $cnDebug; |
98 | 103 | } |
99 | 104 | |
100 | 105 | } |
Index: branches/wmf/1.16wmf4/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -51,6 +51,8 @@ |
52 | 52 | // smallish if you will. :) |
53 | 53 | $wgNoticeServerTimeout = 0; |
54 | 54 | |
| 55 | +$cnDebug = ''; |
| 56 | + |
55 | 57 | // Source for live counter information |
56 | 58 | $wgNoticeCounterSource = "http://donate.wikimedia.org/counter.php"; |
57 | 59 | |
Index: branches/wmf/1.16wmf4/extensions/CentralNotice/SpecialCentralNotice.php |
— | — | @@ -1005,6 +1005,8 @@ |
1006 | 1006 | * @return A 2D array of running banners with associated weights and settings |
1007 | 1007 | */ |
1008 | 1008 | static function selectNoticeTemplates( $project, $language, $location = null ) { |
| 1009 | + global $cnDebug, $wgDBname; |
| 1010 | + |
1009 | 1011 | $campaigns = array(); |
1010 | 1012 | $dbr = wfGetDB( DB_SLAVE ); |
1011 | 1013 | $encTimestamp = $dbr->addQuotes( $dbr->timestamp() ); |
— | — | @@ -1065,6 +1067,7 @@ |
1066 | 1068 | $campaigns[] = $row->not_id; |
1067 | 1069 | } |
1068 | 1070 | } |
| 1071 | + $cnDebug .= ' campaigns: '.count( $campaigns ).' database: '.$wgDBname; |
1069 | 1072 | |
1070 | 1073 | $templates = array(); |
1071 | 1074 | if ( $campaigns ) { |
Index: branches/wmf/1.16wmf4/extensions/CentralNotice/patches/patch-notice_countries.sql |
— | — | @@ -5,4 +5,4 @@ |
6 | 6 | nc_country varchar(2) NOT NULL |
7 | 7 | ) /*$wgDBTableOptions*/; |
8 | 8 | 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 |
10 | 10 | Merged /trunk/extensions/CentralNotice:r73433,73435 |