From 3eb0d4b934d1f6d982e05e235bf2b55829e9950b Mon Sep 17 00:00:00 2001 From: fowr <89118232+perdedora@users.noreply.github.com> Date: Thu, 10 Apr 2025 12:17:55 -0300 Subject: [PATCH] context.php: add filter system to context --- inc/context.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/inc/context.php b/inc/context.php index b594220a..8c7eff9c 100644 --- a/inc/context.php +++ b/inc/context.php @@ -1,8 +1,11 @@ fn(Context $c): UserPostQueries => new UserPostQueries( $c->get(\PDO::class) - ) + ), + FloodQueries::class => fn(Context $c): FloodQueries => new FloodQueries( + $c->get(\PDO::class) + ), + FloodService::class => fn(Context $c): FloodService => new FloodService( + $c->get(FloodQueries::class), + $c->get('config')['filters'], + $c->get('config')['flood_cache'] + ), + FilterService::class => fn(Context $c): FilterService => new FilterService( + $c->get('config')['filters'], + $c->get(FloodService::class), + $c->get(LogDriver::class) + ), + FloodManager::class => fn(Context $c): FloodManager => new FloodManager( + $c->get(FilterService::class), + $c->get(FloodService::class), + $c->get(IpNoteQueries::class), + $c->get(LogDriver::class) + ), ]); }