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