aboutsummaryrefslogtreecommitdiffstats
path: root/include/plugin.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/plugin.php')
-rw-r--r--include/plugin.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/plugin.php b/include/plugin.php
index f9cee7ed6..a17f5761d 100644
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -275,13 +275,16 @@ function plugins_sync() {
if(! array_walk($plugins_arr,'array_trim'))
return;
- App::$plugins = $plugins_arr;
-
$installed_arr = [];
if(count($installed)) {
foreach($installed as $i) {
- if(! in_array($i, $plugins_arr)) {
+ if (! file_exists('addon/' . $i . '/' . $i . '.php')) {
+ q("DELETE FROM addon WHERE aname = '%s' ",
+ dbesc($i)
+ );
+ }
+ elseif(! in_array($i, $plugins_arr)) {
unload_plugin($i);
}
else {
@@ -298,6 +301,8 @@ function plugins_sync() {
}
}
+ App::$plugins = $installed_arr;
+
}