RedisCache.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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\Simple;
  11. use Symfony\Component\Cache\Adapter\RedisAdapter;
  12. use Symfony\Component\Cache\Marshaller\MarshallerInterface;
  13. use Symfony\Component\Cache\Traits\RedisClusterProxy;
  14. use Symfony\Component\Cache\Traits\RedisProxy;
  15. use Symfony\Component\Cache\Traits\RedisTrait;
  16. use Symfony\Contracts\Cache\CacheInterface;
  17. @trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "%s" and type-hint for "%s" instead.', RedisCache::class, RedisAdapter::class, CacheInterface::class), \E_USER_DEPRECATED);
  18. /**
  19. * @deprecated since Symfony 4.3, use RedisAdapter and type-hint for CacheInterface instead.
  20. */
  21. class RedisCache extends AbstractCache
  22. {
  23. use RedisTrait;
  24. /**
  25. * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface|RedisProxy|RedisClusterProxy $redis
  26. */
  27. public function __construct($redis, string $namespace = '', int $defaultLifetime = 0, MarshallerInterface $marshaller = null)
  28. {
  29. $this->init($redis, $namespace, $defaultLifetime, $marshaller);
  30. }
  31. }