phpDocumentor strategy
[ class tree: strategy ] [ index: strategy ] [ all elements ]

Class: WindWinCache

Source Location: /cache/strategy/WindWinCache.php

Class WindWinCache

Class Overview

wincache缓存策略实现类

WindWinCache继承AbstractWindCache类,并实现该类的提供的各自操作接口. 提供对方访问接口如下:

该缓存策略从AbstractWindCache类中继承三个配置项:
  1.   array(
  2.       'security-code' => '',    //继承自AbstractWindCache,安全码配置
  3.          'key-prefix' => '',        //继承自AbstractWindCache,缓存key前缀
  4.       'expires' => '0',    //继承自AbstractWindCache,缓存过期时间配置
  5.   )
使用方式:
1、您可以像使用普通的类一样使用该组件,如下:
  1.  Wind::import('WIND:cache.strategy.WindWinCache');
  2.  $cache new WindWinCache();
  3.  $cache->set('name''windframework');

2、同时作为组件,WindWinCache也允许用户通过组件配置得方式,通过框架的组件机制来获得该缓存对象进行操作. 在应用配置中的组件配置块(components),配置使用该组件为winCache如下:

  1.   'winCache' => array(
  2.         'path' => 'WIND:cache.strategy.WindwinCache',
  3.         'scope' => 'singleton',
  4.         'config' => array(
  5.             'security-code' => '',
  6.              'key-prefix' => '',
  7.           'expires' => '0',
  8.         ),
  9.     ),
在应用中通过如下方式使用:
  1.  $cache Wind::getApp()->getComponent('winCache');    //注意这里的winCache组件名称和配置的组件名称需要对应
  2.  $cache->set('name''wf');
关于组件配置的相关说明请参考组件配置一章.

<note>注意:要使用WindWinCache组件,需要安装wincache扩展支持.</note>

the last known user to change this file in the repository <LastChangedBy: xiaoxiao >

Located in /cache/strategy/WindWinCache.php [line 61]

WindModule
   |
   --AbstractWindCache
      |
      --WindWinCache
Author(s): Information Tags:
Version:  $Id: WindWinCache.php 2973 2011-10-15 19:22:48Z yishuo $
Copyright:  ©2003-2103 phpwind.com
License:  http://www.windframework.com

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From WindModule

WindModule::$_config
WindModule::$_proxy
WindModule::$_typeValidation

Inherited From AbstractWindCache

AbstractWindCache::add()
增加一个条目到缓存服务器
AbstractWindCache::addValue()
执行添加操作
AbstractWindCache::batchDelete()
通过key批量删除缓存数据
AbstractWindCache::batchGet()
通过key批量获取缓存数据
AbstractWindCache::buildData()
构造保存的数据
AbstractWindCache::buildSecurityKey()
将数据key计算生成安全的key
AbstractWindCache::clear()
清楚缓存,过期及所有缓存
AbstractWindCache::decrement()
将元素的值减小value
AbstractWindCache::delete()
删除缓存数据
AbstractWindCache::deleteValue()
需要实现的删除操作
AbstractWindCache::formatData()
格式化输出
AbstractWindCache::get()
根据缓存key获取指定缓存
AbstractWindCache::getExpire()
返回过期时间设置
AbstractWindCache::getKeyPrefix()
返回缓存Key值前缀
AbstractWindCache::getSecurityCode()
获得缓存key计算中加入的安全码
AbstractWindCache::getValue()
执行获取操作
AbstractWindCache::hasChanged()
判断数据是否已经被更新
AbstractWindCache::increment()
将指定元素的值增加value
AbstractWindCache::set()
设置缓存 如果key不存在,添加缓存;否则,将会替换已有key的缓存。
AbstractWindCache::setConfig()
设置配置信息
AbstractWindCache::setExpire()
设置缓存过期时间
AbstractWindCache::setKeyPrefix()
设置key前缀
AbstractWindCache::setSecurityCode()
设置缓存key计算中加入的安全码
AbstractWindCache::setValue()
执行设置操作

Inherited From WindModule

WindModule::getConfig()
根据配置名取得相应的配置
WindModule::getRequest()
返回当前应用的WindHttpRequest对象
WindModule::getResponse()
返回当前应用的WindHttpResponse对象
WindModule::getSystemFactory()
返回当前应用的WindFactory对象
WindModule::setConfig()
设置类配置
WindModule::setDelayAttributes()
设置延迟加载类属性相关组件配置信息
WindModule::toArray()
返回该对象的数组类型
WindModule::writeTableCloneProperty()
类对象clone白名单
WindModule::__call()
重载了魔术方法__call
WindModule::__clone()
重载魔术方法__clone
WindModule::__get()
重载了魔术方法__get
WindModule::__set()
重载了魔术方法__set

Inherited From AbstractWindCache

AbstractWindCache::DATA
AbstractWindCache::DEPENDENCY
AbstractWindCache::DEPENDENCYCLASS
AbstractWindCache::EXPIRE
AbstractWindCache::STORETIME

[ Top ]
Method Summary
WindWinCache   __construct()   构造函数
void   addValue()  
void   clear()  
void   deleteValue()  
void   getValue()  
void   setValue()  

[ Top ]
Methods
Constructor __construct  [line 70]

  WindWinCache __construct( )

构造函数

如果没有安装wincache扩展,则抛出异常


API Tags:
Access:  public

Information Tags:
Throws:  WindCacheException 当没有安装winCache扩展的时候抛出

[ Top ]
addValue  [line 86]

  void addValue( $key, $value, [ $expire = 0]  )

Parameters:
   $key: 
   $value: 
   $expire: 

API Tags:
Access:  protected


Redefinition of:
AbstractWindCache::addValue()
执行添加操作

[ Top ]
clear  [line 107]

  void clear( )


API Tags:
Access:  public


Redefinition of:
AbstractWindCache::clear()
清楚缓存,过期及所有缓存

[ Top ]
deleteValue  [line 100]

  void deleteValue( $key  )

Parameters:
   $key: 

API Tags:
Access:  protected


Redefinition of:
AbstractWindCache::deleteValue()
需要实现的删除操作

[ Top ]
getValue  [line 93]

  void getValue( $key  )

Parameters:
   $key: 

API Tags:
Access:  protected


Redefinition of:
AbstractWindCache::getValue()
执行获取操作

[ Top ]
setValue  [line 79]

  void setValue( $key, $value, [ $expire = 0]  )

Parameters:
   $key: 
   $value: 
   $expire: 

API Tags:
Access:  protected


Redefinition of:
AbstractWindCache::setValue()
执行设置操作

[ Top ]

Documentation generated on Fri, 30 Mar 2012 11:43:44 +0800 by phpDocumentor 1.4.4