mirror of
https://github.com/friendica/friendica
synced 2025-04-27 12:30:11 +00:00
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:
parent
bd1f4ebbde
commit
1d0cd7328b
3 changed files with 85 additions and 12 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue