Chad has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/322774

Change subject: Remove kind of silly getDir() wrapper
......................................................................

Remove kind of silly getDir() wrapper

Needless function overhead when __DIR__ will work just fine

Change-Id: I20cbd26a39d88454fb8ba2a5e9626e0dfea0e7e1
---
M StickToThatLanguage.hooks.php
M StickToThatLanguage.php
2 files changed, 5 insertions(+), 21 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/StickToThatLanguage 
refs/changes/74/322774/1

diff --git a/StickToThatLanguage.hooks.php b/StickToThatLanguage.hooks.php
index a3b6b42..12d629a 100644
--- a/StickToThatLanguage.hooks.php
+++ b/StickToThatLanguage.hooks.php
@@ -24,7 +24,7 @@
         * @return bool
         */
        public static function registerUnitTests( array &$files ) {
-               $files[] = Ext::getDir() . '/tests/phpunit/ExtTest.php'; // 
STTLanguage\Ext (extension class)
+               $files[] = __DIR__ . '/tests/phpunit/ExtTest.php'; // 
STTLanguage\Ext (extension class)
                return true;
        }
 
diff --git a/StickToThatLanguage.php b/StickToThatLanguage.php
index e500624..61b5329 100644
--- a/StickToThatLanguage.php
+++ b/StickToThatLanguage.php
@@ -35,10 +35,10 @@
 
 // i18n
 $wgMessagesDirs['StickToThatLanguage'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['StickToThatLanguage'] = Ext::getDir() . 
'/StickToThatLanguage.i18n.php';
+$wgExtensionMessagesFiles['StickToThatLanguage'] = __DIR__ . 
'/StickToThatLanguage.i18n.php';
 
 // Autoloading
-$wgAutoloadClasses['STTLanguage\Hooks']   = Ext::getDir() . 
'/StickToThatLanguage.hooks.php';
+$wgAutoloadClasses['STTLanguage\Hooks']   = __DIR__ . 
'/StickToThatLanguage.hooks.php';
 
 // hooks registration:
 $wgHooks['UnitTestsList'][]                    = 
'STTLanguage\Hooks::registerUnitTests';
@@ -57,7 +57,7 @@
 
 // Resource Loader Module:
 $wgResourceModules['sticktothatlanguage'] = array(
-       'localBasePath' => Ext::getDir(),
+       'localBasePath' => __DIR__,
        'remoteExtPath' => 'StickToThatLanguage',
        'scripts' => array(
                'resources/StickToThatLanguage.js'
@@ -76,7 +76,7 @@
 );
 
 // Include settings:
-require_once Ext::getDir() . '/StickToThatLanguage.settings.php';
+require_once __DIR__ . '/StickToThatLanguage.settings.php';
 
 
 /**
@@ -94,22 +94,6 @@
         * @var string
         */
        const VERSION = '0.2.0';
-
-       /**
-        * Returns the extensions base installation directory.
-        *
-        * @since 0.1
-        *
-        * @return string
-        */
-       public static function getDir() {
-               static $dir = null;
-
-               if( $dir === null ) {
-                       $dir = dirname( __FILE__ );
-               }
-               return $dir;
-       }
 
        /**
         * Returns the list of languages the user has set as preferred 
languages in the preferences.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I20cbd26a39d88454fb8ba2a5e9626e0dfea0e7e1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/StickToThatLanguage
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>

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

Reply via email to