PHP 클래스 Habari\Cache

Base abstract class for caching computationally expensive or bandwidth intensive data
파일 보기 프로젝트 열기: habari/system 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cache_class
$default_group
$instance

공개 메소드들

메소드 설명
__static ( ) Set up the static cache instance in __autoload()
debug ( )
expire ( mixed $name, string $match_mode = 'strict' ) Expires the named value from the cache.
expired ( mixed $name ) Check if a named value in the cache has expired.
extend ( mixed $name, integer $expiry ) Extend the expiration of the named cached value.
get ( mixed $name ) : mixed Returns the named value from the cache.
get_class ( ) : string Retrieve the class used for caching
get_group ( $group ) : mixed Returns the group from the cache.
has ( mixed $name ) : boolean Is record with $name in the cache?
has_group ( string $group ) : boolean Is group in the cache?
purge ( ) Empty the cache completely
set ( mixed $name, mixed $value, integer $expiry = 3600, boolean $keep = false ) Set the named value in the cache with an expiration.

보호된 메소드들

메소드 설명
_expire ( string $name, $group ) A cache instance implements this to expire the named value from the cache.
_expired ( string $name, $group ) A cache instance implements this to expire the named value from the cache.
_extend ( string $name, integer $expiry, $group ) A cache instance implements this to extend the expiration of the named cached value.
_get ( string $name, $group ) : mixed A cache instance implements this to return the named value from the cache.
_get_group ( $group ) : mixed A cache instance implements this to return the group from the cache.
_has ( string $name, $group ) : boolean A cache instance implements this function to return whether a named cache exists.
_has_group ( $group ) : boolean A cache instance implements this function to return whether a group exists.
_set ( string $name, mixed $value, integer $expiry, $group, $keep ) A cache instance implements this to set the named value in the cache with an expiration.

비공개 메소드들

메소드 설명
site_unique ( ) : string Return a string unique to this cache so that site caches don't collide

메소드 상세

__static() 공개 정적인 메소드

Set up the static cache instance in __autoload()
public static __static ( )

_expire() 추상적인 보호된 메소드

A cache instance implements this to expire the named value from the cache.
abstract protected _expire ( string $name, $group )
$name string The name of the cached item

_expired() 추상적인 보호된 메소드

A cache instance implements this to expire the named value from the cache.
abstract protected _expired ( string $name, $group )
$name string The name of the cached item

_extend() 추상적인 보호된 메소드

A cache instance implements this to extend the expiration of the named cached value.
abstract protected _extend ( string $name, integer $expiry, $group )
$name string The name of the cached item
$expiry integer The duration in seconds to extend the cache expiration by

_get() 추상적인 보호된 메소드

A cache instance implements this to return the named value from the cache.
abstract protected _get ( string $name, $group ) : mixed
$name string The name of the cached item
리턴 mixed The item value or null if it doesn't exist in cache

_get_group() 추상적인 보호된 메소드

A cache instance implements this to return the group from the cache.
abstract protected _get_group ( $group ) : mixed
리턴 mixed The item value or null if it doesn't exist in cache

_has() 추상적인 보호된 메소드

A cache instance implements this function to return whether a named cache exists.
abstract protected _has ( string $name, $group ) : boolean
$name string The name of the cached item
리턴 boolean true if the item is cached, false if not

_has_group() 추상적인 보호된 메소드

A cache instance implements this function to return whether a group exists.
abstract protected _has_group ( $group ) : boolean
리턴 boolean true if the group is cached, false if not

_set() 추상적인 보호된 메소드

A cache instance implements this to set the named value in the cache with an expiration.
abstract protected _set ( string $name, mixed $value, integer $expiry, $group, $keep )
$name string The name of the cached item
$value mixed The value to store
$expiry integer Number of second after the call that the cache will expire

debug() 공개 정적인 메소드

public static debug ( )

expire() 공개 정적인 메소드

Expires the named value from the cache.
public static expire ( mixed $name, string $match_mode = 'strict' )
$name mixed The name of the cached item or an array of array( string $group, string $name )
$match_mode string (optional) how to match item names ('strict', 'regex', 'glob') (default 'strict')

expired() 공개 정적인 메소드

Check if a named value in the cache has expired.
public static expired ( mixed $name )
$name mixed The name of the cached item or an array of array( string $group, string $name )

extend() 공개 정적인 메소드

Extend the expiration of the named cached value.
public static extend ( mixed $name, integer $expiry )
$name mixed The name of the cached item or an array of array( string $group, string $name )
$expiry integer The duration in seconds to extend the cache expiration by

get() 공개 정적인 메소드

Returns the named value from the cache.
public static get ( mixed $name ) : mixed
$name mixed The name of the cached item or an array of array( string $group, string $name )
리턴 mixed The item value or null if it doesn't exist in cache

get_class() 공개 정적인 메소드

Retrieve the class used for caching
public static get_class ( ) : string
리턴 string The class used for caching

get_group() 공개 정적인 메소드

Returns the group from the cache.
public static get_group ( $group ) : mixed
리턴 mixed The item value or null if it doesn't exist in cache

has() 공개 정적인 메소드

Is record with $name in the cache?
public static has ( mixed $name ) : boolean
$name mixed name of the cached item or an array of array( string $group, string $name )
리턴 boolean true if item is cached, false if not

has_group() 공개 정적인 메소드

Is group in the cache?
public static has_group ( string $group ) : boolean
$group string name of the cached group
리턴 boolean true if group is cached, false if not

purge() 공개 정적인 메소드

Empty the cache completely
public static purge ( )

set() 공개 정적인 메소드

Set the named value in the cache with an expiration.
public static set ( mixed $name, mixed $value, integer $expiry = 3600, boolean $keep = false )
$name mixed The name of the cached item or an array of array( string $group, string $name )
$value mixed The value to store
$expiry integer Number of second after the call that the cache will expire
$keep boolean If true, retain the cache value even after expiry but report the cache as expired

프로퍼티 상세

$cache_class 보호되어 있는 정적으로 프로퍼티

protected static $cache_class

$default_group 보호되어 있는 정적으로 프로퍼티

protected static $default_group

$instance 보호되어 있는 정적으로 프로퍼티

protected static $instance