mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-14 10:34:53 +00:00
179d402344
PHP classes and test are somewhat copies from the Popups codebase. Some refactoring was applied. More could be done. Not to sure if this should happen more in follow ups though. Could also reduce the complexity of checks on the JS side. Most of these things can only change on page load. The only dynamic part left is the anon user setting managed by the Popups extension. Note, that I needed to add a new PHP config for here although the other still exists and is needed in the Popups extension. This will change, when the user settings code also moves. I guess it's okay for now though. Both settings default to true and are not overridden in the config repos. Also needed to add the Gadget extension as phan dependency. Bug: T362771 Depends-On: Ia028c41f8aaa1c522dfc7c372e1ce51e40933a5e Change-Id: Ie6e8bc706235724494036c7f0d873f5c996c46e6
44 lines
1 KiB
PHP
44 lines
1 KiB
PHP
<?php
|
|
|
|
$cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
|
|
|
|
$cfg['directory_list'] = array_merge(
|
|
$cfg['directory_list'],
|
|
[
|
|
'../../extensions/Gadgets',
|
|
]
|
|
);
|
|
|
|
$cfg['exclude_analysis_directory_list'] = array_merge(
|
|
$cfg['exclude_analysis_directory_list'],
|
|
[
|
|
'../../extensions/Gadgets',
|
|
]
|
|
);
|
|
|
|
/**
|
|
* Quick implementation of a recursive directory list.
|
|
* @param string $dir The directory to list
|
|
* @param ?array &$result Where to put the result
|
|
*/
|
|
function wfCollectPhpFiles( string $dir, ?array &$result = [] ) {
|
|
if ( !is_dir( $dir ) ) {
|
|
return;
|
|
}
|
|
foreach ( scandir( $dir ) as $f ) {
|
|
if ( $f === '.' || $f === '..' ) {
|
|
continue;
|
|
}
|
|
$fullName = $dir . DIRECTORY_SEPARATOR . $f;
|
|
wfCollectPhpFiles( $fullName, $result );
|
|
if ( is_file( $fullName ) && preg_match( '/\.php$/D', $fullName ) ) {
|
|
$result[] = $fullName;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Exclude src/DOM in favour of .phan/stubs/DomImpl.php
|
|
wfCollectPhpFiles( "{$VP}/vendor/wikimedia/parsoid/src/DOM", $cfg['exclude_file_list'] );
|
|
|
|
return $cfg;
|