PHP 클래스 Ouzo\Utilities\Cache

파일 보기 프로젝트 열기: letsdrink/ouzo 1 사용 예제들

공개 메소드들

메소드 설명
clear ( ) Clears all items stored in cache.
contains ( $key ) : boolean Checks if cache contains an object for the given key.
get ( $key, null $function = null ) : mixed | null Returns object from cache.
memoize ( $function ) : mixed | null Caches the given closure using filename:line as a key.
put ( $key, $object ) : mixed
size ( ) : integer Returns number of stored objects.

메소드 상세

clear() 공개 정적인 메소드

Clears all items stored in cache.
public static clear ( )

contains() 공개 정적인 메소드

Checks if cache contains an object for the given key.
public static contains ( $key ) : boolean
$key
리턴 boolean

get() 공개 정적인 메소드

If there's no object for the given key and $functions is passed, $function result will be stored in cache under the given key. Example: $countries = Cache::get("countries", function() {{ expensive computation that returns a list of countries return Country:all(); })
public static get ( $key, null $function = null ) : mixed | null
$key
$function null
리턴 mixed | null

memoize() 공개 정적인 메소드

Example: $countries = Cache::memoize(function() {{ expensive computation that returns a list of countries return Country:all(); })
public static memoize ( $function ) : mixed | null
$function
리턴 mixed | null

put() 공개 정적인 메소드

public static put ( $key, $object ) : mixed
$key
$object
리턴 mixed

size() 공개 정적인 메소드

Returns number of stored objects.
public static size ( ) : integer
리턴 integer