diff options
author | Mario <mario@mariovavti.com> | 2022-04-22 07:42:31 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-04-22 07:42:31 +0000 |
commit | 4c7c5137c5289fa07695eff21c521343bedd954f (patch) | |
tree | aceb94df94dc62be441f79124f7a82986d43435f /include/plugin.php | |
parent | b2fa63f2c8f07f0677e12c655bb39a2c1d6e5444 (diff) | |
download | volse-hubzilla-4c7c5137c5289fa07695eff21c521343bedd954f.tar.gz volse-hubzilla-4c7c5137c5289fa07695eff21c521343bedd954f.tar.bz2 volse-hubzilla-4c7c5137c5289fa07695eff21c521343bedd954f.zip |
check if addons have been removed from the filesystem and also remove them from the db if that is the case
Diffstat (limited to 'include/plugin.php')
-rw-r--r-- | include/plugin.php | 11 |
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; + } |