MediaWiki  master
ExtensionDependencyError.php
Go to the documentation of this file.
1 <?php
25 class ExtensionDependencyError extends Exception {
26 
30  public $missingExtensions = [];
31 
35  public $missingSkins = [];
36 
41 
45  public $incompatibleSkins = [];
46 
50  public $incompatibleCore = false;
51 
55  public $incompatiblePhp = false;
56 
60  public $missingPhpExtensions = [];
61 
65  public $missingAbilities = [];
66 
70  public function __construct( array $errors ) {
71  $msg = '';
72  foreach ( $errors as $info ) {
73  $msg .= $info['msg'] . "\n";
74  switch ( $info['type'] ) {
75  case 'incompatible-core':
76  $this->incompatibleCore = true;
77  break;
78  case 'incompatible-php':
79  $this->incompatiblePhp = true;
80  break;
81  case 'missing-phpExtension':
82  $this->missingPhpExtensions[] = $info['missing'];
83  break;
84  case 'missing-ability':
85  $this->missingAbilities[] = $info['missing'];
86  break;
87  case 'missing-skins':
88  $this->missingSkins[] = $info['missing'];
89  break;
90  case 'missing-extensions':
91  $this->missingExtensions[] = $info['missing'];
92  break;
93  case 'incompatible-skins':
94  $this->incompatibleSkins[] = $info['incompatible'];
95  break;
96  case 'incompatible-extensions':
97  $this->incompatibleExtensions[] = $info['incompatible'];
98  break;
99  // default: continue
100  }
101  }
102 
103  parent::__construct( $msg );
104  }
105 
106 }
ExtensionDependencyError\$incompatibleExtensions
string[] $incompatibleExtensions
Definition: ExtensionDependencyError.php:40
ExtensionDependencyError
Copyright (C) 2018 Kunal Mehta legoktm@member.fsf.org
Definition: ExtensionDependencyError.php:25
ExtensionDependencyError\$missingSkins
string[] $missingSkins
Definition: ExtensionDependencyError.php:35
ExtensionDependencyError\$missingAbilities
string[] $missingAbilities
Definition: ExtensionDependencyError.php:65
ExtensionDependencyError\__construct
__construct(array $errors)
Definition: ExtensionDependencyError.php:70
ExtensionDependencyError\$incompatibleCore
bool $incompatibleCore
Definition: ExtensionDependencyError.php:50
ExtensionDependencyError\$incompatiblePhp
bool $incompatiblePhp
Definition: ExtensionDependencyError.php:55
ExtensionDependencyError\$incompatibleSkins
string[] $incompatibleSkins
Definition: ExtensionDependencyError.php:45
ExtensionDependencyError\$missingExtensions
string[] $missingExtensions
Definition: ExtensionDependencyError.php:30
ExtensionDependencyError\$missingPhpExtensions
string[] $missingPhpExtensions
Definition: ExtensionDependencyError.php:60