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