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 
178  protected $attributes = [];
179 
186  protected $extAttributes = [];
187 
193  public function extractInfo( $path, array $info, $version ) {
194  $dir = dirname( $path );
195  $this->extractHooks( $info, $path );
196  $this->extractExtensionMessagesFiles( $dir, $info );
197  $this->extractMessagesDirs( $dir, $info );
198  $this->extractSkinImportPaths( $dir, $info );
199  $this->extractNamespaces( $info );
200  $this->extractResourceLoaderModules( $dir, $info );
201  if ( isset( $info['ServiceWiringFiles'] ) ) {
202  $this->extractPathBasedGlobal(
203  'wgServiceWiringFiles',
204  $dir,
205  $info['ServiceWiringFiles']
206  );
207  }
208  if ( isset( $info['ParserTestFiles'] ) ) {
209  $this->extractPathBasedGlobal(
210  'wgParserTestFiles',
211  $dir,
212  $info['ParserTestFiles']
213  );
214  }
215  $name = $this->extractCredits( $path, $info );
216  if ( isset( $info['callback'] ) ) {
217  $this->callbacks[$name] = $info['callback'];
218  }
219 
220  // config should be after all core globals are extracted,
221  // so duplicate setting detection will work fully
222  if ( $version === 2 ) {
223  $this->extractConfig2( $info, $dir );
224  } else {
225  // $version === 1
226  $this->extractConfig1( $info );
227  }
228 
229  // Record the extension name in the ParsoidModules property
230  if ( isset( $info['ParsoidModules'] ) ) {
231  foreach ( $info['ParsoidModules'] as &$module ) {
232  $module['name'] = $name;
233  }
234  }
235 
236  if ( $version === 2 ) {
237  $this->extractAttributes( $path, $info );
238  }
239 
240  foreach ( $info as $key => $val ) {
241  // If it's a global setting,
242  if ( in_array( $key, self::$globalSettings ) ) {
243  $this->storeToArrayRecursive( $path, "wg$key", $val, $this->globals );
244  continue;
245  }
246  // Ignore anything that starts with a @
247  if ( $key[0] === '@' ) {
248  continue;
249  }
250 
251  if ( $version === 2 ) {
252  // Only allowed attributes are set
253  if ( in_array( $key, self::CORE_ATTRIBS ) ) {
254  $this->storeToArray( $path, $key, $val, $this->attributes );
255  }
256  } else {
257  // version === 1
258  if ( !in_array( $key, self::NOT_ATTRIBS )
259  && !in_array( $key, self::CREDIT_ATTRIBS )
260  ) {
261  // If it's not disallowed, it's an attribute
262  $this->storeToArrayRecursive( $path, $key, $val, $this->attributes );
263  }
264  }
265  }
266  }
267 
272  protected function extractAttributes( $path, array $info ) {
273  if ( isset( $info['attributes'] ) ) {
274  foreach ( $info['attributes'] as $extName => $value ) {
275  $this->storeToArrayRecursive( $path, $extName, $value, $this->extAttributes );
276  }
277  }
278  }
279 
280  public function getExtractedInfo() {
281  // Make sure the merge strategies are set
282  foreach ( $this->globals as $key => $val ) {
283  if ( isset( self::MERGE_STRATEGIES[$key] ) ) {
284  $this->globals[$key][ExtensionRegistry::MERGE_STRATEGY] = self::MERGE_STRATEGIES[$key];
285  }
286  }
287 
288  // Merge $this->extAttributes into $this->attributes depending on what is loaded
289  foreach ( $this->extAttributes as $extName => $value ) {
290  // Only set the attribute if $extName is loaded (and hence present in credits)
291  if ( isset( $this->credits[$extName] ) ) {
292  foreach ( $value as $attrName => $attrValue ) {
293  $this->storeToArrayRecursive(
294  '', // Don't provide a path since it's impossible to generate an error here
295  $extName . $attrName,
296  $attrValue,
297  $this->attributes
298  );
299  }
300  unset( $this->extAttributes[$extName] );
301  }
302  }
303 
304  return [
305  'globals' => $this->globals,
306  'defines' => $this->defines,
307  'callbacks' => $this->callbacks,
308  'credits' => $this->credits,
309  'attributes' => $this->attributes,
310  ];
311  }
312 
313  public function getRequirements( array $info, $includeDev ) {
314  // Quick shortcuts
315  if ( !$includeDev || !isset( $info['dev-requires'] ) ) {
316  return $info['requires'] ?? [];
317  }
318 
319  if ( !isset( $info['requires'] ) ) {
320  return $info['dev-requires'] ?? [];
321  }
322 
323  // OK, we actually have to merge everything
324  $merged = [];
325 
326  // Helper that combines version requirements by
327  // picking the non-null if one is, or combines
328  // the two. Note that it is not possible for
329  // both inputs to be null.
330  $pick = static function ( $a, $b ) {
331  if ( $a === null ) {
332  return $b;
333  } elseif ( $b === null ) {
334  return $a;
335  } else {
336  return "$a $b";
337  }
338  };
339 
340  $req = $info['requires'];
341  $dev = $info['dev-requires'];
342  if ( isset( $req['MediaWiki'] ) || isset( $dev['MediaWiki'] ) ) {
343  $merged['MediaWiki'] = $pick(
344  $req['MediaWiki'] ?? null,
345  $dev['MediaWiki'] ?? null
346  );
347  }
348 
349  $platform = array_merge(
350  array_keys( $req['platform'] ?? [] ),
351  array_keys( $dev['platform'] ?? [] )
352  );
353  if ( $platform ) {
354  foreach ( $platform as $pkey ) {
355  if ( $pkey === 'php' ) {
356  $value = $pick(
357  $req['platform']['php'] ?? null,
358  $dev['platform']['php'] ?? null
359  );
360  } else {
361  // Prefer dev value, but these should be constant
362  // anyways (ext-* and ability-*)
363  $value = $dev['platform'][$pkey] ?? $req['platform'][$pkey];
364  }
365  $merged['platform'][$pkey] = $value;
366  }
367  }
368 
369  foreach ( [ 'extensions', 'skins' ] as $thing ) {
370  $things = array_merge(
371  array_keys( $req[$thing] ?? [] ),
372  array_keys( $dev[$thing] ?? [] )
373  );
374  foreach ( $things as $name ) {
375  $merged[$thing][$name] = $pick(
376  $req[$thing][$name] ?? null,
377  $dev[$thing][$name] ?? null
378  );
379  }
380  }
381  return $merged;
382  }
383 
395  private function setArrayHookHandler(
396  array $callback,
397  array $hookHandlersAttr,
398  string $name,
399  string $path
400  ) {
401  if ( isset( $callback['handler'] ) ) {
402  $handlerName = $callback['handler'];
403  $handlerDefinition = $hookHandlersAttr[$handlerName] ?? false;
404  if ( !$handlerDefinition ) {
405  throw new UnexpectedValueException(
406  "Missing handler definition for $name in HookHandlers attribute in $path"
407  );
408  }
409  $callback['handler'] = $handlerDefinition;
410  $callback['extensionPath'] = $path;
411  $this->attributes['Hooks'][$name][] = $callback;
412  } else {
413  foreach ( $callback as $callable ) {
414  if ( is_array( $callable ) ) {
415  if ( isset( $callable['handler'] ) ) { // Non-legacy style handler
416  $this->setArrayHookHandler( $callable, $hookHandlersAttr, $name, $path );
417  } else { // Legacy style handler array
418  $this->globals['wgHooks'][$name][] = $callable;
419  }
420  } elseif ( is_string( $callable ) ) {
421  $this->setStringHookHandler( $callable, $hookHandlersAttr, $name, $path );
422  }
423  }
424  }
425  }
426 
437  private function setStringHookHandler(
438  string $callback,
439  array $hookHandlersAttr,
440  string $name,
441  string $path
442  ) {
443  if ( isset( $hookHandlersAttr[$callback] ) ) {
444  $handler = [
445  'handler' => $hookHandlersAttr[$callback],
446  'extensionPath' => $path
447  ];
448  $this->attributes['Hooks'][$name][] = $handler;
449  } else { // legacy style handler
450  $this->globals['wgHooks'][$name][] = $callback;
451  }
452  }
453 
462  protected function extractHooks( array $info, string $path ) {
463  $extName = $info['name'];
464  if ( isset( $info['Hooks'] ) ) {
465  $hookHandlersAttr = [];
466  foreach ( $info['HookHandlers'] ?? [] as $name => $def ) {
467  $hookHandlersAttr[$name] = [ 'name' => "$extName-$name" ] + $def;
468  }
469  foreach ( $info['Hooks'] as $name => $callback ) {
470  if ( is_string( $callback ) ) {
471  $this->setStringHookHandler( $callback, $hookHandlersAttr, $name, $path );
472  } elseif ( is_array( $callback ) ) {
473  $this->setArrayHookHandler( $callback, $hookHandlersAttr, $name, $path );
474  }
475  }
476  }
477  if ( isset( $info['DeprecatedHooks'] ) ) {
478  $deprecatedHooks = [];
479  foreach ( $info['DeprecatedHooks'] as $name => $deprecatedHookInfo ) {
480  $deprecatedHookInfo += [ 'component' => $extName ];
481  $deprecatedHooks[$name] = $deprecatedHookInfo;
482  }
483  if ( isset( $this->attributes['DeprecatedHooks'] ) ) {
484  $this->attributes['DeprecatedHooks'] += $deprecatedHooks;
485  } else {
486  $this->attributes['DeprecatedHooks'] = $deprecatedHooks;
487  }
488  }
489  }
490 
496  protected function extractNamespaces( array $info ) {
497  if ( isset( $info['namespaces'] ) ) {
498  foreach ( $info['namespaces'] as $ns ) {
499  if ( defined( $ns['constant'] ) ) {
500  // If the namespace constant is already defined, use it.
501  // This allows namespace IDs to be overwritten locally.
502  $id = constant( $ns['constant'] );
503  } else {
504  $id = $ns['id'];
505  }
506  $this->defines[ $ns['constant'] ] = $id;
507 
508  if ( !( isset( $ns['conditional'] ) && $ns['conditional'] ) ) {
509  // If it is not conditional, register it
510  $this->attributes['ExtensionNamespaces'][$id] = $ns['name'];
511  }
512  if ( isset( $ns['movable'] ) && !$ns['movable'] ) {
513  $this->attributes['ImmovableNamespaces'][] = $id;
514  }
515  if ( isset( $ns['gender'] ) ) {
516  $this->globals['wgExtraGenderNamespaces'][$id] = $ns['gender'];
517  }
518  if ( isset( $ns['subpages'] ) && $ns['subpages'] ) {
519  $this->globals['wgNamespacesWithSubpages'][$id] = true;
520  }
521  if ( isset( $ns['content'] ) && $ns['content'] ) {
522  $this->globals['wgContentNamespaces'][] = $id;
523  }
524  if ( isset( $ns['defaultcontentmodel'] ) ) {
525  $this->globals['wgNamespaceContentModels'][$id] = $ns['defaultcontentmodel'];
526  }
527  if ( isset( $ns['protection'] ) ) {
528  $this->globals['wgNamespaceProtection'][$id] = $ns['protection'];
529  }
530  if ( isset( $ns['capitallinkoverride'] ) ) {
531  $this->globals['wgCapitalLinkOverrides'][$id] = $ns['capitallinkoverride'];
532  }
533 
534  }
535  }
536  }
537 
538  protected function extractResourceLoaderModules( $dir, array $info ) {
539  $defaultPaths = $info['ResourceFileModulePaths'] ?? false;
540  if ( isset( $defaultPaths['localBasePath'] ) ) {
541  if ( $defaultPaths['localBasePath'] === '' ) {
542  // Avoid double slashes (e.g. /extensions/Example//path)
543  $defaultPaths['localBasePath'] = $dir;
544  } else {
545  $defaultPaths['localBasePath'] = "$dir/{$defaultPaths['localBasePath']}";
546  }
547  }
548 
549  foreach ( [ 'ResourceModules', 'ResourceModuleSkinStyles', 'OOUIThemePaths' ] as $setting ) {
550  if ( isset( $info[$setting] ) ) {
551  foreach ( $info[$setting] as $name => $data ) {
552  if ( isset( $data['localBasePath'] ) ) {
553  if ( $data['localBasePath'] === '' ) {
554  // Avoid double slashes (e.g. /extensions/Example//path)
555  $data['localBasePath'] = $dir;
556  } else {
557  $data['localBasePath'] = "$dir/{$data['localBasePath']}";
558  }
559  }
560  if ( $defaultPaths ) {
561  $data += $defaultPaths;
562  }
563  $this->attributes[$setting][$name] = $data;
564  }
565  }
566  }
567 
568  if ( isset( $info['QUnitTestModule'] ) ) {
569  $data = $info['QUnitTestModule'];
570  if ( isset( $data['localBasePath'] ) ) {
571  if ( $data['localBasePath'] === '' ) {
572  // Avoid double slashes (e.g. /extensions/Example//path)
573  $data['localBasePath'] = $dir;
574  } else {
575  $data['localBasePath'] = "$dir/{$data['localBasePath']}";
576  }
577  }
578  $this->attributes['QUnitTestModules']["test.{$info['name']}"] = $data;
579  }
580 
581  if ( isset( $info['MessagePosterModule'] ) ) {
582  $data = $info['MessagePosterModule'];
583  $basePath = $data['localBasePath'] ?? '';
584  $baseDir = $basePath === '' ? $dir : "$dir/$basePath";
585  foreach ( $data['scripts'] ?? [] as $scripts ) {
586  $this->attributes['MessagePosterModule']['scripts'][] =
587  new ResourceLoaderFilePath( $scripts, $baseDir );
588  }
589  foreach ( $data['dependencies'] ?? [] as $dependency ) {
590  $this->attributes['MessagePosterModule']['dependencies'][] = $dependency;
591  }
592  }
593  }
594 
595  protected function extractExtensionMessagesFiles( $dir, array $info ) {
596  if ( isset( $info['ExtensionMessagesFiles'] ) ) {
597  foreach ( $info['ExtensionMessagesFiles'] as &$file ) {
598  $file = "$dir/$file";
599  }
600  $this->globals["wgExtensionMessagesFiles"] += $info['ExtensionMessagesFiles'];
601  }
602  }
603 
611  protected function extractMessagesDirs( $dir, array $info ) {
612  if ( isset( $info['MessagesDirs'] ) ) {
613  foreach ( $info['MessagesDirs'] as $name => $files ) {
614  foreach ( (array)$files as $file ) {
615  $this->globals["wgMessagesDirs"][$name][] = "$dir/$file";
616  }
617  }
618  }
619  }
620 
625  protected function extractSkinImportPaths( $dir, array $info ) {
626  if ( isset( $info['SkinLessImportPaths'] ) ) {
627  foreach ( $info['SkinLessImportPaths'] as $skin => $subpath ) {
628  $this->attributes['SkinLessImportPaths'][$skin] = "$dir/$subpath";
629  }
630  }
631  }
632 
639  protected function extractCredits( $path, array $info ) {
640  $credits = [
641  'path' => $path,
642  'type' => 'other',
643  ];
644  foreach ( self::CREDIT_ATTRIBS as $attr ) {
645  if ( isset( $info[$attr] ) ) {
646  $credits[$attr] = $info[$attr];
647  }
648  }
649 
650  $name = $credits['name'];
651 
652  // If someone is loading the same thing twice, throw
653  // a nice error (T121493)
654  if ( isset( $this->credits[$name] ) ) {
655  $firstPath = $this->credits[$name]['path'];
656  $secondPath = $credits['path'];
657  throw new Exception( "It was attempted to load $name twice, from $firstPath and $secondPath." );
658  }
659 
660  $this->credits[$name] = $credits;
661 
662  return $name;
663  }
664 
671  protected function extractConfig1( array $info ) {
672  if ( isset( $info['config'] ) ) {
673  if ( isset( $info['config']['_prefix'] ) ) {
674  $prefix = $info['config']['_prefix'];
675  unset( $info['config']['_prefix'] );
676  } else {
677  $prefix = 'wg';
678  }
679  foreach ( $info['config'] as $key => $val ) {
680  if ( $key[0] !== '@' ) {
681  $this->addConfigGlobal( "$prefix$key", $val, $info['name'] );
682  }
683  }
684  }
685  }
686 
694  protected function extractConfig2( array $info, $dir ) {
695  $prefix = $info['config_prefix'] ?? 'wg';
696  if ( isset( $info['config'] ) ) {
697  foreach ( $info['config'] as $key => $data ) {
698  if ( !array_key_exists( 'value', $data ) ) {
699  throw new UnexpectedValueException( "Missing value for config $key" );
700  }
701 
702  $value = $data['value'];
703  if ( isset( $data['path'] ) && $data['path'] ) {
704  $callback = static function ( $value ) use ( $dir ) {
705  return "$dir/$value";
706  };
707  if ( is_array( $value ) ) {
708  $value = array_map( $callback, $value );
709  } else {
710  $value = $callback( $value );
711  }
712  }
713  if ( isset( $data['merge_strategy'] ) ) {
714  $value[ExtensionRegistry::MERGE_STRATEGY] = $data['merge_strategy'];
715  }
716  $this->addConfigGlobal( "$prefix$key", $value, $info['name'] );
717  $data['providedby'] = $info['name'];
718  if ( isset( $info['ConfigRegistry'][0] ) ) {
719  $data['configregistry'] = array_keys( $info['ConfigRegistry'] )[0];
720  }
721  }
722  }
723  }
724 
732  private function addConfigGlobal( $key, $value, $extName ) {
733  if ( array_key_exists( $key, $this->globals ) ) {
734  throw new RuntimeException(
735  "The configuration setting '$key' was already set by MediaWiki core or"
736  . " another extension, and cannot be set again by $extName." );
737  }
738  $this->globals[$key] = $value;
739  }
740 
741  protected function extractPathBasedGlobal( $global, $dir, $paths ) {
742  foreach ( $paths as $path ) {
743  $this->globals[$global][] = "$dir/$path";
744  }
745  }
746 
756  protected function storeToArrayRecursive( $path, $name, $value, &$array ) {
757  if ( !is_array( $value ) ) {
758  throw new InvalidArgumentException( "The value for '$name' should be an array (from $path)" );
759  }
760  if ( isset( $array[$name] ) ) {
761  $array[$name] = array_merge_recursive( $array[$name], $value );
762  } else {
763  $array[$name] = $value;
764  }
765  }
766 
776  protected function storeToArray( $path, $name, $value, &$array ) {
777  if ( !is_array( $value ) ) {
778  throw new InvalidArgumentException( "The value for '$name' should be an array (from $path)" );
779  }
780  if ( isset( $array[$name] ) ) {
781  $array[$name] = array_merge( $array[$name], $value );
782  } else {
783  $array[$name] = $value;
784  }
785  }
786 
787  public function getExtraAutoloaderPaths( $dir, array $info ) {
788  $paths = [];
789  if ( isset( $info['load_composer_autoloader'] ) && $info['load_composer_autoloader'] === true ) {
790  $paths[] = "$dir/vendor/autoload.php";
791  }
792  return $paths;
793  }
794 }
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:538
ResourceLoaderFilePath
An object to represent a path to a JavaScript/CSS file, along with a remote and local base path,...
Definition: ResourceLoaderFilePath.php:28
ExtensionProcessor\extractConfig1
extractConfig1(array $info)
Set configuration settings for manifest_version == 1.
Definition: ExtensionProcessor.php:671
$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:776
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:732
ExtensionProcessor\extractExtensionMessagesFiles
extractExtensionMessagesFiles( $dir, array $info)
Definition: ExtensionProcessor.php:595
ExtensionRegistry\MERGE_STRATEGY
const MERGE_STRATEGY
Special key that defines the merge strategy.
Definition: ExtensionRegistry.php:53
ExtensionProcessor\extractSkinImportPaths
extractSkinImportPaths( $dir, array $info)
Definition: ExtensionProcessor.php:625
ExtensionProcessor
Definition: ExtensionProcessor.php:3
ExtensionProcessor\extractPathBasedGlobal
extractPathBasedGlobal( $global, $dir, $paths)
Definition: ExtensionProcessor.php:741
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:395
ExtensionProcessor\extractConfig2
extractConfig2(array $info, $dir)
Set configuration settings for manifest_version == 2.
Definition: ExtensionProcessor.php:694
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:787
ExtensionProcessor\getRequirements
getRequirements(array $info, $includeDev)
Get the requirements for the provided info.
Definition: ExtensionProcessor.php:313
ExtensionProcessor\$credits
array $credits
Definition: ExtensionProcessor.php:170
ExtensionProcessor\extractNamespaces
extractNamespaces(array $info)
Register namespaces with the appropriate global settings.
Definition: ExtensionProcessor.php:496
ExtensionProcessor\getExtractedInfo
getExtractedInfo()
Definition: ExtensionProcessor.php:280
ExtensionProcessor\$extAttributes
array $extAttributes
Extension attributes, keyed by name => settings.
Definition: ExtensionProcessor.php:186
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:272
ExtensionProcessor\extractCredits
extractCredits( $path, array $info)
Definition: ExtensionProcessor.php:639
$path
$path
Definition: NoLocalSettings.php:25
ExtensionProcessor\extractInfo
extractInfo( $path, array $info, $version)
Definition: ExtensionProcessor.php:193
ExtensionProcessor\$defines
array $defines
Things that should be define()'d.
Definition: ExtensionProcessor.php:157
ExtensionProcessor\$attributes
array $attributes
Any thing else in the $info that hasn't already been processed.
Definition: ExtensionProcessor.php:178
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:437
ExtensionProcessor\extractMessagesDirs
extractMessagesDirs( $dir, array $info)
Set message-related settings, which need to be expanded to use absolute paths.
Definition: ExtensionProcessor.php:611
ExtensionProcessor\extractHooks
extractHooks(array $info, string $path)
Extract hook information from Hooks and HookHandler attributes.
Definition: ExtensionProcessor.php:462
ExtensionProcessor\storeToArrayRecursive
storeToArrayRecursive( $path, $name, $value, &$array)
Stores $value to $array; using array_merge_recursive() if $array already contains $name.
Definition: ExtensionProcessor.php:756