banker/src/Driver/DriverInterface.php

80 lines
1.4 KiB
PHP

<?php
/**
* Banker
*
* A Caching library implementing psr/cache
*
* PHP version 5.6
*
* @package Banker
* @author Timothy J. Warren <tim@timshomepage.net>
* @copyright 2016 Timothy J. Warren
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version 1.0.0
* @link https://git.timshomepage.net/timw4mail/banker
*/
namespace Aviat\Banker\Driver;
/**
* Interface for different cache backends
*/
interface DriverInterface {
/**
* See if a key exists in the cache
*
* @param $key
* @return bool
*/
public function exists($key);
/**
* Set a cached value
*
* @param string $key
* @param mixed $value
* @param int $expires
* @return DriverInterface
*/
public function set($key, $value, $expires = 0);
/**
* Get the value for the selected cache key
*
* @param string $key
* @return mixed
*/
public function get($key);
/**
* Retrieve a set of values by their cache key
*
* @param string[] $keys
* @return array
*/
public function getMultiple(array $keys = []);
/**
* Remove an item from the cache
*
* @param string $key
* @return boolean
*/
public function delete($key);
/**
* Remove multiple items from the cache
*
* @param string[] $keys
* @return boolean
*/
public function deleteMultiple(array $keys = []);
/**
* Empty the cache
*
* @return boolean
*/
public function flush();
}