Add cache decorator for UserModel

This commit is contained in:
Frederic Guillot
2016-12-17 13:39:03 -05:00
parent aafa1de4d5
commit ddeb89e2c6
7 changed files with 73 additions and 5 deletions

View File

@@ -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'],