-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cache.php
41 lines (35 loc) · 1.05 KB
/
Cache.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/*
* This file is part of the Koded package.
*
* (c) Mihail Binev <[email protected]>
*
* Please view the LICENSE distributed with this source code
* for the full copyright and license information.
*/
namespace Koded\Caching;
use Psr\SimpleCache\CacheInterface;
interface Cache extends CacheInterface
{
public const DATE_FAR_FAR_AWAY = 32503593600;
public const
E_INVALID_KEY = 1,
E_UNSUPPORTED_LOGGER = 2,
E_DIRECTORY_NOT_CREATED = 3,
E_PHP_EXCEPTION = 4,
E_CONNECTION_ERROR = 5,
E_UNSUPPORTED_CLIENT = 6;
/**
* Returns the underlying cache client.
*
* @return \Memcached | \Redis | \Predis\Client | \Koded\Caching\Client\FileClient | \Koded\Caching\Client\MemoryClient | \Koded\Caching\Client\ShmopClient
*/
public function client();
/**
* Returns the global TTL, if any.
* Used as default expiration time in cache clients.
*
* @return int|null Time in seconds for expiration, or NULL for special cases
*/
public function getTtl(): ?int;
}