DriverInterface.php 811 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace Hyperf\Cache\Driver;
  12. use Psr\Container\ContainerInterface;
  13. use Psr\SimpleCache\CacheInterface;
  14. interface DriverInterface extends CacheInterface
  15. {
  16. public function __construct(ContainerInterface $container, array $config);
  17. /**
  18. * Return state of existence and data at the same time.
  19. * @param null|mixed $default
  20. */
  21. public function fetch(string $key, $default = null): array;
  22. /**
  23. * Clean up data of the same prefix.
  24. */
  25. public function clearPrefix(string $prefix): bool;
  26. public function getConnection(): mixed;
  27. }