diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-12-17 13:39:03 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-12-17 13:39:03 -0500 |
commit | ddeb89e2c6622f197d1b7738042182b34d5054ed (patch) | |
tree | e7c473b9753d8ce309ec73f40c9eef62b2b9cc81 /app/ServiceProvider | |
parent | aafa1de4d56b0791c4d367aa530587082c833faf (diff) |
Add cache decorator for UserModel
Diffstat (limited to 'app/ServiceProvider')
-rw-r--r-- | app/ServiceProvider/CacheProvider.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/ServiceProvider/CacheProvider.php b/app/ServiceProvider/CacheProvider.php index e93dd502..af8a8e7a 100644 --- a/app/ServiceProvider/CacheProvider.php +++ b/app/ServiceProvider/CacheProvider.php @@ -8,6 +8,7 @@ use Kanboard\Decorator\ColumnMoveRestrictionCacheDecorator; use Kanboard\Decorator\ColumnRestrictionCacheDecorator; use Kanboard\Decorator\MetadataCacheDecorator; use Kanboard\Decorator\ProjectRoleRestrictionCacheDecorator; +use Kanboard\Decorator\UserCacheDecorator; use Pimple\Container; use Pimple\ServiceProviderInterface; @@ -40,6 +41,13 @@ class CacheProvider implements ServiceProviderInterface $container['cacheDriver'] = $container['memoryCache']; } + $container['userCacheDecorator'] = function($c) { + return new UserCacheDecorator( + $c['memoryCache'], + $c['userModel'] + ); + }; + $container['userMetadataCacheDecorator'] = function($c) { return new MetadataCacheDecorator( $c['cacheDriver'], |