24 return [
'HookContainer',
'VirtualDomains',
'ExtensionTaskSpecs' ];
29 $this->
getContext()->provide(
'VirtualDomains', [] );
30 $this->
getContext()->provide(
'ExtensionTaskSpecs', [] );
31 return Status::newGood();
36 define(
'MW_EXTENSIONS_LOADED',
true );
38 $legacySchemaHooks = $this->getAutoExtensionLegacySchemaHooks();
39 $data = $this->getAutoExtensionData();
40 if ( isset( $data[
'globals'][
'wgHooks'][
'LoadExtensionSchemaUpdates'] ) ) {
41 $legacySchemaHooks = array_merge( $legacySchemaHooks,
42 $data[
'globals'][
'wgHooks'][
'LoadExtensionSchemaUpdates'] );
44 $extDeprecatedHooks = $data[
'attributes'][
'DeprecatedHooks'] ?? [];
46 $legacyHooks = $legacySchemaHooks ? [
'LoadExtensionSchemaUpdates' => $legacySchemaHooks ] : [];
51 $data[
'attributes'][
'Hooks'] ?? [],
57 $this->
getContext()->provide(
'VirtualDomains',
58 $data[
'attributes'][
'DatabaseVirtualDomains'] ?? [] );
59 $this->
getContext()->provide(
'ExtensionTaskSpecs',
60 $data[
'attributes'][
'InstallerTasks'] ?? [] );
62 return Status::newGood();
69 return MW_INSTALL_PATH .
'/extensions';
76 return MW_INSTALL_PATH .
'/skins';
85 private function getAutoExtensionLegacySchemaHooks() {
86 $exts = $this->getOption(
'Extensions' );
87 $extensionsDir = $this->getExtensionsDir();
89 foreach ( $exts as $e ) {
90 if ( file_exists(
"$extensionsDir/$e/$e.php" ) ) {
91 $files[] =
"$extensionsDir/$e/$e.php";
96 return $this->includeExtensionFiles( $files );
109 private function includeExtensionFiles( $files ) {
128 foreach ( $files as $file ) {
137 $hooksWeWant =
$wgHooks[
'LoadExtensionSchemaUpdates'] ?? [];
148 private function getAutoExtensionData() {
149 $exts = $this->getOption(
'Extensions' );
151 $extensionProcessor =
new ExtensionProcessor();
152 foreach ( $exts as $e ) {
153 $jsonPath = $this->getExtensionsDir() .
"/$e/extension.json";
154 if ( file_exists( $jsonPath ) ) {
155 $extensionProcessor->extractInfoFromFile( $jsonPath );
159 $autoload = $extensionProcessor->getExtractedAutoloadInfo();
164 return $extensionProcessor->getExtractedInfo();
if(!defined( 'MEDIAWIKI')) if(ini_get('mbstring.func_overload')) if(!defined( 'MW_ENTRY_POINT')) global $IP
Environment checks.
if(!defined('MW_SETUP_CALLBACK'))
Locations of core classes Extension classes are specified with $wgAutoloadClasses.
static registerClasses(array $files)
Register a file to load the given class from.
static loadFiles(array $files)
Batch version of loadFile()
static registerNamespaces(array $dirs)
Register a directory to load the classes of a given namespace from, per PSR4.
This class contains schema declarations for all configuration variables known to MediaWiki core.
static listDefaultValues(string $prefix='')
Returns a generator for iterating over all config settings and their default values.
$wgStyleDirectory
Config variable stub for the StyleDirectory setting, for use by phpdoc and IDEs.
$wgHooks
Config variable stub for the Hooks setting, for use by phpdoc and IDEs.
$wgExtensionDirectory
Config variable stub for the ExtensionDirectory setting, for use by phpdoc and IDEs.