3 * Copyright (C) 2018 Kunal Mehta <legoktm@member.fsf.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 class ExtensionDependencyError
extends Exception
{
29 public $missingExtensions = [];
34 public $missingSkins = [];
39 public $incompatibleExtensions = [];
44 public $incompatibleSkins = [];
49 public $incompatibleCore = false;
54 public $incompatiblePhp = false;
59 public $missingPhpExtensions = [];
62 * @param array $errors Each error has a 'msg' and 'type' key at minimum
64 public function __construct( array $errors ) {
66 foreach ( $errors as $info ) {
67 $msg .= $info['msg'] . "\n";
68 switch ( $info['type'] ) {
69 case 'incompatible-core':
70 $this->incompatibleCore
= true;
72 case 'incompatible-php':
73 $this->incompatiblePhp
= true;
75 case 'missing-phpExtension':
76 $this->missingPhpExtensions
[] = $info['missing'];
79 $this->missingSkins
[] = $info['missing'];
81 case 'missing-extensions':
82 $this->missingExtensions
[] = $info['missing'];
84 case 'incompatible-skins':
85 $this->incompatibleSkins
[] = $info['incompatible'];
87 case 'incompatible-extensions':
88 $this->incompatibleExtensions
[] = $info['incompatible'];
94 parent
::__construct( $msg );