FilesystemCache.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  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\FilesystemAdapter;
  12. use Symfony\Component\Cache\Marshaller\DefaultMarshaller;
  13. use Symfony\Component\Cache\Marshaller\MarshallerInterface;
  14. use Symfony\Component\Cache\PruneableInterface;
  15. use Symfony\Component\Cache\Traits\FilesystemTrait;
  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.', FilesystemCache::class, FilesystemAdapter::class, CacheInterface::class), \E_USER_DEPRECATED);
  18. /**
  19. * @deprecated since Symfony 4.3, use FilesystemAdapter and type-hint for CacheInterface instead.
  20. */
  21. class FilesystemCache extends AbstractCache implements PruneableInterface
  22. {
  23. use FilesystemTrait;
  24. public function __construct(string $namespace = '', int $defaultLifetime = 0, string $directory = null, MarshallerInterface $marshaller = null)
  25. {
  26. $this->marshaller = $marshaller ?? new DefaultMarshaller();
  27. parent::__construct('', $defaultLifetime);
  28. $this->init($namespace, $directory);
  29. }
  30. }