Legoktm has uploaded a new change for review.

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

Change subject: registration: Throw more obvious error when a file doesn't exist
......................................................................

registration: Throw more obvious error when a file doesn't exist

Previously it was saying the file that didn't exist wasn't valid JSON,
which was confusing.

Change-Id: I8381295ffcaba4e0dbfe9b93bdad80f86c119129
---
M includes/registration/ExtensionRegistry.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/74/208674/1

diff --git a/includes/registration/ExtensionRegistry.php 
b/includes/registration/ExtensionRegistry.php
index 5ef3853..394a38d 100644
--- a/includes/registration/ExtensionRegistry.php
+++ b/includes/registration/ExtensionRegistry.php
@@ -62,7 +62,8 @@
        }
 
        public function __construct() {
-               $this->cache = ObjectCache::newAccelerator( array(), CACHE_NONE 
);
+               //$this->cache = ObjectCache::newAccelerator( array(), 
CACHE_NONE );
+               $this->cache = new EmptyBagOStuff();
        }
 
        /**
@@ -114,6 +115,9 @@
                $autoloadClasses = array();
                foreach ( $queue as $path => $mtime ) {
                        $json = file_get_contents( $path );
+                       if ( $json === false ) {
+                               throw new Exception( "Unable to read $path, 
does it exist?" );
+                       }
                        $info = json_decode( $json, /* $assoc = */ true );
                        if ( !is_array( $info ) ) {
                                throw new Exception( "$path is not a valid JSON 
file." );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8381295ffcaba4e0dbfe9b93bdad80f86c119129
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to