X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FHook.php;h=81c5d882dc1b6688219e4e057e3d2229491c39f9;hb=06284e60073f374c1bd411e0bba6474a13c14f10;hp=851dd60ed945277a2c86a9c8addd41c313aaf428;hpb=bd1f4ebbde207b0c6b84a11f3170c4f5b9a2ea12;p=friendica.git diff --git a/src/Core/Hook.php b/src/Core/Hook.php index 851dd60ed9..81c5d882dc 100644 --- a/src/Core/Hook.php +++ b/src/Core/Hook.php @@ -1,6 +1,6 @@ $name, 'file' => $hook[0], 'function' => $hook[1]]; - self::delete($condition, ['cascade' => false]); + self::delete($condition); } } @@ -247,14 +247,19 @@ class Hook /** * Deletes one or more hook records * + * We have to clear the cached routerDispatchData because addons can provide routes + * * @param array $condition - * @param array $options * @return bool * @throws \Exception */ - public static function delete(array $condition, array $options = []) + public static function delete(array $condition) { - $result = DBA::delete('hook', $condition, $options); + $result = DBA::delete('hook', $condition); + + if ($result) { + DI::cache()->delete('routerDispatchData'); + } return $result; } @@ -262,6 +267,8 @@ class Hook /** * Inserts a hook record * + * We have to clear the cached routerDispatchData because addons can provide routes + * * @param array $condition * @return bool * @throws \Exception @@ -270,6 +277,10 @@ class Hook { $result = DBA::insert('hook', $condition); + if ($result) { + DI::cache()->delete('routerDispatchData'); + } + return $result; } }