r112092 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112091‎ | r112092 | r112093 >
Date:09:21, 22 February 2012
Author:tstarling
Status:ok
Tags:
Comment:
More fixes for mergeMessageFileList.php:
* In CustomUserSignup, wrap the ClickTracking reference in a class_exists() block
* In FlaggedRevs, include FlaggedRevsUI.setup.php manually instead of relying on $wgAutoloadClasses, and remove array type hinting from various setup functions, since the lack of any configuration globals causes them to give a fatal error otherwise
* In ZeroRatedMobileAccess, use a static function for the hook instead of a nonstatic class member, both to fix mergeMessageFileList.php and for startup performance. Apparently the author does not know why we have *.body.php files.
Modified paths:
  • /trunk/extensions/CustomUserSignup/CustomUserSignup.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/frontend/FlaggedRevsUI.setup.php (modified) (history)
  • /trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php (modified) (history)
  • /trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CustomUserSignup/CustomUserSignup.php
@@ -45,5 +45,7 @@
4646 $wgCustomUserSignupVersion = 1;
4747 $wgCustomUserSignupSetBuckets = true;
4848 // For Account Creation Project
49 -ClickTrackingHooks::addCampaign($dir. 'modules', 'CustomUserSignup/modules', 'AccountCreationUserBucket' );
 49+if ( class_exists( 'ClickTrackingHooks' ) ) {
 50+ ClickTrackingHooks::addCampaign($dir. 'modules', 'CustomUserSignup/modules', 'AccountCreationUserBucket' );
 51+}
5052
Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.php
@@ -41,6 +41,4 @@
4242
4343 $wgEnableZeroRatedMobileAccessTesting = false;
4444
45 -$wgExtZeroRatedMobileAccess = new ExtZeroRatedMobileAccess();
46 -
47 -$wgHooks['BeforePageDisplay'][] = array( &$wgExtZeroRatedMobileAccess, 'beforePageDisplayHTML' );
\ No newline at end of file
 45+$wgHooks['BeforePageDisplay'][] = 'ExtZeroRatedMobileAccess::onBeforePageDisplay';
Index: trunk/extensions/ZeroRatedMobileAccess/ZeroRatedMobileAccess.body.php
@@ -16,6 +16,11 @@
1717 private static $forceClickToViewImages;
1818 public static $useFormat;
1919
 20+ public static function onBeforePageDisplay( &$out, &$text ) {
 21+ $ext = new ExtZeroRatedMobileAccess();
 22+ return $ext->beforePageDisplayHTML( $out, $text );
 23+ }
 24+
2025 /**
2126 * Handler for the BeforePageDisplay hook
2227 *
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -42,6 +42,7 @@
4343
4444 # Define were PHP files and i18n files are located
4545 require( dirname( __FILE__ ) . '/FlaggedRevs.setup.php' );
 46+require( dirname( __FILE__ ) . '/frontend/FlaggedRevsUI.setup.php' );
4647 FlaggedRevsSetup::defineSourcePaths( $wgAutoloadClasses, $wgExtensionMessagesFiles );
4748
4849 # Define JS/CSS modules and file locations
Index: trunk/extensions/FlaggedRevs/frontend/FlaggedRevsUI.setup.php
@@ -182,7 +182,7 @@
183183 * @param $ajaxExportList Array $wgAjaxExportList
184184 * @return void
185185 */
186 - public static function defineAjaxFunctions( array &$ajaxExportList ) {
 186+ public static function defineAjaxFunctions( &$ajaxExportList ) {
187187 $ajaxExportList[] = 'RevisionReview::AjaxReview';
188188 $ajaxExportList[] = 'FlaggablePageView::AjaxBuildDiffHeaderItems';
189189 }
@@ -195,7 +195,7 @@
196196 * @return void
197197 */
198198 public static function defineLogBasicDescription(
199 - array &$logNames, array &$logHeaders, array &$filterLogTypes
 199+ &$logNames, &$logHeaders, &$filterLogTypes
200200 ) {
201201 $logNames['review'] = 'review-logpage';
202202 $logHeaders['review'] = 'review-logpagetext';
@@ -213,7 +213,7 @@
214214 * @return void
215215 */
216216 public static function defineLogActionHandlers(
217 - array &$logActions, array &$logActionsHandlers
 217+ &$logActions, &$logActionsHandlers
218218 ) {
219219 # Various actions are used for log filtering ...
220220 $logActions['review/approve'] = 'review-logentry-app'; // checked (again)

Sign-offs

UserFlagDate
Nikerabbitinspected10:19, 22 February 2012

Follow-up revisions

RevisionCommit summaryAuthorDate
r112093MFT r112092: mergeMessageFileList.php fixeststarling09:27, 22 February 2012

Status & tagging log