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

Class: Cache

Source Location: /cache.php

Class Cache

Class Overview

Multi-layer universal cache controller for Cotonti

Located in /cache.php [line 1110]



		
				Author(s):
		
API Tags:
Property-read:  bool $mem_available: Memory storage availability flag

Properties

Methods

[ Top ]
Property Summary
Db_cache_driver   $db   Intermediate database cache driver.
Static_cache_driver   $disk   Persistent cache underlayer driver.
Temporary_cache_driver   $mem   Mutable top-layer shared memory driver.
Page_cache   $page   Page cache driver.

[ Top ]
Method Summary
Cache   __construct()   Initializes controller components
void   __destruct()   Performs actions before script termination
bool   bind()   Binds an event to automatic cache field invalidation
int   bind_array()   Binds multiple cache fields to events, all represented as an associative array
void   clear()   Clears all cache entries
void   clear_realm()   Clears cache in specific realm
array   get_info()   Returns information about memory driver usage
int   trigger()   Invalidates cache cells which were binded to the event.
int   unbind()   Removes event/cache bindings
mixed   __get()   Property handler

[ Top ]
Properties
Db_cache_driver   $db [line 1124]

Intermediate database cache driver.

It is recommended to use memory cache for particular objects rather than DB cache.

API Tags:
Access:  public


[ Top ]
Static_cache_driver   $disk [line 1118]

Persistent cache underlayer driver.

Stores disk-only cache entries. Use it for large objects, which you don't want to put into memory cache.

API Tags:
Access:  public


[ Top ]
Temporary_cache_driver   $mem [line 1130]

Mutable top-layer shared memory driver.

Is FALSE if memory cache is not available

API Tags:
Access:  public


[ Top ]
Page_cache   $page [line 1136]

Page cache driver.

Is FALSE if page cache is disabled

API Tags:
Access:  public


[ Top ]
Methods
Constructor __construct  [line 1156]

  Cache __construct( )

Initializes controller components


API Tags:
Access:  public


[ Top ]
Destructor __destruct  [line 1201]

  void __destruct( )

Performs actions before script termination


API Tags:
Access:  public


[ Top ]
bind  [line 1256]

  bool bind( string $event, string $id, [string $realm = COT_DEFAULT_REALM], [int $type = COT_CACHE_TYPE_DEFAULT]  )

Binds an event to automatic cache field invalidation

Parameters:
string   $event:  Event name
string   $id:  Cache entry id
string   $realm:  Cache realm name
int   $type:  Storage type, one of COT_CACHE_TYPE_* values

API Tags:
Return:  TRUE on success, FALSE on error
Access:  public


[ Top ]
bind_array  [line 1284]

  int bind_array( array $bindings  )

Binds multiple cache fields to events, all represented as an associative array

Binding keys: event - name of the event the field is binded to id - cache object id realm - cache realm name type - cache storage type, one of COT_CACHE_TYPE_* constants

Parameters:
array   $bindings:  An indexed array of bindings. Each binding is an associative array with keys: event, realm, id, type.

API Tags:
Return:  Number of bindings added
Access:  public


[ Top ]
clear  [line 1312]

  void clear( [int $type = COT_CACHE_TYPE_ALL]  )

Clears all cache entries

Parameters:
int   $type:  Cache storage type: COT_CACHE_TYPE_ALL, COT_CACHE_TYPE_DB, COT_CACHE_TYPE_DISK, COT_CACHE_TYPE_MEMORY.

API Tags:
Access:  public


[ Top ]
clear_realm  [line 1345]

  void clear_realm( [string $realm = COT_DEFAULT_REALM], [int $type = COT_CACHE_TYPE_ALL]  )

Clears cache in specific realm

Parameters:
string   $realm:  Realm name
int   $type:  Cache storage type: COT_CACHE_TYPE_ALL, COT_CACHE_TYPE_DB, COT_CACHE_TYPE_DISK, COT_CACHE_TYPE_MEMORY.

API Tags:
Access:  public


[ Top ]
get_info  [line 1377]

  array get_info( )

Returns information about memory driver usage


API Tags:
Return:  Usage information
Access:  public


[ Top ]
trigger  [line 1387]

  int trigger( string $event  )

Invalidates cache cells which were binded to the event.

Parameters:
string   $event:  Event name

API Tags:
Return:  Number of cells cleaned
Access:  public


[ Top ]
unbind  [line 1430]

  int unbind( string $realm, [string $id = '']  )

Removes event/cache bindings

Parameters:
string   $realm:  Realm name (required)
string   $id:  Object identifier. Optional, if not specified, all bindings from the realm are removed.

API Tags:
Return:  Number of bindings removed
Access:  public


[ Top ]
__get  [line 1214]

  mixed __get( string $name  )

Property handler

Parameters:
string   $name:  Property name

API Tags:
Return:  Property value
Access:  public


[ Top ]

Documentation generated on Fri, 19 Mar 2010 17:45:20 +0000 by phpDocumentor 1.4.3