MediaWiki  1.32.5
config.php
Go to the documentation of this file.
1 <?php
2 
3 // If xdebug is enabled, we need to increase the nesting level for phan
4 ini_set( 'xdebug.max_nesting_level', 1000 );
5 
28 return [
35  'file_list' => array_merge(
36  function_exists( 'register_postsend_function' ) ? [] : [ 'tests/phan/stubs/hhvm.php' ],
37  function_exists( 'wikidiff2_do_diff' ) ? [] : [ 'tests/phan/stubs/wikidiff.php' ],
38  function_exists( 'tideways_enable' ) ? [] : [ 'tests/phan/stubs/tideways.php' ],
39  class_exists( PEAR::class ) ? [] : [ 'tests/phan/stubs/mail.php' ],
40  class_exists( Memcached::class ) ? [] : [ 'tests/phan/stubs/memcached.php' ],
41  // Per composer.json, PHPUnit 6 is used for PHP 7.0+, PHPUnit 4 otherwise.
42  // Load the interface for the version of PHPUnit that isn't installed.
43  // Phan only supports PHP 7.0+ (and not HHVM), so we only need to stub PHPUnit 4.
44  class_exists( PHPUnit_TextUI_Command::class ) ? [] : [ 'tests/phan/stubs/phpunit4.php' ],
45  [
46  'maintenance/7zip.inc',
47  'maintenance/cleanupTable.inc',
48  'maintenance/CodeCleanerGlobalsPass.inc',
49  'maintenance/commandLine.inc',
50  'maintenance/sqlite.inc',
51  'maintenance/userDupes.inc',
52  'maintenance/language/checkLanguage.inc',
53  'maintenance/language/languages.inc',
54  ]
55  ),
56 
66  'directory_list' => [
67  'includes/',
68  'languages/',
69  'maintenance/',
70  'mw-config/',
71  'resources/',
72  'vendor/',
73  ],
74 
82  'exclude_file_list' => [],
83 
89  "exclude_analysis_directory_list" => [
90  'vendor/',
91  'tests/phan/stubs/',
92  // The referenced classes are not available in vendor, only when
93  // included from composer.
94  'includes/composer/',
95  // Directly references classes that only exist in Translate extension
96  'maintenance/language/',
97  // External class
98  'includes/libs/jsminplus.php',
99  ],
100 
108  'backward_compatibility_checks' => false,
109 
114  'parent_constructor_required' => [
115  ],
116 
148  'quick_mode' => false,
149 
159  'should_visit_all_nodes' => true,
160 
167  'analyze_signature_compatibility' => true,
168 
169  // Emit all issues. They are then suppressed via
170  // suppress_issue_types, rather than a minimum
171  // severity.
172  "minimum_severity" => 0,
173 
181  'allow_missing_properties' => false,
182 
188  'null_casts_as_any_type' => true,
189 
197  'scalar_implicit_cast' => true,
198 
205  'ignore_undeclared_variables_in_global_scope' => true,
206 
216  'dead_code_detection' => false,
217 
227  'dead_code_detection_prefer_false_negative' => true,
228 
235  'read_type_annotations' => true,
236 
244  'stored_state_file_path' => null,
245 
251  'disable_suppression' => false,
252 
257  'dump_ast' => false,
258 
263  'dump_signatures_file' => null,
264 
270  'expand_file_list' => false,
271 
272  // Include a progress bar in the output
273  'progress_bar' => false,
274 
282  'progress_bar_sample_rate' => 0.005,
283 
288  'processes' => 1,
289 
294  'suppress_issue_types' => [
295  // approximate error count: 29
296  "PhanCommentParamOnEmptyParamList",
297  // approximate error count: 33
298  "PhanCommentParamWithoutRealParam",
299  // approximate error count: 8
300  "PhanDeprecatedClass",
301  // approximate error count: 415
302  "PhanDeprecatedFunction",
303  // approximate error count: 25
304  "PhanDeprecatedProperty",
305  // approximate error count: 17
306  "PhanNonClassMethodCall",
307  // approximate error count: 888
308  "PhanParamSignatureMismatch",
309  // approximate error count: 7
310  "PhanParamSignatureMismatchInternal",
311  // approximate error count: 1
312  "PhanParamSignatureRealMismatchTooFewParameters",
313  // approximate error count: 125
314  "PhanParamTooMany",
315  // approximate error count: 3
316  "PhanParamTooManyInternal",
317  // approximate error count: 1
318  "PhanRedefineFunctionInternal",
319  // approximate error count: 2
320  "PhanTraitParentReference",
321  // approximate error count: 3
322  "PhanTypeComparisonFromArray",
323  // approximate error count: 2
324  "PhanTypeComparisonToArray",
325  // approximate error count: 218
326  "PhanTypeMismatchArgument",
327  // approximate error count: 13
328  "PhanTypeMismatchArgumentInternal",
329  // approximate error count: 5
330  "PhanTypeMismatchDimAssignment",
331  // approximate error count: 2
332  "PhanTypeMismatchDimEmpty",
333  // approximate error count: 1
334  "PhanTypeMismatchDimFetch",
335  // approximate error count: 14
336  "PhanTypeMismatchForeach",
337  // approximate error count: 56
338  "PhanTypeMismatchProperty",
339  // approximate error count: 74
340  "PhanTypeMismatchReturn",
341  // approximate error count: 5
342  "PhanTypeNonVarPassByRef",
343  // approximate error count: 32
344  "PhanUndeclaredConstant",
345  // approximate error count: 233
346  "PhanUndeclaredMethod",
347  // approximate error count: 1224
348  "PhanUndeclaredProperty",
349  // approximate error count: 58
350  "PhanUndeclaredVariableDim",
351  ],
352 
358  'whitelist_issue_types' => [
359  // 'PhanAccessMethodPrivate',
360  // 'PhanAccessMethodProtected',
361  // 'PhanAccessNonStaticToStatic',
362  // 'PhanAccessPropertyPrivate',
363  // 'PhanAccessPropertyProtected',
364  // 'PhanAccessSignatureMismatch',
365  // 'PhanAccessSignatureMismatchInternal',
366  // 'PhanAccessStaticToNonStatic',
367  // 'PhanCompatibleExpressionPHP7',
368  // 'PhanCompatiblePHP7',
369  // 'PhanContextNotObject',
370  // 'PhanDeprecatedClass',
371  // 'PhanDeprecatedFunction',
372  // 'PhanDeprecatedProperty',
373  // 'PhanEmptyFile',
374  // 'PhanNonClassMethodCall',
375  // 'PhanNoopArray',
376  // 'PhanNoopClosure',
377  // 'PhanNoopConstant',
378  // 'PhanNoopProperty',
379  // 'PhanNoopVariable',
380  // 'PhanParamRedefined',
381  // 'PhanParamReqAfterOpt',
382  // 'PhanParamSignatureMismatch',
383  // 'PhanParamSignatureMismatchInternal',
384  // 'PhanParamSpecial1',
385  // 'PhanParamSpecial2',
386  // 'PhanParamSpecial3',
387  // 'PhanParamSpecial4',
388  // 'PhanParamTooFew',
389  // 'PhanParamTooFewInternal',
390  // 'PhanParamTooMany',
391  // 'PhanParamTooManyInternal',
392  // 'PhanParamTypeMismatch',
393  // 'PhanParentlessClass',
394  // 'PhanRedefineClass',
395  // 'PhanRedefineClassInternal',
396  // 'PhanRedefineFunction',
397  // 'PhanRedefineFunctionInternal',
398  // 'PhanStaticCallToNonStatic',
399  // 'PhanSyntaxError',
400  // 'PhanTraitParentReference',
401  // 'PhanTypeArrayOperator',
402  // 'PhanTypeArraySuspicious',
403  // 'PhanTypeComparisonFromArray',
404  // 'PhanTypeComparisonToArray',
405  // 'PhanTypeConversionFromArray',
406  // 'PhanTypeInstantiateAbstract',
407  // 'PhanTypeInstantiateInterface',
408  // 'PhanTypeInvalidLeftOperand',
409  // 'PhanTypeInvalidRightOperand',
410  // 'PhanTypeMismatchArgument',
411  // 'PhanTypeMismatchArgumentInternal',
412  // 'PhanTypeMismatchDefault',
413  // 'PhanTypeMismatchForeach',
414  // 'PhanTypeMismatchProperty',
415  // 'PhanTypeMismatchReturn',
416  // 'PhanTypeMissingReturn',
417  // 'PhanTypeNonVarPassByRef',
418  // 'PhanTypeParentConstructorCalled',
419  // 'PhanTypeVoidAssignment',
420  // 'PhanUnanalyzable',
421  // 'PhanUndeclaredClass',
422  // 'PhanUndeclaredClassCatch',
423  // 'PhanUndeclaredClassConstant',
424  // 'PhanUndeclaredClassInstanceof',
425  // 'PhanUndeclaredClassMethod',
426  // 'PhanUndeclaredClassReference',
427  // 'PhanUndeclaredConstant',
428  // 'PhanUndeclaredExtendedClass',
429  // 'PhanUndeclaredFunction',
430  // 'PhanUndeclaredInterface',
431  // 'PhanUndeclaredMethod',
432  // 'PhanUndeclaredProperty',
433  // 'PhanUndeclaredStaticMethod',
434  // 'PhanUndeclaredStaticProperty',
435  // 'PhanUndeclaredTrait',
436  // 'PhanUndeclaredTypeParameter',
437  // 'PhanUndeclaredTypeProperty',
438  // 'PhanUndeclaredVariable',
439  // 'PhanUnreferencedClass',
440  // 'PhanUnreferencedConstant',
441  // 'PhanUnreferencedMethod',
442  // 'PhanUnreferencedProperty',
443  // 'PhanVariableUseClause',
444  ],
445 
451  'globals_type_map' => [
452  'IP' => 'string',
453  ],
454 
455  // Emit issue messages with markdown formatting
456  'markdown_issue_messages' => false,
457 
462  'generic_types_enabled' => true,
463 
464  // A list of plugin files to execute
465  'plugins' => [
466  ],
467 ];
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
class
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52