Add dispatch data caching in App\Router
- Add new cache key "routerDispatchData" - Update Dice dependencies since Router constructor signature changed
This commit is contained in:
@@ -247,6 +247,8 @@ 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
|
||||
@@ -256,12 +258,18 @@ class Hook
|
||||
{
|
||||
$result = DBA::delete('hook', $condition, $options);
|
||||
|
||||
if ($result) {
|
||||
DI::cache()->delete('routerDispatchData');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 +278,10 @@ class Hook
|
||||
{
|
||||
$result = DBA::insert('hook', $condition);
|
||||
|
||||
if ($result) {
|
||||
DI::cache()->delete('routerDispatchData');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user