<?php
+use MediaWiki\MediaWikiServices;
+
/**
* ExtensionRegistry class
*
}
public function __construct() {
- // We use a try/catch instead of the $fallback parameter because
- // we don't want to fail here if $wgObjectCaches is not configured
- // properly for APC setup
+ // We use a try/catch because we don't want to fail here
+ // if $wgObjectCaches is not configured properly for APC setup
try {
- $this->cache = ObjectCache::getLocalServerInstance();
+ $this->cache = MediaWikiServices::getInstance()->getLocalServerObjectCache();
} catch ( MWException $e ) {
$this->cache = new EmptyBagOStuff();
}
if ( !is_array( $info ) ) {
throw new Exception( "$path is not a valid JSON file." );
}
+
+ // Check any constraints against MediaWiki core
+ $requires = $processor->getRequirements( $info );
+ if ( isset( $requires[self::MEDIAWIKI_CORE] )
+ && !$coreVersionParser->check( $requires[self::MEDIAWIKI_CORE] )
+ ) {
+ // Doesn't match, mark it as incompatible.
+ $incompatible[] = "{$info['name']} is not compatible with the current "
+ . "MediaWiki core (version {$wgVersion}), it requires: " . $requires[self::MEDIAWIKI_CORE]
+ . '.';
+ continue;
+ }
+
if ( !isset( $info['manifest_version'] ) ) {
// For backwards-compatability, assume a version of 1
$info['manifest_version'] = 1;
if ( $version < self::OLDEST_MANIFEST_VERSION || $version > self::MANIFEST_VERSION ) {
throw new Exception( "$path: unsupported manifest_version: {$version}" );
}
+
$autoload = $this->processAutoLoader( dirname( $path ), $info );
// Set up the autoloader now so custom processors will work
$GLOBALS['wgAutoloadClasses'] += $autoload;
$autoloadClasses += $autoload;
- // Check any constraints against MediaWiki core
- $requires = $processor->getRequirements( $info );
- if ( isset( $requires[self::MEDIAWIKI_CORE] )
- && !$coreVersionParser->check( $requires[self::MEDIAWIKI_CORE] )
- ) {
- // Doesn't match, mark it as incompatible.
- $incompatible[] = "{$info['name']} is not compatible with the current "
- . "MediaWiki core (version {$wgVersion}), it requires: " . $requires[self::MEDIAWIKI_CORE]
- . '.';
- continue;
- }
+
// Get extra paths for later inclusion
$autoloaderPaths = array_merge( $autoloaderPaths,
$processor->getExtraAutoloaderPaths( dirname( $path ), $info ) );
case 'array_merge_recursive':
$GLOBALS[$key] = array_merge_recursive( $GLOBALS[$key], $val );
break;
+ case 'array_replace_recursive':
+ $GLOBALS[$key] = array_replace_recursive( $GLOBALS[$key], $val );
+ break;
case 'array_plus_2d':
$GLOBALS[$key] = wfArrayPlus2d( $GLOBALS[$key], $val );
break;