mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-13 17:24:54 +02:00
Refactor code - early exit
This commit is contained in:
@@ -532,8 +532,9 @@ class Plugins {
|
||||
self::$plugin_json = $plugin_json;
|
||||
if ($plugin_json == null) {
|
||||
self::$warnings[] = 'Cannot load ' . $file_name . '. File might be not a valid json code.';
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
||||
$continue = true;
|
||||
|
||||
if(!isset($plugin_json['name']) || empty(trim($plugin_json['name']))) {
|
||||
@@ -689,7 +690,10 @@ class Plugins {
|
||||
}
|
||||
}
|
||||
|
||||
if($continue) {
|
||||
if(!$continue) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!$zip->extractTo(BASE)) { // "Real" Install
|
||||
self::$error = 'There was a problem with extracting zip archive to base directory.';
|
||||
$zip->close();
|
||||
@@ -713,13 +717,8 @@ class Plugins {
|
||||
}
|
||||
|
||||
clearCache();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function isEnabled($pluginFileName): bool
|
||||
{
|
||||
|
Reference in New Issue
Block a user