mirror of
https://github.com/danog/dns.git
synced 2024-12-02 17:38:05 +01:00
a30ead4952
I am anal. I am also sorry. Deal with it.
35 lines
713 B
PHP
35 lines
713 B
PHP
<?php
|
|
|
|
namespace Addr;
|
|
|
|
interface Cache
|
|
{
|
|
/**
|
|
* Attempt to retrieve a value from the cache
|
|
*
|
|
* Returns an array [$cacheHit, $value]
|
|
* [true, $valueFromCache] - if it existed in the cache
|
|
* [false, null] - if it didn't already exist in the cache
|
|
*
|
|
* @param $name
|
|
* @return array
|
|
*/
|
|
public function get($name);
|
|
|
|
/**
|
|
* Stores a value in the cache. Overwrites the previous value if there was one.
|
|
*
|
|
* @param $name
|
|
* @param $value
|
|
* @param null $ttl
|
|
*/
|
|
public function store($name, $value, $ttl = null);
|
|
|
|
/**
|
|
* Deletes an entry from the cache.
|
|
*
|
|
* @param $name
|
|
*/
|
|
public function delete($name);
|
|
}
|