Mollywhite has uploaded a new change for review.

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


Change subject: Use __DIR__ directly, instead of storing it in a variable.
......................................................................

Use __DIR__ directly, instead of storing it in a variable.

I had switched to using $dir = __DIR__ and then using $dir each
time I needed the directory. I've been told this is less efficient
and that __DIR__ should be used, so I'm changing it back.

Change-Id: I958adb52ab4d0056c8c2dbe24d289d451141dd94
---
M BookManagerv2.php
1 file changed, 7 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BookManagerv2 
refs/changes/45/72745/1

diff --git a/BookManagerv2.php b/BookManagerv2.php
index 22adf71..f52f518 100644
--- a/BookManagerv2.php
+++ b/BookManagerv2.php
@@ -42,8 +42,6 @@
 
 //Configuration
 
-$dir = __DIR__;
-
 /**
  * @var bool|string: URI or false if not set.
  * URI of api.php on schema wiki.
@@ -90,21 +88,21 @@
 // Register files
 $wgAutoloadClasses += array(
        //Hooks
-       'BookManagerv2Hooks' => $dir . '/BookManagerv2.hooks.php',
-       'JsonHooks' => $dir . '/includes/JsonHooks.php',
+       'BookManagerv2Hooks' => __DIR__ . '/BookManagerv2.hooks.php',
+       'JsonHooks' => __DIR__ . '/includes/JsonHooks.php',
 
        //ContentHandler
-       'JsonBookContent' => $dir . '/includes/JsonContent.php',
+       'JsonBookContent' => __DIR__ . '/includes/JsonContent.php',
 
        //ResourceLoaderModule
-       'RemoteSchema' => $dir . '/includes/RemoteSchema.php',
+       'RemoteSchema' => __DIR__ . '/includes/RemoteSchema.php',
 
        //Json
-       'JsonTreeRef' => $dir . '/includes/JsonSchema.php',
-       'JsonSchemaException' => $dir . '/includes/JsonSchema.php',
+       'JsonTreeRef' => __DIR__ . '/includes/JsonSchema.php',
+       'JsonSchemaException' => __DIR__ . '/includes/JsonSchema.php',
 
        //API
-       'ApiJsonSchema' => $dir . '/includes/ApiJsonSchema.php',
+       'ApiJsonSchema' => __DIR__ . '/includes/ApiJsonSchema.php',
 );
 
 // Register hooks

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I958adb52ab4d0056c8c2dbe24d289d451141dd94
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BookManagerv2
Gerrit-Branch: master
Gerrit-Owner: Mollywhite <[email protected]>

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

Reply via email to