mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-29 10:49:22 +02:00
Refactor code + use clearCache() instead
This commit is contained in:
parent
1d0c173e7d
commit
d0d0af289d
@ -793,27 +793,21 @@ class Plugins {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($success) {
|
if(!$success) {
|
||||||
|
$revertEnable();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
foreach($plugin_info['uninstall'] as $file) {
|
foreach($plugin_info['uninstall'] as $file) {
|
||||||
if(!deleteDirectory(BASE . $file)) {
|
if(!deleteDirectory(BASE . $file)) {
|
||||||
self::$warnings[] = 'Cannot delete: ' . $file;
|
self::$warnings[] = 'Cannot delete: ' . $file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$cache = Cache::getInstance();
|
clearCache();
|
||||||
if($cache->enabled()) {
|
|
||||||
$cache->delete('templates');
|
|
||||||
$cache->delete('hooks');
|
|
||||||
$cache->delete('template_menus');
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$revertEnable();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function is_installed($plugin_name, $version): bool
|
public static function is_installed($plugin_name, $version): bool
|
||||||
{
|
{
|
||||||
$filename = BASE . 'plugins/' . $plugin_name . '.json';
|
$filename = BASE . 'plugins/' . $plugin_name . '.json';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user