/**
* Version of the highest supported manifest version
+ * Note: Update MANIFEST_VERSION_MW_VERSION when changing this
*/
const MANIFEST_VERSION = 2;
+ /**
+ * MediaWiki version constraint representing what the current
+ * highest MANIFEST_VERSION is supported in
+ */
+ const MANIFEST_VERSION_MW_VERSION = '>= 1.29.0';
+
/**
* Version of the oldest supported manifest version
*/
private static $instance;
/**
+ * @codeCoverageIgnore
* @return ExtensionRegistry
*/
public static function getInstance() {
} else {
throw new Exception( "$path does not exist!" );
}
+ // @codeCoverageIgnoreStart
if ( !$mtime ) {
$err = error_get_last();
throw new Exception( "Couldn't stat $path: {$err['message']}" );
+ // @codeCoverageIgnoreEnd
}
}
$this->queued[$path] = $mtime;
* @param array $queue keys are filenames, values are ignored
* @return array extracted info
* @throws Exception
+ * @throws ExtensionDependencyError
*/
public function readFromQueue( array $queue ) {
global $wgVersion;
);
if ( $incompatible ) {
- if ( count( $incompatible ) === 1 ) {
- throw new Exception( $incompatible[0] );
- } else {
- throw new Exception( implode( "\n", $incompatible ) );
- }
+ throw new ExtensionDependencyError( $incompatible );
}
// Need to set this so we can += to it later
// Optimistic: If the global is not set, or is an empty array, replace it entirely.
// Will be O(1) performance.
- if ( !isset( $GLOBALS[$key] ) || ( is_array( $GLOBALS[$key] ) && !$GLOBALS[$key] ) ) {
+ if ( !array_key_exists( $key, $GLOBALS ) || ( is_array( $GLOBALS[$key] ) && !$GLOBALS[$key] ) ) {
$GLOBALS[$key] = $val;
continue;
}
return $this->loaded;
}
- /**
- * Mark a thing as loaded
- *
- * @param string $name
- * @param array $credits
- */
- protected function markLoaded( $name, array $credits ) {
- $this->loaded[$name] = $credits;
- }
-
/**
* Fully expand autoloader paths
*