Guest User

Untitled

a guest
Feb 25th, 2018
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. * This file is part of the Symfony package.
  5. *
  6. * (c) Fabien Potencier <fabien@symfony.com>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11.  
  12. namespace eZ\DemoBundle\Cache;
  13.  
  14. use Symfony\Component\Cache\Adapter\AbstractAdapter;
  15. use Symfony\Component\Cache\Traits\RedisTrait;
  16.  
  17. class RedisSAAdapter extends AbstractAdapter
  18. {
  19. use RedisTrait;
  20.  
  21. /**
  22. * @param \Redis|\RedisArray|\RedisCluster|\Predis\Client $redisClient The redis client
  23. * @param string $namespace The default namespace
  24. * @param int $defaultLifetime The default lifetime
  25. * @param \eZ\Publish\Core\MVC\Symfony\SiteAccess $siteAccessService
  26. */
  27. public function __construct($redisClient, $namespace = '', $defaultLifetime = 0, $siteAccessService)
  28. {
  29. // maybe ugly but works ;)
  30. if ($siteAccessService != null ) {
  31. $namespace = $siteAccessService->name;
  32. }
  33. $this->init($redisClient, $namespace, $defaultLifetime);
  34. }
  35. }
Add Comment
Please, Sign In to add comment