registration: Throw more obvious error when a file doesn't exist
[lhc/web/wiklou.git] / includes / registration / ExtensionRegistry.php
index 5ef3853..74d49bc 100644 (file)
@@ -114,6 +114,9 @@ class ExtensionRegistry {
                $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." );