MediaWiki  master
ExtensionProcessor.php
Go to the documentation of this file.
1 <?php
2 
3 class ExtensionProcessor implements Processor {
4 
10  protected static $globalSettings = [
11  'ActionFilteredLogs',
12  'Actions',
13  'AddGroups',
14  'APIFormatModules',
15  'APIListModules',
16  'APIMetaModules',
17  'APIModules',
18  'APIPropModules',
19  'AuthManagerAutoConfig',
20  'AvailableRights',
21  'CentralIdLookupProviders',
22  'ChangeCredentialsBlacklist',
23  'ConfigRegistry',
24  'ContentHandlers',
25  'DefaultUserOptions',
26  'ExtensionEntryPointListFiles',
27  'ExtensionFunctions',
28  'FeedClasses',
29  'FileExtensions',
30  'FilterLogTypes',
31  'GrantPermissionGroups',
32  'GrantPermissions',
33  'GroupPermissions',
34  'GroupsAddToSelf',
35  'GroupsRemoveFromSelf',
36  'HiddenPrefs',
37  'ImplicitGroups',
38  'JobClasses',
39  'LogActions',
40  'LogActionsHandlers',
41  'LogHeaders',
42  'LogNames',
43  'LogRestrictions',
44  'LogTypes',
45  'MediaHandlers',
46  'PasswordPolicy',
47  'RateLimits',
48  'RawHtmlMessages',
49  'ReauthenticateTime',
50  'RecentChangesFlags',
51  'RemoveCredentialsBlacklist',
52  'RemoveGroups',
53  'ResourceLoaderSources',
54  'RevokePermissions',
55  'SessionProviders',
56  'SpecialPages',
57  'ValidSkinNames',
58  ];
59 
65  protected const CORE_ATTRIBS = [
66  'ParsoidModules',
67  'RestRoutes',
68  'SkinOOUIThemes',
69  'SearchMappings',
70  'TrackingCategories',
71  ];
72 
80  protected const MERGE_STRATEGIES = [
81  'wgAuthManagerAutoConfig' => 'array_plus_2d',
82  'wgCapitalLinkOverrides' => 'array_plus',
83  'wgExtraGenderNamespaces' => 'array_plus',
84  'wgGrantPermissions' => 'array_plus_2d',
85  'wgGroupPermissions' => 'array_plus_2d',
86  'wgHooks' => 'array_merge_recursive',
87  'wgNamespaceContentModels' => 'array_plus',
88  'wgNamespaceProtection' => 'array_plus',
89  'wgNamespacesWithSubpages' => 'array_plus',
90  'wgPasswordPolicy' => 'array_merge_recursive',
91  'wgRateLimits' => 'array_plus_2d',
92  'wgRevokePermissions' => 'array_plus_2d',
93  ];
94 
100  protected const CREDIT_ATTRIBS = [
101  'type',
102  'author',
103  'description',
104  'descriptionmsg',
105  'license-name',
106  'name',
107  'namemsg',
108  'url',
109  'version',
110  ];
111 
118  protected const NOT_ATTRIBS = [
119  'callback',
120  'config',
121  'config_prefix',
122  'load_composer_autoloader',
123  'manifest_version',
124  'namespaces',
125  'requires',
126  'AutoloadClasses',
127  'ExtensionMessagesFiles',
128  'Hooks',
129  'MessagePosterModule',
130  'MessagesDirs',
131  'OOUIThemePaths',
132  'ParserTestFiles',
133  'QUnitTestModule',
134  'ResourceFileModulePaths',
135  'ResourceModuleSkinStyles',
136  'ResourceModules',
137  'ServiceWiringFiles',
138  ];
139 
147  protected $globals = [
148  'wgExtensionMessagesFiles' => [],
149  'wgMessagesDirs' => [],
150  ];
151 
157  protected $defines = [];
158 
165  protected $callbacks = [];
166 
170  protected $credits = [];
171 
175  protected $config = [];
176 
183  protected $attributes = [];
184 
191  protected $extAttributes = [];
192 
198  public function extractInfo( $path, array $info, $version ) {
199  $dir = dirname( $path );
200  $this->extractHooks( $info, $path );
201  $this->extractExtensionMessagesFiles( $dir, $info );
202  $this->extractMessagesDirs( $dir, $info );
203  $this->extractSkinImportPaths( $dir, $info );
204  $this->extractNamespaces( $info );
205  $this->extractResourceLoaderModules( $dir, $info );
206  if ( isset( $info['ServiceWiringFiles'] ) ) {
207  $this->extractPathBasedGlobal(
208  'wgServiceWiringFiles',
209  $dir,
210  $info['ServiceWiringFiles']
211  );
212  }
213  if ( isset( $info['ParserTestFiles'] ) ) {
214  $this->extractPathBasedGlobal(
215  'wgParserTestFiles',
216  $dir,
217  $info['ParserTestFiles']
218  );
219  }
220  $name = $this->extractCredits( $path, $info );
221  if ( isset( $info['callback'] ) ) {
222  $this->callbacks[$name] = $info['callback'];
223  }
224 
225  // config should be after all core globals are extracted,
226  // so duplicate setting detection will work fully
227  if ( $version === 2 ) {
228  $this->extractConfig2( $info, $dir );
229  } else {
230  // $version === 1
231  $this->extractConfig1( $info );
232  }
233 
234  // Record the extension name in the ParsoidModules property
235  if ( isset( $info['ParsoidModules'] ) ) {
236  foreach ( $info['ParsoidModules'] as &$module ) {
237  $module['name'] = $name;
238  }
239  }
240 
241  if ( $version === 2 ) {
242  $this->extractAttributes( $path, $info );
243  }
244 
245  foreach ( $info as $key => $val ) {
246  // If it's a global setting,
247  if ( in_array( $key, self::$globalSettings ) ) {
248  $this->storeToArrayRecursive( $path, "wg$key", $val, $this->globals );
249  continue;
250  }
251  // Ignore anything that starts with a @
252  if ( $key[0] === '@' ) {
253  continue;
254  }
255 
256  if ( $version === 2 ) {
257  // Only whitelisted attributes are set
258  if ( in_array( $key, self::CORE_ATTRIBS ) ) {
259  $this->storeToArray( $path, $key, $val, $this->attributes );
260  }
261  } else {
262  // version === 1
263  if ( !in_array( $key, self::NOT_ATTRIBS )
264  && !in_array( $key, self::CREDIT_ATTRIBS )
265  ) {
266  // If it's not blacklisted, it's an attribute
267  $this->storeToArrayRecursive( $path, $key, $val, $this->attributes );
268  }
269  }
270  }
271  }
272 
277  protected function extractAttributes( $path, array $info ) {
278  if ( isset( $info['attributes'] ) ) {
279  foreach ( $info['attributes'] as $extName => $value ) {
280  $this->storeToArrayRecursive( $path, $extName, $value, $this->extAttributes );
281  }
282  }
283  }
284 
285  public function getExtractedInfo() {
286  // Make sure the merge strategies are set
287  foreach ( $this->globals as $key => $val ) {
288  if ( isset( self::MERGE_STRATEGIES[$key] ) ) {
289  $this->globals[$key][ExtensionRegistry::MERGE_STRATEGY] = self::MERGE_STRATEGIES[$key];
290  }
291  }
292 
293  // Merge $this->extAttributes into $this->attributes depending on what is loaded
294  foreach ( $this->extAttributes as $extName => $value ) {
295  // Only set the attribute if $extName is loaded (and hence present in credits)
296  if ( isset( $this->credits[$extName] ) ) {
297  foreach ( $value as $attrName => $attrValue ) {
298  $this->storeToArrayRecursive(
299  '', // Don't provide a path since it's impossible to generate an error here
300  $extName . $attrName,
301  $attrValue,
302  $this->attributes
303  );
304  }
305  unset( $this->extAttributes[$extName] );
306  }
307  }
308 
309  return [
310  'globals' => $this->globals,
311  'config' => $this->config,
312  'defines' => $this->defines,
313  'callbacks' => $this->callbacks,
314  'credits' => $this->credits,
315  'attributes' => $this->attributes,
316  ];
317  }
318 
319  public function getRequirements( array $info, $includeDev ) {
320  // Quick shortcuts
321  if ( !$includeDev || !isset( $info['dev-requires'] ) ) {
322  return $info['requires'] ?? [];
323  }
324 
325  if ( !isset( $info['requires'] ) ) {
326  return $info['dev-requires'] ?? [];
327  }
328 
329  // OK, we actually have to merge everything
330  $merged = [];
331 
332  // Helper that combines version requirements by
333  // picking the non-null if one is, or combines
334  // the two. Note that it is not possible for
335  // both inputs to be null.
336  $pick = function ( $a, $b ) {
337  if ( $a === null ) {
338  return $b;
339  } elseif ( $b === null ) {
340  return $a;
341  } else {
342  return "$a $b";
343  }
344  };
345 
346  $req = $info['requires'];
347  $dev = $info['dev-requires'];
348  if ( isset( $req['MediaWiki'] ) || isset( $dev['MediaWiki'] ) ) {
349  $merged['MediaWiki'] = $pick(
350  $req['MediaWiki'] ?? null,
351  $dev['MediaWiki'] ?? null
352  );
353  }
354 
355  $platform = array_merge(
356  array_keys( $req['platform'] ?? [] ),
357  array_keys( $dev['platform'] ?? [] )
358  );
359  if ( $platform ) {
360  foreach ( $platform as $pkey ) {
361  if ( $pkey === 'php' ) {
362  $value = $pick(
363  $req['platform']['php'] ?? null,
364  $dev['platform']['php'] ?? null
365  );
366  } else {
367  // Prefer dev value, but these should be constant
368  // anyways (ext-* and ability-*)
369  $value = $dev['platform'][$pkey] ?? $req['platform'][$pkey];
370  }
371  $merged['platform'][$pkey] = $value;
372  }
373  }
374 
375  foreach ( [ 'extensions', 'skins' ] as $thing ) {
376  $things = array_merge(
377  array_keys( $req[$thing] ?? [] ),
378  array_keys( $dev[$thing] ?? [] )
379  );
380  foreach ( $things as $name ) {
381  $merged[$thing][$name] = $pick(
382  $req[$thing][$name] ?? null,
383  $dev[$thing][$name] ?? null
384  );
385  }
386  }
387  return $merged;
388  }
389 
401  private function setArrayHookHandler(
402  array $callback,
403  array $hookHandlersAttr,
404  string $name,
405  string $path
406  ) {
407  if ( isset( $callback['handler'] ) ) {
408  $handlerName = $callback['handler'];
409  $handlerDefinition = $hookHandlersAttr[$handlerName] ?? false;
410  if ( !$handlerDefinition ) {
411  throw new UnexpectedValueException(
412  "Missing handler definition for $name in HookHandlers attribute in $path"
413  );
414  }
415  $callback['handler'] = $handlerDefinition;
416  $callback['extensionPath'] = $path;
417  $this->attributes['Hooks'][$name][] = $callback;
418  } else {
419  foreach ( $callback as $callable ) {
420  if ( is_array( $callable ) ) {
421  if ( isset( $callable['handler'] ) ) { // Non-legacy style handler
422  $this->setArrayHookHandler( $callable, $hookHandlersAttr, $name, $path );
423  } else { // Legacy style handler array
424  $this->globals['wgHooks'][$name][] = $callable;
425  }
426  } elseif ( is_string( $callable ) ) {
427  $this->setStringHookHandler( $callable, $hookHandlersAttr, $name, $path );
428  }
429  }
430  }
431  }
432 
443  private function setStringHookHandler(
444  string $callback,
445  array $hookHandlersAttr,
446  string $name,
447  string $path
448  ) {
449  if ( isset( $hookHandlersAttr[$callback] ) ) {
450  $handler = [
451  'handler' => $hookHandlersAttr[$callback],
452  'extensionPath' => $path
453  ];
454  $this->attributes['Hooks'][$name][] = $handler;
455  } else { // legacy style handler
456  $this->globals['wgHooks'][$name][] = $callback;
457  }
458  }
459 
468  protected function extractHooks( array $info, string $path ) {
469  $extName = $info['name'];
470  if ( isset( $info['Hooks'] ) ) {
471  $hookHandlersAttr = [];
472  foreach ( $info['HookHandlers'] ?? [] as $name => $def ) {
473  $hookHandlersAttr[$name] = [ 'name' => "$extName-$name" ] + $def;
474  }
475  foreach ( $info['Hooks'] as $name => $callback ) {
476  if ( is_string( $callback ) ) {
477  $this->setStringHookHandler( $callback, $hookHandlersAttr, $name, $path );
478  } elseif ( is_array( $callback ) ) {
479  $this->setArrayHookHandler( $callback, $hookHandlersAttr, $name, $path );
480  }
481  }
482  }
483  if ( isset( $info['DeprecatedHooks'] ) ) {
484  $deprecatedHooks = [];
485  foreach ( $info['DeprecatedHooks'] as $name => $deprecatedHookInfo ) {
486  $deprecatedHookInfo += [ 'component' => $extName ];
487  $deprecatedHooks[$name] = $deprecatedHookInfo;
488  }
489  if ( isset( $this->attributes['DeprecatedHooks'] ) ) {
490  $this->attributes['DeprecatedHooks'] += $deprecatedHooks;
491  } else {
492  $this->attributes['DeprecatedHooks'] = $deprecatedHooks;
493  }
494  }
495  }
496 
502  protected function extractNamespaces( array $info ) {
503  if ( isset( $info['namespaces'] ) ) {
504  foreach ( $info['namespaces'] as $ns ) {
505  if ( defined( $ns['constant'] ) ) {
506  // If the namespace constant is already defined, use it.
507  // This allows namespace IDs to be overwritten locally.
508  $id = constant( $ns['constant'] );
509  } else {
510  $id = $ns['id'];
511  }
512  $this->defines[ $ns['constant'] ] = $id;
513 
514  if ( !( isset( $ns['conditional'] ) && $ns['conditional'] ) ) {
515  // If it is not conditional, register it
516  $this->attributes['ExtensionNamespaces'][$id] = $ns['name'];
517  }
518  if ( isset( $ns['gender'] ) ) {
519  $this->globals['wgExtraGenderNamespaces'][$id] = $ns['gender'];
520  }
521  if ( isset( $ns['subpages'] ) && $ns['subpages'] ) {
522  $this->globals['wgNamespacesWithSubpages'][$id] = true;
523  }
524  if ( isset( $ns['content'] ) && $ns['content'] ) {
525  $this->globals['wgContentNamespaces'][] = $id;
526  }
527  if ( isset( $ns['defaultcontentmodel'] ) ) {
528  $this->globals['wgNamespaceContentModels'][$id] = $ns['defaultcontentmodel'];
529  }
530  if ( isset( $ns['protection'] ) ) {
531  $this->globals['wgNamespaceProtection'][$id] = $ns['protection'];
532  }
533  if ( isset( $ns['capitallinkoverride'] ) ) {
534  $this->globals['wgCapitalLinkOverrides'][$id] = $ns['capitallinkoverride'];
535  }
536  }
537  }
538  }
539 
540  protected function extractResourceLoaderModules( $dir, array $info ) {
541  $defaultPaths = $info['ResourceFileModulePaths'] ?? false;
542  if ( isset( $defaultPaths['localBasePath'] ) ) {
543  if ( $defaultPaths['localBasePath'] === '' ) {
544  // Avoid double slashes (e.g. /extensions/Example//path)
545  $defaultPaths['localBasePath'] = $dir;
546  } else {
547  $defaultPaths['localBasePath'] = "$dir/{$defaultPaths['localBasePath']}";
548  }
549  }
550 
551  foreach ( [ 'ResourceModules', 'ResourceModuleSkinStyles', 'OOUIThemePaths' ] as $setting ) {
552  if ( isset( $info[$setting] ) ) {
553  foreach ( $info[$setting] as $name => $data ) {
554  if ( isset( $data['localBasePath'] ) ) {
555  if ( $data['localBasePath'] === '' ) {
556  // Avoid double slashes (e.g. /extensions/Example//path)
557  $data['localBasePath'] = $dir;
558  } else {
559  $data['localBasePath'] = "$dir/{$data['localBasePath']}";
560  }
561  }
562  if ( $defaultPaths ) {
563  $data += $defaultPaths;
564  }
565  $this->attributes[$setting][$name] = $data;
566  }
567  }
568  }
569 
570  if ( isset( $info['QUnitTestModule'] ) ) {
571  $data = $info['QUnitTestModule'];
572  if ( isset( $data['localBasePath'] ) ) {
573  if ( $data['localBasePath'] === '' ) {
574  // Avoid double slashes (e.g. /extensions/Example//path)
575  $data['localBasePath'] = $dir;
576  } else {
577  $data['localBasePath'] = "$dir/{$data['localBasePath']}";
578  }
579  }
580  $this->attributes['QUnitTestModules']["test.{$info['name']}"] = $data;
581  }
582 
583  if ( isset( $info['MessagePosterModule'] ) ) {
584  $data = $info['MessagePosterModule'];
585  $basePath = $data['localBasePath'] ?? '';
586  $baseDir = $basePath === '' ? $dir : "$dir/$basePath";
587  foreach ( $data['scripts'] ?? [] as $scripts ) {
588  $this->attributes['MessagePosterModule']['scripts'][] = "$baseDir/$scripts";
589  }
590  foreach ( $data['dependencies'] ?? [] as $dependency ) {
591  $this->attributes['MessagePosterModule']['dependencies'][] = $dependency;
592  }
593  }
594  }
595 
596  protected function extractExtensionMessagesFiles( $dir, array $info ) {
597  if ( isset( $info['ExtensionMessagesFiles'] ) ) {
598  foreach ( $info['ExtensionMessagesFiles'] as &$file ) {
599  $file = "$dir/$file";
600  }
601  $this->globals["wgExtensionMessagesFiles"] += $info['ExtensionMessagesFiles'];
602  }
603  }
604 
612  protected function extractMessagesDirs( $dir, array $info ) {
613  if ( isset( $info['MessagesDirs'] ) ) {
614  foreach ( $info['MessagesDirs'] as $name => $files ) {
615  foreach ( (array)$files as $file ) {
616  $this->globals["wgMessagesDirs"][$name][] = "$dir/$file";
617  }
618  }
619  }
620  }
621 
626  protected function extractSkinImportPaths( $dir, array $info ) {
627  if ( isset( $info['SkinLessImportPaths'] ) ) {
628  foreach ( $info['SkinLessImportPaths'] as $skin => $subpath ) {
629  $this->attributes['SkinLessImportPaths'][$skin] = "$dir/$subpath";
630  }
631  }
632  }
633 
640  protected function extractCredits( $path, array $info ) {
641  $credits = [
642  'path' => $path,
643  'type' => 'other',
644  ];
645  foreach ( self::CREDIT_ATTRIBS as $attr ) {
646  if ( isset( $info[$attr] ) ) {
647  $credits[$attr] = $info[$attr];
648  }
649  }
650 
651  $name = $credits['name'];
652 
653  // If someone is loading the same thing twice, throw
654  // a nice error (T121493)
655  if ( isset( $this->credits[$name] ) ) {
656  $firstPath = $this->credits[$name]['path'];
657  $secondPath = $credits['path'];
658  throw new Exception( "It was attempted to load $name twice, from $firstPath and $secondPath." );
659  }
660 
661  $this->credits[$name] = $credits;
662 
663  return $name;
664  }
665 
672  protected function extractConfig1( array $info ) {
673  if ( isset( $info['config'] ) ) {
674  if ( isset( $info['config']['_prefix'] ) ) {
675  $prefix = $info['config']['_prefix'];
676  unset( $info['config']['_prefix'] );
677  } else {
678  $prefix = 'wg';
679  }
680  foreach ( $info['config'] as $key => $val ) {
681  if ( $key[0] !== '@' ) {
682  $this->addConfigGlobal( "$prefix$key", $val, $info['name'] );
683  }
684  }
685  }
686  }
687 
695  protected function extractConfig2( array $info, $dir ) {
696  $prefix = $info['config_prefix'] ?? 'wg';
697  if ( isset( $info['config'] ) ) {
698  foreach ( $info['config'] as $key => $data ) {
699  $value = $data['value'];
700  if ( isset( $data['path'] ) && $data['path'] ) {
701  $callback = function ( $value ) use ( $dir ) {
702  return "$dir/$value";
703  };
704  if ( is_array( $value ) ) {
705  $value = array_map( $callback, $value );
706  } else {
707  $value = $callback( $value );
708  }
709  }
710  if ( isset( $data['merge_strategy'] ) ) {
711  $value[ExtensionRegistry::MERGE_STRATEGY] = $data['merge_strategy'];
712  }
713  $this->addConfigGlobal( "$prefix$key", $value, $info['name'] );
714  $data['providedby'] = $info['name'];
715  if ( isset( $info['ConfigRegistry'][0] ) ) {
716  $data['configregistry'] = array_keys( $info['ConfigRegistry'] )[0];
717  }
718  $this->config[$key] = $data;
719  }
720  }
721  }
722 
730  private function addConfigGlobal( $key, $value, $extName ) {
731  if ( array_key_exists( $key, $this->globals ) ) {
732  throw new RuntimeException(
733  "The configuration setting '$key' was already set by MediaWiki core or"
734  . " another extension, and cannot be set again by $extName." );
735  }
736  $this->globals[$key] = $value;
737  }
738 
739  protected function extractPathBasedGlobal( $global, $dir, $paths ) {
740  foreach ( $paths as $path ) {
741  $this->globals[$global][] = "$dir/$path";
742  }
743  }
744 
754  protected function storeToArrayRecursive( $path, $name, $value, &$array ) {
755  if ( !is_array( $value ) ) {
756  throw new InvalidArgumentException( "The value for '$name' should be an array (from $path)" );
757  }
758  if ( isset( $array[$name] ) ) {
759  $array[$name] = array_merge_recursive( $array[$name], $value );
760  } else {
761  $array[$name] = $value;
762  }
763  }
764 
774  protected function storeToArray( $path, $name, $value, &$array ) {
775  if ( !is_array( $value ) ) {
776  throw new InvalidArgumentException( "The value for '$name' should be an array (from $path)" );
777  }
778  if ( isset( $array[$name] ) ) {
779  $array[$name] = array_merge( $array[$name], $value );
780  } else {
781  $array[$name] = $value;
782  }
783  }
784 
785  public function getExtraAutoloaderPaths( $dir, array $info ) {
786  $paths = [];
787  if ( isset( $info['load_composer_autoloader'] ) && $info['load_composer_autoloader'] === true ) {
788  $paths[] = "$dir/vendor/autoload.php";
789  }
790  return $paths;
791  }
792 }
ExtensionProcessor\$callbacks
callable[] $callbacks
Things to be called once registration of these extensions are done keyed by the name of the extension...
Definition: ExtensionProcessor.php:165
ExtensionProcessor\extractResourceLoaderModules
extractResourceLoaderModules( $dir, array $info)
Definition: ExtensionProcessor.php:540
ExtensionProcessor\extractConfig1
extractConfig1(array $info)
Set configuration settings for manifest_version == 1.
Definition: ExtensionProcessor.php:672
$file
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
Definition: router.php:42
ExtensionProcessor\storeToArray
storeToArray( $path, $name, $value, &$array)
Stores $value to $array; using array_merge() if $array already contains $name.
Definition: ExtensionProcessor.php:774
Processor
Processors read associated arrays and register whatever is required.
Definition: Processor.php:9
ExtensionProcessor\addConfigGlobal
addConfigGlobal( $key, $value, $extName)
Helper function to set a value to a specific global, if it isn't set already.
Definition: ExtensionProcessor.php:730
ExtensionProcessor\extractExtensionMessagesFiles
extractExtensionMessagesFiles( $dir, array $info)
Definition: ExtensionProcessor.php:596
ExtensionRegistry\MERGE_STRATEGY
const MERGE_STRATEGY
Special key that defines the merge strategy.
Definition: ExtensionRegistry.php:54
ExtensionProcessor\extractSkinImportPaths
extractSkinImportPaths( $dir, array $info)
Definition: ExtensionProcessor.php:626
ExtensionProcessor
Definition: ExtensionProcessor.php:3
ExtensionProcessor\extractPathBasedGlobal
extractPathBasedGlobal( $global, $dir, $paths)
Definition: ExtensionProcessor.php:739
ExtensionProcessor\setArrayHookHandler
setArrayHookHandler(array $callback, array $hookHandlersAttr, string $name, string $path)
When handler value is an array, set $wgHooks or Hooks attribute Could be legacy hook e....
Definition: ExtensionProcessor.php:401
ExtensionProcessor\extractConfig2
extractConfig2(array $info, $dir)
Set configuration settings for manifest_version == 2.
Definition: ExtensionProcessor.php:695
ExtensionProcessor\$globals
array $globals
Stuff that is going to be set to $GLOBALS.
Definition: ExtensionProcessor.php:147
ExtensionProcessor\getExtraAutoloaderPaths
getExtraAutoloaderPaths( $dir, array $info)
Get the path for additional autoloaders, e.g.
Definition: ExtensionProcessor.php:785
ExtensionProcessor\$config
array $config
Definition: ExtensionProcessor.php:175
ExtensionProcessor\getRequirements
getRequirements(array $info, $includeDev)
Get the requirements for the provided info.
Definition: ExtensionProcessor.php:319
ExtensionProcessor\$credits
array $credits
Definition: ExtensionProcessor.php:170
ExtensionProcessor\extractNamespaces
extractNamespaces(array $info)
Register namespaces with the appropriate global settings.
Definition: ExtensionProcessor.php:502
ExtensionProcessor\getExtractedInfo
getExtractedInfo()
Definition: ExtensionProcessor.php:285
ExtensionProcessor\$extAttributes
array $extAttributes
Extension attributes, keyed by name => settings.
Definition: ExtensionProcessor.php:191
ExtensionProcessor\$globalSettings
static array $globalSettings
Keys that should be set to $GLOBALS.
Definition: ExtensionProcessor.php:10
ExtensionProcessor\extractAttributes
extractAttributes( $path, array $info)
Definition: ExtensionProcessor.php:277
ExtensionProcessor\extractCredits
extractCredits( $path, array $info)
Definition: ExtensionProcessor.php:640
$path
$path
Definition: NoLocalSettings.php:25
ExtensionProcessor\extractInfo
extractInfo( $path, array $info, $version)
Definition: ExtensionProcessor.php:198
ExtensionProcessor\$defines
array $defines
Things that should be define()'d.
Definition: ExtensionProcessor.php:157
$basePath
$basePath
Definition: addSite.php:5
ExtensionProcessor\$attributes
array $attributes
Any thing else in the $info that hasn't already been processed.
Definition: ExtensionProcessor.php:183
ExtensionProcessor\setStringHookHandler
setStringHookHandler(string $callback, array $hookHandlersAttr, string $name, string $path)
When handler value is a string, set $wgHooks or Hooks attribute.
Definition: ExtensionProcessor.php:443
ExtensionProcessor\extractMessagesDirs
extractMessagesDirs( $dir, array $info)
Set message-related settings, which need to be expanded to use absolute paths.
Definition: ExtensionProcessor.php:612
ExtensionProcessor\extractHooks
extractHooks(array $info, string $path)
Extract hook information from Hooks and HookHandler attributes.
Definition: ExtensionProcessor.php:468
ExtensionProcessor\storeToArrayRecursive
storeToArrayRecursive( $path, $name, $value, &$array)
Stores $value to $array; using array_merge_recursive() if $array already contains $name.
Definition: ExtensionProcessor.php:754