r83718 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83717‎ | r83718 | r83719 >
Date:20:59, 11 March 2011
Author:saper
Status:ok
Tags:
Comment:
Fix PHP Parse error from r83715, use $wgExtensionAssetsPath

* $wgScriptPath/extensions -> $wgExtensionAssetsPath
* Fix syntax error, unexpected T_DOUBLE_ARROW in
CentralNotice/SpecialBannerLoader.php on line 16
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialBannerLoader.php (modified) (history)
  • /trunk/extensions/CentralNotice/SpecialNoticeTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialBannerLoader.php
@@ -157,10 +157,10 @@
158158 }
159159
160160 private function fetchUrl($url) {
161 - $ctx = stream_context_create('http' => array(
 161+ $ctx = stream_context_create(array('http' => array(
162162 'method' => "GET",
163163 'header' => "User-Agent: CentralNotice/1.0 (+http://www.mediawiki.org/wiki/Extension:CentralNotice)\r\n")
164 - );
 164+ ));
165165 wfSuppressWarnings();
166166 $content = file_get_contents( $url, false, $ctx);
167167 wfRestoreWarnings();
Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php
@@ -17,13 +17,13 @@
1818 * Handle different types of page requests
1919 */
2020 function execute( $sub ) {
21 - global $wgOut, $wgUser, $wgRequest, $wgScriptPath;
 21+ global $wgOut, $wgUser, $wgRequest, $wgExtensionAssetsPath;
2222
2323 // Begin output
2424 $this->setHeaders();
2525
2626 // Add style file to the output headers
27 - $wgOut->addExtensionStyle( "$wgScriptPath/extensions/CentralNotice/centralnotice.css" );
 27+ $wgOut->addExtensionStyle( "$wgExtensionAssetsPath/CentralNotice/centralnotice.css" );
2828
2929 // Add localized script error messages
3030 $scriptVars = array(
@@ -32,7 +32,7 @@
3333 $wgOut->addScript( Skin::makeVariablesScript( $scriptVars ) );
3434
3535 // Add script file to the output headers
36 - $wgOut->addScriptFile( "$wgScriptPath/extensions/CentralNotice/centralnotice.js" );
 36+ $wgOut->addScriptFile( "$wgExtensionAssetsPath/CentralNotice/centralnotice.js" );
3737
3838 // Check permissions
3939 $this->editable = $wgUser->isAllowed( 'centralnotice-admin' );
@@ -216,8 +216,8 @@
217217 * Show "Add a banner" interface
218218 */
219219 function showAdd() {
220 - global $wgOut, $wgUser, $wgScriptPath, $wgLang, $wgRequest;
221 - $scriptPath = "$wgScriptPath/extensions/CentralNotice";
 220+ global $wgOut, $wgUser, $wgExtensionAssetsPath, $wgLang, $wgRequest;
 221+ $scriptPath = "$wgExtensionAssetsPath/CentralNotice";
222222
223223 // Build HTML
224224 $htmlOut = '';
@@ -291,9 +291,9 @@
292292 * View or edit an individual banner
293293 */
294294 private function showView() {
295 - global $wgOut, $wgUser, $wgRequest, $wgLanguageCode, $wgScriptPath, $wgLang;
 295+ global $wgOut, $wgUser, $wgRequest, $wgLanguageCode, $wgExtensionAssetsPath, $wgLang;
296296
297 - $scriptPath = "$wgScriptPath/extensions/CentralNotice";
 297+ $scriptPath = "$wgExtensionAssetsPath/CentralNotice";
298298 $sk = $wgUser->getSkin();
299299
300300 if ( $this->editable ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83715Improve fetching of the donation amount, remove unecessary globals....saper20:29, 11 March 2011

Status & tagging log