Difference between revisions of "Phan/local-config.php"

From Freephile Wiki
Jump to navigation Jump to search
(Created page with "The distributed <code>.phan/config.php</code> file contains an include at the bottom for this file. So, if you create this file in your MediaWiki $IP (Install Path) at <code>....")
 
Line 3: Line 3:
 
This example purposely ignores all 'core' MediaWiki for analysis, and adds a long list of extensions for analysis.
 
This example purposely ignores all 'core' MediaWiki for analysis, and adds a long list of extensions for analysis.
  
{{collapsible|
+
{{collapsible
 
|visible_text=This is a sample 'local' configuration for Phan
 
|visible_text=This is a sample 'local' configuration for Phan
 
|collapsed_content=
 
|collapsed_content=
<syntaxhighlight lang="php">
+
<syntaxhighlight lang="php" line="1">
<?php
 
 
// DO analyze every extension
 
// DO analyze every extension
 
$cfg['directory_list'] = array_merge(
 
$cfg['directory_list'] = array_merge(

Revision as of 23:28, 18 February 2024

The distributed .phan/config.php file contains an include at the bottom for this file. So, if you create this file in your MediaWiki $IP (Install Path) at .phan/local-config.php, then it will automatically be interpreted by phan when you run it on your MediaWiki codebase.

This example purposely ignores all 'core' MediaWiki for analysis, and adds a long list of extensions for analysis.


This is a sample 'local' configuration for Phan

<syntaxhighlight lang="php" line="1">

// DO analyze every extension $cfg['directory_list'] = array_merge( $cfg['directory_list'], [ 'extensions/AbuseFilter', 'extensions/Arrays', 'extensions/CategoryTree',

  1. 'extensions/CiteThisPage',
  2. 'extensions/CollapsibleVector',
  3. 'extensions/ConfirmEdit',
  4. 'extensions/ContributionScores',
  5. 'extensions/CreateUserPage',
  6. 'extensions/CSS',
  7. 'extensions/DataTransfer',
  8. 'extensions/DeleteBatch',
  9. 'extensions/DisplayTitle',
  10. 'extensions/FlexDiagrams',
  11. 'extensions/Gadgets',
  12. 'extensions/HeaderFooter',
  13. 'extensions/HeaderTabs',
  14. 'extensions/Html5mediator',
  15. 'extensions/Maps',
  16. 'extensions/Math',
  17. 'extensions/MediaFunctions',
  18. 'extensions/Mermaid',
  19. 'extensions/ModernTimeline',
  20. 'extensions/Network',
  21. 'extensions/Nuke',
  22. 'extensions/NumerAlpha',
  23. 'extensions/OATHAuth',
  24. 'extensions/OpenLayers',
  25. 'extensions/PdfHandler',
  26. 'extensions/PipeEscape',
  27. 'extensions/Poem',
  28. 'extensions/Renameuser',
  29. 'extensions/SecureLinkFixer',
  30. 'extensions/SemanticCompoundQueries',
  31. 'extensions/SemanticDependencyUpdater',
  32. 'extensions/SemanticDrilldown',
  33. 'extensions/SemanticExtraSpecialProperties',
  34. 'extensions/SemanticMediaWiki',
  35. 'extensions/SemanticResultFormats',
  36. 'extensions/SemanticScribunto',
  37. 'extensions/SimpleBatchUpload',
  38. 'extensions/SimpleMathJax',
  39. 'extensions/SpamBlacklist',
  40. 'extensions/SubpageFun',
  41. 'extensions/SubPageList',
  42. 'extensions/TalkRight',
  43. 'extensions/TitleBlacklist',
  44. 'extensions/Validator',
  45. 'extensions/VEForAll',
  46. 'extensions/WatchAnalytics',
  47. 'extensions/WhitelistPages',
  48. 'extensions/WhoIsWatching',
  49. 'extensions/WhosOnline',
  50. 'extensions/Widgets',
  51. 'extensions/Wiretap',
  52. 'extensions/YouTube',
    1. 'extensions/',

] );

// Do NOT analyze all the regular 'core' directories $cfg['exclude_analysis_directory_list'] = array_merge( $cfg['exclude_analysis_directory_list'], [ 'includes/', 'languages/', 'maintenance/', 'mw-config/', 'resources/', 'vendor/', 'tests/common/', 'tests/parser/', 'tests/phpunit/mocks/', ] );

    1. To get a picture of the full configuration, just print it and exit.
  1. print_r( $cfg ); exit();