Jack Phoenix has submitted this change and it was merged.

Change subject: Removed legacy i18n file + $dir var from setup file
......................................................................


Removed legacy i18n file + $dir var from setup file

Change-Id: I3dff1a6aad0de7216f87f746e92adc2320acf0aa
---
D Phalanx.i18n.php
M Phalanx.php
2 files changed, 13 insertions(+), 50 deletions(-)

Approvals:
  Jack Phoenix: Verified; Looks good to me, approved



diff --git a/Phalanx.i18n.php b/Phalanx.i18n.php
deleted file mode 100644
index e015aea..0000000
--- a/Phalanx.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * This is a backwards-compatibility shim, generated by:
- * 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * Beginning with MediaWiki 1.23, translation strings are stored in json files,
- * and the EXTENSION.i18n.php file only exists to provide compatibility with
- * older releases of MediaWiki. For more information about this migration, see:
- * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
- *
- * This shim maintains compatibility back to MediaWiki 1.17.
- */
-$messages = array();
-if ( !function_exists( 'wfJsonI18nShimff050ad7aa0b8a61' ) ) {
-       function wfJsonI18nShimff050ad7aa0b8a61( $cache, $code, &$cachedData ) {
-               $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
-               foreach ( $codeSequence as $csCode ) {
-                       $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json";
-                       if ( is_readable( $fileName ) ) {
-                               $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
-                               foreach ( array_keys( $data ) as $key ) {
-                                       if ( $key === '' || $key[0] === '@' ) {
-                                               unset( $data[$key] );
-                                       }
-                               }
-                               $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
-                       }
-
-                       $cachedData['deps'][] = new FileDependency( $fileName );
-               }
-               return true;
-       }
-
-       $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShimff050ad7aa0b8a61';
-}
diff --git a/Phalanx.php b/Phalanx.php
index e128ecd..1338f0f 100644
--- a/Phalanx.php
+++ b/Phalanx.php
@@ -65,26 +65,24 @@
 );
 
 // Autoload classes
-$dir = __DIR__ . '/';
+$wgAutoloadClasses['Phalanx'] = __DIR__ . '/Phalanx.class.php';
 
-$wgAutoloadClasses['Phalanx'] = $dir . 'Phalanx.class.php';
+$wgAutoloadClasses['UserBlock'] = __DIR__ . '/blocks/UserBlock.class.php';
+//$wgAutoloadClasses['UserCookieBlock'] = __DIR__ . 
'/blocks/UserCookieBlock.class.php';
+$wgAutoloadClasses['ContentBlock'] = __DIR__ . 
'/blocks/ContentBlock.class.php';
+$wgAutoloadClasses['TitleBlock'] = __DIR__ . '/blocks/TitleBlock.class.php';
+#$wgAutoloadClasses['QuestionTitleBlock'] = __DIR__ . 
'/blocks/QuestionTitleBlock.class.php';
+#$wgAutoloadClasses['RecentQuestionsBlock'] = __DIR__ . 
'/blocks/RecentQuestionsBlock.class.php';
+#$wgAutoloadClasses['WikiCreationBlock'] = __DIR__ . 
'/blocks/WikiCreationBlock.class.php';
 
-$wgAutoloadClasses['UserBlock'] = $dir . 'blocks/UserBlock.class.php';
-//$wgAutoloadClasses['UserCookieBlock'] = $dir . 
'blocks/UserCookieBlock.class.php';
-$wgAutoloadClasses['ContentBlock'] = $dir . 'blocks/ContentBlock.class.php';
-$wgAutoloadClasses['TitleBlock'] = $dir . 'blocks/TitleBlock.class.php';
-#$wgAutoloadClasses['QuestionTitleBlock'] = $dir . 
'blocks/QuestionTitleBlock.class.php';
-#$wgAutoloadClasses['RecentQuestionsBlock'] = $dir . 
'blocks/RecentQuestionsBlock.class.php';
-#$wgAutoloadClasses['WikiCreationBlock'] = $dir . 
'blocks/WikiCreationBlock.class.php';
-
+// i18n
 $wgMessagesDirs['Phalanx'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['Phalanx'] = $dir . 'Phalanx.i18n.php';
 
 // Set up the new special pages
-$wgAutoloadClasses['SpecialPhalanx'] = $dir . 'SpecialPhalanx.body.php';
-$wgAutoloadClasses['PhalanxStats'] = $dir . 'SpecialPhalanxStats.body.php';
-$wgAutoloadClasses['PhalanxHelper'] = $dir . 'PhalanxHelper.class.php';
-$wgAutoloadClasses['PhalanxAjax'] = $dir . 'PhalanxAjax.class.php';
+$wgAutoloadClasses['SpecialPhalanx'] = __DIR__ . '/SpecialPhalanx.body.php';
+$wgAutoloadClasses['PhalanxStats'] = __DIR__ . '/SpecialPhalanxStats.body.php';
+$wgAutoloadClasses['PhalanxHelper'] = __DIR__ . '/PhalanxHelper.class.php';
+$wgAutoloadClasses['PhalanxAjax'] = __DIR__ . '/PhalanxAjax.class.php';
 
 $wgSpecialPages['Phalanx'] = 'SpecialPhalanx';
 $wgSpecialPages['PhalanxStats'] = 'PhalanxStats';

-- 
To view, visit https://gerrit.wikimedia.org/r/169735
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3dff1a6aad0de7216f87f746e92adc2320acf0aa
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Phalanx
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to