1 Star 1 Fork 0

董志宏/memcached

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
MemcacheInterface.php 2.01 KB
一键复制 编辑 原始数据 按行查看 历史
董志宏 提交于 2019-10-06 22:01 +08:00 . init
<?php
/**
* php_memcache, php_memcached interface
* Author:phpxxo
* Email:244013508@qq.com
* Create Date:2019-10-4
*/
namespace extend\cache\memcache;
interface MemcacheInterface{
/**
* 初始化, 连接memcached
*/
function __construct(Array $options=[]);
/**
* 关闭memcached连接
*/
function __destruct();
/**
* 设置缓存
* @param string $name 缓存变量名
* @param string $value 缓存值
* @param int $expire 有效期 秒
* @param boolean $hasPrefix 是否有前缀
* @return boolean
*/
function set($name,$value,$expire=0,$hasPrefix=true);
/**
* 获取缓存值
* @param string $name 缓存变量名
* @param string $default 默认值
* @param boolean $hasPrefix 是否有前缀
*/
function get($name,$default='',$hasPrefix=true);
/**
* 自增缓存(针对数值)
* @param string $name 缓存变量名
* @param int $step 步长
* @param boolean $hasPrefix 是否有前缀
*/
function incr($name,$step=1,$hasPrefix=true);
/**
* 自减缓存(针对数值)
* @param string $name 缓存变量名
* @param int $step 步长
* @param boolean $hasPrefix 是否有前缀
*/
function decr($name,$step=1,$hasPrefix=true);
/**
* 删除缓存
* @param string $name 缓存变量名
* @param boolean $clearMemory 是否释放内存空间
* @param boolean $clearMemory 是否有前缀
*/
function del($name,$clearMemory=false,$hasPrefix=true);
/**
* 刷新所有缓存过期
* @param boolean $clearMemory 是否释放内存空间
* @return boolean
*/
function flush($clearMemory=false);
/**
* 获取带前缀的缓存存储key
* @param string $name 缓存变量名
* @return string
*/
function getCacheKey($name);
/**
* 获取所有key
* @return array
*/
function getAllkeys();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/phpxxo/memcached.git
git@gitee.com:phpxxo/memcached.git
phpxxo
memcached
memcached
master

搜索帮助