MediaWiki master
ExtensionDependencyError.php
Go to the documentation of this file.
1<?php
21
22use Exception;
23
30class ExtensionDependencyError extends Exception {
31
35 public $missingExtensions = [];
36
40 public $missingSkins = [];
41
46
50 public $incompatibleSkins = [];
51
55 public $incompatibleCore = false;
56
60 public $incompatiblePhp = false;
61
66
70 public $missingAbilities = [];
71
75 public function __construct( array $errors ) {
76 $msg = '';
77 foreach ( $errors as $info ) {
78 $msg .= $info['msg'] . "\n";
79 switch ( $info['type'] ) {
80 case 'incompatible-core':
81 $this->incompatibleCore = true;
82 break;
83 case 'incompatible-php':
84 $this->incompatiblePhp = true;
85 break;
86 case 'missing-phpExtension':
87 $this->missingPhpExtensions[] = $info['missing'];
88 break;
89 case 'missing-ability':
90 $this->missingAbilities[] = $info['missing'];
91 break;
92 case 'missing-skins':
93 $this->missingSkins[] = $info['missing'];
94 break;
95 case 'missing-extensions':
96 $this->missingExtensions[] = $info['missing'];
97 break;
98 case 'incompatible-skins':
99 $this->incompatibleSkins[] = $info['incompatible'];
100 break;
101 case 'incompatible-extensions':
102 $this->incompatibleExtensions[] = $info['incompatible'];
103 break;
104 // default: continue
105 }
106 }
107
108 parent::__construct( $msg );
109 }
110
111}
112
114class_alias( ExtensionDependencyError::class, 'ExtensionDependencyError' );