Forgot to remove this part

Also added delete hooks and template_menus from cache when uninstalling plugin
This commit is contained in:
slawkens 2020-02-03 23:30:57 +01:00
parent e5ad1b45bd
commit c821f76f0f

View File

@ -361,24 +361,12 @@ class Plugins {
} }
} }
if (isset($plugin_info['hooks'])) {
foreach ($plugin_info['hooks'] as $_name => $info) {
if (defined('HOOK_'. $info['type'])) {
//$hook = constant('HOOK_'. $info['type']);
$query = $db->query('SELECT `id` FROM `' . TABLE_PREFIX . 'hooks` WHERE `name` = ' . $db->quote($_name) . ';');
if ($query->rowCount() == 1) { // found something
$query = $query->fetch();
$db->delete(TABLE_PREFIX . 'hooks', array('id' => (int)$query['id']));
}
} else
self::$warnings[] = 'Unknown event type: ' . $info['type'];
}
}
if($success) { if($success) {
$cache = Cache::getInstance(); $cache = Cache::getInstance();
if($cache->enabled()) { if($cache->enabled()) {
$cache->delete('templates'); $cache->delete('templates');
$cache->delete('hooks');
$cache->delete('template_menus');
} }
return true; return true;