Mollywhite has submitted this change and it was merged.

Change subject: Bug 50987: Use a directory variable instead of calling 
repeatedly.
......................................................................


Bug 50987: Use a directory variable instead of calling repeatedly.

Storing $dir = __DIR__, then using that instead of using __DIR__
repeatedly.

Bug: 50987
Change-Id: Id81a701c22c61526cc53e5d3a91263d1b7c6824c
---
M BookManagerv2.php
1 file changed, 10 insertions(+), 8 deletions(-)

Approvals:
  Mollywhite: Verified; Looks good to me, approved



diff --git a/BookManagerv2.php b/BookManagerv2.php
index f52f518..e9acf97 100644
--- a/BookManagerv2.php
+++ b/BookManagerv2.php
@@ -42,6 +42,8 @@
 
 //Configuration
 
+$dir = __DIR__;
+
 /**
  * @var bool|string: URI or false if not set.
  * URI of api.php on schema wiki.
@@ -74,7 +76,7 @@
 function jsonValidate( $object, $schema = NULL ) {
        if ( NULL == $schema ) {
                //Default to using JSON schema
-               $json = file_get_contents( __DIR__ . '/schemas/bookschema.json' 
);
+               $json = file_get_contents( $dir . '/schemas/bookschema.json' );
                $schema = FormatJson::decode( $json, true );
        }
 
@@ -88,21 +90,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/72660
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

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

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

Reply via email to