mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 17:59:22 +02:00
Add RuntimeException if xml, pdo or zip PHP extension is missing
For a better User Experience ;)
This commit is contained in:
parent
f005b7338f
commit
51b848c43e
@ -131,6 +131,10 @@ if($cache->enabled() && $cache->fetch('vocations', $tmp)) {
|
|||||||
$config['vocations'] = unserialize($tmp);
|
$config['vocations'] = unserialize($tmp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if(!class_exists('DOMDocument')) {
|
||||||
|
throw new RuntimeException('Please install PHP xml extension. MyAAC will not work without it.');
|
||||||
|
}
|
||||||
|
|
||||||
$vocations = new DOMDocument();
|
$vocations = new DOMDocument();
|
||||||
$file = $config['data_path'] . 'XML/vocations.xml';
|
$file = $config['data_path'] . 'XML/vocations.xml';
|
||||||
if(!@file_exists($file))
|
if(!@file_exists($file))
|
||||||
|
@ -93,6 +93,10 @@ class Plugins {
|
|||||||
public static function install($file) {
|
public static function install($file) {
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
|
if(!\class_exists('ZipArchive')) {
|
||||||
|
throw new RuntimeException('Please install PHP zip extension. Plugins upload disabled until then.');
|
||||||
|
}
|
||||||
|
|
||||||
$zip = new ZipArchive();
|
$zip = new ZipArchive();
|
||||||
if($zip->open($file)) {
|
if($zip->open($file)) {
|
||||||
for ($i = 0; $i < $zip->numFiles; $i++) {
|
for ($i = 0; $i < $zip->numFiles; $i++) {
|
||||||
|
@ -366,9 +366,8 @@ class POT
|
|||||||
public function connect($params)
|
public function connect($params)
|
||||||
{
|
{
|
||||||
// checks if PDO extension is loaded
|
// checks if PDO extension is loaded
|
||||||
if( !extension_loaded('PDO') )
|
if( !extension_loaded('PDO') ) {
|
||||||
{
|
throw new RuntimeException('Please install PHP pdo extension. MyAAC will not work without it.');
|
||||||
throw new LogicException();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db = new OTS_DB_MySQL($params);
|
$this->db = new OTS_DB_MySQL($params);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user