选择语言 :

Driver_Cache_Driver_Database
    └ Module_Cache_Driver

数据库缓存驱动器

API - Driver_Cache_Driver_Database

继承自父类的方法和变量
author
呼吸二氧化碳 jonwang@myqee.com
category
Module
package
Cache
copyright
Copyright © 2008-2013 myqee.com
license
http://www.myqee.com/license.html

$this->__construct( )


$this->__destruct( )


$this->get( $key )

取得数据,支持批量取

参数列表

参数 类型 描述 默认值
$key string/array $key
返回值
  • mixed

$this->set( $key , $value = null, $lifetime = 3600)

存数据

参数列表

参数 类型 描述 默认值
$key string/array 支持多存
$value $data Value 多存时此项可空 null
$lifetime $lifetime 有效期,默认3600,即1小时,0表示不限制 integer 3600
返回值
  • boolean

$this->delete( $key )

删除指定key的缓存,若$key===true则表示删除全部

参数列表

参数 类型 描述 默认值
$key string $key

$this->delete_all( )

删除全部


$this->delete_expired( )

删除过期数据


$this->decrement( $key , $offset = 1, $lifetime = 60)

递减

参数列表

参数 类型 描述 默认值
$key string $key
$offset int $offset integer 1
$lifetime int 当递减失则时当作set使用 integer 60

$this->increment( $key , $offset = 1, $lifetime = 60)

递增

参数列表

参数 类型 描述 默认值
$key string $key
$offset int $offset integer 1
$lifetime int 当递减失则时当作set使用 integer 60

$this->set_prefix( $prefix )

设置前缀

参数列表

参数 类型 描述 默认值
$prefix string $prefix
返回值
  • $this