mirror of
https://github.com/slawkens/myaac.git
synced 2025-06-23 21:30:14 +02:00
feature: plugin require more options with comma
This commit is contained in:
parent
577f9b7373
commit
d0c479d11d
@ -1170,7 +1170,7 @@ function clearCache()
|
|||||||
if (file_exists($routeCacheFile)) {
|
if (file_exists($routeCacheFile)) {
|
||||||
unlink($routeCacheFile);
|
unlink($routeCacheFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -330,27 +330,59 @@ class Plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(in_array($req, array('php-ext', 'php-extension'))) { // require php extension
|
if(in_array($req, array('php-ext', 'php-extension'))) { // require php extension
|
||||||
if(!extension_loaded($version)) {
|
$tmpDisplayError = false;
|
||||||
self::$error = "This plugin requires php extension: " . $version . " to be installed.";
|
$explode = explode(',', $version);
|
||||||
|
|
||||||
|
foreach ($explode as $item) {
|
||||||
|
if(!extension_loaded($item)) {
|
||||||
|
$errors[] = "This plugin requires php extension: " . $item . " to be installed.";
|
||||||
|
$tmpDisplayError = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($tmpDisplayError) {
|
||||||
|
self::$error = implode('<br/>', $errors);
|
||||||
$continue = false;
|
$continue = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($req == 'table') {
|
else if($req == 'table') {
|
||||||
if(!$db->hasTable($version)) {
|
$tmpDisplayError = false;
|
||||||
self::$error = "This plugin requires table: " . $version . " to exist in the database.";
|
$explode = explode(',', $version);
|
||||||
|
foreach ($explode as $item) {
|
||||||
|
if(!$db->hasTable($item)) {
|
||||||
|
$errors[] = "This plugin requires table: " . $item . " to exist in the database.";
|
||||||
|
$tmpDisplayError = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($tmpDisplayError) {
|
||||||
|
self::$error = implode('<br/>', $errors);
|
||||||
$continue = false;
|
$continue = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($req == 'column') {
|
else if($req == 'column') {
|
||||||
$tmp = explode('.', $version);
|
$tmpDisplayError = false;
|
||||||
if(count($tmp) == 2) {
|
$explode = explode(',', $version);
|
||||||
if(!$db->hasColumn($tmp[0], $tmp[1])) {
|
foreach ($explode as $item) {
|
||||||
self::$error = "This plugin requires database column: " . $tmp[0] . "." . $tmp[1] . " to exist in database.";
|
$tmp = explode('.', $item);
|
||||||
$continue = false;
|
|
||||||
break;
|
if(count($tmp) == 2) {
|
||||||
|
if(!$db->hasColumn($tmp[0], $tmp[1])) {
|
||||||
|
$errors[] = "This plugin requires database column: " . $tmp[0] . "." . $tmp[1] . " to exist in database.";
|
||||||
|
$tmpDisplayError = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
self::$warnings[] = "Invalid plugin require column: " . $item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($tmpDisplayError) {
|
||||||
|
self::$error = implode('<br/>', $errors);
|
||||||
|
$continue = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(strpos($req, 'ext-') !== false) {
|
else if(strpos($req, 'ext-') !== false) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user