44 $this->checkDev = $this->
hasOption(
'dev' );
45 $extensions = $this->
hasOption(
'extensions' )
46 ? explode(
',', $this->
getOption(
'extensions' ) )
49 ? explode(
',', $this->
getOption(
'skins' ) )
55 $registry = ExtensionRegistry::getInstance();
56 foreach ( $extensions as $extension ) {
57 if ( !$this->checkDev && $registry->isLoaded( $extension ) ) {
62 $this->
loadThing( $dependencies, $extension, [ $extension ], [] );
65 foreach ( $skins as $skin ) {
66 if ( !$this->checkDev && $registry->isLoaded( $skin ) ) {
71 $this->
loadThing( $dependencies, $skin, [], [ $skin ] );
75 $this->
output( json_encode( $dependencies ) .
"\n" );
81 private function loadThing( &$dependencies, $name, $extensions, $skins ) {
82 $extDir = $this->
getConfig()->get(
'ExtensionDirectory' );
83 $styleDir = $this->
getConfig()->get(
'StyleDirectory' );
86 foreach ( $extensions as $extension ) {
87 $path =
"$extDir/$extension/extension.json";
88 if ( file_exists(
$path ) ) {
98 foreach ( $skins as $skin ) {
99 $path =
"$styleDir/$skin/skin.json";
100 if ( file_exists(
$path ) ) {
115 $registry->setCheckDevRequires( $this->checkDev );
117 $registry->readFromQueue(
$queue );
120 if ( $e->incompatibleCore ) {
121 $reason =
'incompatible-core';
122 } elseif ( $e->incompatibleSkins ) {
123 $reason =
'incompatible-skins';
124 } elseif ( $e->incompatibleExtensions ) {
125 $reason =
'incompatible-extensions';
126 } elseif ( $e->missingExtensions || $e->missingSkins ) {
132 array_merge( $extensions, $e->missingExtensions ),
133 array_merge( $skins, $e->missingSkins )
142 $this->
addToDependencies( $dependencies, $extensions, $skins, $name, $reason, $e->getMessage() );
149 $why =
null, $status =
null, $message =
null
151 $mainRegistry = ExtensionRegistry::getInstance();
152 $iter = [
'extensions' => $extensions,
'skins' => $skins ];
153 foreach ( $iter as
$type => $things ) {
154 foreach ( $things as $thing ) {
155 $preStatus = $dependencies[
$type][$thing][
'status'] ??
false;
156 if ( $preStatus !==
'loaded' ) {
161 $tStatus = $mainRegistry->isLoaded( $thing ) ?
'loaded' :
'present';
163 $dependencies[
$type][$thing][
'status'] = $tStatus;
165 if ( $why !==
null ) {
166 $dependencies[
$type][$thing][
'why'][] = $why;
168 $dependencies[
$type][$thing][
'why'] = array_unique(
169 $dependencies[
$type][$thing][
'why'] );
172 if ( $message !==
null ) {
173 $dependencies[
$type][$thing][
'message'] = trim( $message );