PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Interface ICache

ICache interface.

This interface must be implemented by cache managers.

Direct known implementers

TCache, TFastSqlMapApplicationCache, TSqlMapApplicationCache, TSqlMapCache

Indirect known implementers

TAPCCache, TDbCache, TEACache, TMemCache, TSqliteCache, TSqlMapFifoCache, TSqlMapLruCache, TXCache
Package: System
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at interfaces.php
Methods summary
public mixed
# get( string $id )

Retrieves a value from cache with a specified key.

Retrieves a value from cache with a specified key.

Parameters

$id
string
a key identifying the cached value

Returns

mixed
the value stored in cache, false if the value is not in the cache or expired.
public boolean
# set( string $id, mixed $value, integer $expire = 0, ICacheDependency $dependency = null )

Stores a value identified by a key into cache. If the cache already contains such a key, the existing value and expiration time will be replaced with the new ones.

Stores a value identified by a key into cache. If the cache already contains such a key, the existing value and expiration time will be replaced with the new ones.

Parameters

$id
string
the key identifying the value to be cached
$value
mixed
the value to be cached
$expire
integer
the number of seconds in which the cached value will expire. 0 means never expire.
$dependency
ICacheDependency
dependency of the cached item. If the dependency changes, the item is labelled invalid.

Returns

boolean
true if the value is successfully stored into cache, false otherwise
public boolean
# add( string $id, mixed $value, integer $expire = 0, ICacheDependency $dependency = null )

Stores a value identified by a key into cache if the cache does not contain this key. Nothing will be done if the cache already contains the key.

Stores a value identified by a key into cache if the cache does not contain this key. Nothing will be done if the cache already contains the key.

Parameters

$id
string
the key identifying the value to be cached
$value
mixed
the value to be cached
$expire
integer
the number of seconds in which the cached value will expire. 0 means never expire.
$dependency
ICacheDependency
dependency of the cached item. If the dependency changes, the item is labelled invalid.

Returns

boolean
true if the value is successfully stored into cache, false otherwise
public boolean
# delete( string $id )

Deletes a value with the specified key from cache

Deletes a value with the specified key from cache

Parameters

$id
string
the key of the value to be deleted

Returns

boolean
if no error happens during deletion
public
# flush( )

Deletes all values from cache. Be careful of performing this operation if the cache is shared by multiple applications.

Deletes all values from cache. Be careful of performing this operation if the cache is shared by multiple applications.

Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO