From b2218574ee56c1611fa2869c5b2630ff4f41803c Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 5 May 2018 16:19:23 -0700 Subject: allow uninstall of plugins which no longer exists via cmdline tool --- include/plugin.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/plugin.php') diff --git a/include/plugin.php b/include/plugin.php index 4545e1e8d..28d27619f 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -53,10 +53,15 @@ function unload_plugin($plugin){ * @return boolean */ function uninstall_plugin($plugin) { + unload_plugin($plugin); - if(! file_exists('addon/' . $plugin . '/' . $plugin . '.php')) + if(! file_exists('addon/' . $plugin . '/' . $plugin . '.php')) { + q("DELETE FROM addon WHERE aname = '%s' ", + dbesc($plugin) + ); return false; + } logger("Addons: uninstalling " . $plugin); //$t = @filemtime('addon/' . $plugin . '/' . $plugin . '.php'); @@ -73,6 +78,7 @@ function uninstall_plugin($plugin) { q("DELETE FROM addon WHERE aname = '%s' ", dbesc($plugin) ); + } /** -- cgit v1.2.3