29 $styleDirectory = $config->get(
'StyleDirectory' );
31 $possibleSkins = scandir( $styleDirectory );
32 $possibleSkins = array_filter( $possibleSkins,
function ( $maybeDir ) use ( $styleDirectory ) {
33 return $maybeDir !==
'.' && $maybeDir !==
'..' && is_dir(
"$styleDirectory/$maybeDir" );
37 $possibleSkins = array_filter( $possibleSkins,
function ( $skinDir ) use ( $styleDirectory ) {
38 return is_file(
"$styleDirectory/$skinDir/skin.json" )
39 || is_file(
"$styleDirectory/$skinDir/$skinDir.php" );
42 return $possibleSkins;
52 $defaultSkin = $config->get(
'DefaultSkin' );
54 $skinFactory = MediaWikiServices::getInstance()->getSkinFactory();
55 $enabledSkins = $skinFactory->getSkinNames();
56 $enabledSkins = array_change_key_case( $enabledSkins, CASE_LOWER );
58 if ( $installedSkins ) {
59 $skinsInstalledText = [];
60 $skinsInstalledSnippet = [];
62 foreach ( $installedSkins as $skinKey ) {
63 $normalizedKey = strtolower( $skinKey );
64 $isEnabled = array_key_exists( $normalizedKey, $enabledSkins );
66 $skinsInstalledText[] = $this->
msg(
'default-skin-not-found-row-enabled' )
67 ->params( $normalizedKey, $skinKey )->plain();
69 $skinsInstalledText[] = $this->
msg(
'default-skin-not-found-row-disabled' )
70 ->params( $normalizedKey, $skinKey )->plain();
75 return $this->
msg(
'default-skin-not-found' )->params(
77 implode(
"\n", $skinsInstalledText ),
78 implode(
"\n", $skinsInstalledSnippet ) )->numParams(
79 count( $skinsInstalledText ),
80 count( $skinsInstalledSnippet )
83 return $this->
msg(
'default-skin-not-found-no-skins' )->params(