RedisAdapter.php 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Cache\Adapter;
  11. use Symfony\Component\Cache\Marshaller\MarshallerInterface;
  12. use Symfony\Component\Cache\Traits\RedisClusterProxy;
  13. use Symfony\Component\Cache\Traits\RedisProxy;
  14. use Symfony\Component\Cache\Traits\RedisTrait;
  15. class RedisAdapter extends AbstractAdapter
  16. {
  17. use RedisTrait;
  18. /**
  19. * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface|RedisProxy|RedisClusterProxy $redis The redis client
  20. * @param string $namespace The default namespace
  21. * @param int $defaultLifetime The default lifetime
  22. */
  23. public function __construct($redis, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null)
  24. {
  25. $this->init($redis, $namespace, $defaultLifetime, $marshaller);
  26. }
  27. }