PHP 클래스 Pimcore\Cache\Backend\Mongodb

상속: extends Zend_Cache_Backend, implements Zend_Cache_Backend_ExtendedInterface
파일 보기 프로젝트 열기: pimcore/pimcore

보호된 프로퍼티들

프로퍼티 타입 설명
$_collection MongoCollection
$_conn Mongo
$_db MongoDB
$_options =====> (array) servers : an array of mongodb server ; each mongodb server is described by an associative array : 'host' => (string) : the name of the mongodb server 'port' => (int) : the port of the mongodb server 'collection' => (string) : name of the collection to use 'dbname' => (string) : name of the database to use

공개 메소드들

메소드 설명
___expire ( string $id ) : void Expires a record (mostly used for testing purposes)
__construct ( $options ) : void
clean ( string $mode = Zend_Cache::CLEANING_MODE_ALL, array $tags = [] ) : boolean Clean some cache records (protected method used for recursive stuff)
drop ( )
get ( integer $id ) : array | false
getCapabilities ( ) : array Return an associative array of capabilities (booleans) of the backend
getFillingPercentage ( ) : integer No way to find the remaining space right now. So return 1.
getIds ( ) : array Return an array of stored cache ids
getIdsMatchingAnyTags ( array $tags = [] ) : array Return an array of stored cache ids which match any given tags
getIdsMatchingTags ( array $tags = [] ) : array Return an array of stored cache ids which match given tags
getIdsNotMatchingTags ( array $tags = [] ) : array Return an array of stored cache ids which don't match given tags
getMetadatas ( string $id ) : array Return an array of metadatas for the given cache id
getTags ( ) : array Return an array of stored tags
isAutomaticCleaningAvailable ( ) : boolean Return true if the automatic cleaning is available for the backend
load ( string $id, boolean $doNotTestCacheValidity = false ) : string | false Test if a cache is available for the given id and (if yes) return it (false else)
remove ( string $id ) : boolean Remove a cache record
save ( string $data, string $id, array $tags = [], integer $specificLifetime = false ) : boolean Save some string datas into a cache record
set ( integer $id, array $data, integer $lifetime, mixed $tags ) : boolean
setDirectives ( array $directives ) Set the frontend directives
test ( string $id ) : mixed | false Test if a cache is available or not (for the given id)
touch ( string $id, integer $extraLifetime ) : boolean Give (if possible) an extra lifetime to the given cache id

메소드 상세

___expire() 공개 메소드

Expires a record (mostly used for testing purposes)
public ___expire ( string $id ) : void
$id string
리턴 void

__construct() 공개 메소드

public __construct ( $options ) : void
리턴 void

clean() 공개 메소드

Available modes are : \Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used) \Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used) \Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags ($tags can be an array of strings or a single string) \Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags} ($tags can be an array of strings or a single string) \Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags ($tags can be an array of strings or a single string)
public clean ( string $mode = Zend_Cache::CLEANING_MODE_ALL, array $tags = [] ) : boolean
$mode string Clean mode
$tags array Array of tags
리턴 boolean True if no problem

drop() 공개 메소드

public drop ( )

get() 공개 메소드

public get ( integer $id ) : array | false
$id integer
리턴 array | false

getCapabilities() 공개 메소드

The array must include these keys : - automatic_cleaning (is automating cleaning necessary) - tags (are tags supported) - expired_read (is it possible to read expired cache records (for doNotTestCacheValidity option for example)) - priority does the backend deal with priority when saving - infinite_lifetime (is infinite lifetime can work with this backend) - get_list (is it possible to get the list of cache ids and the complete list of tags)
public getCapabilities ( ) : array
리턴 array associative of with capabilities

getFillingPercentage() 공개 메소드

No way to find the remaining space right now. So return 1.
public getFillingPercentage ( ) : integer
리턴 integer integer between 0 and 100

getIds() 공개 메소드

Return an array of stored cache ids
public getIds ( ) : array
리턴 array array of stored cache ids (string)

getIdsMatchingAnyTags() 공개 메소드

In case of multiple tags, a logical AND is made between tags
public getIdsMatchingAnyTags ( array $tags = [] ) : array
$tags array array of tags
리턴 array array of any matching cache ids (string)

getIdsMatchingTags() 공개 메소드

In case of multiple tags, a logical AND is made between tags
public getIdsMatchingTags ( array $tags = [] ) : array
$tags array array of tags
리턴 array array of matching cache ids (string)

getIdsNotMatchingTags() 공개 메소드

In case of multiple tags, a logical OR is made between tags
public getIdsNotMatchingTags ( array $tags = [] ) : array
$tags array array of tags
리턴 array array of not matching cache ids (string)

getMetadatas() 공개 메소드

The array must include these keys : - expire : the expire timestamp - tags : a string array of tags - mtime : timestamp of last modification time
public getMetadatas ( string $id ) : array
$id string cache id
리턴 array array of metadatas (false if the cache id is not found)

getTags() 공개 메소드

Return an array of stored tags
public getTags ( ) : array
리턴 array array of stored tags (string)

isAutomaticCleaningAvailable() 공개 메소드

Return true if the automatic cleaning is available for the backend

load() 공개 메소드

Test if a cache is available for the given id and (if yes) return it (false else)
public load ( string $id, boolean $doNotTestCacheValidity = false ) : string | false
$id string Cache id
$doNotTestCacheValidity boolean If set to true, the cache validity won't be tested
리턴 string | false cached datas

remove() 공개 메소드

Remove a cache record
public remove ( string $id ) : boolean
$id string Cache id
리턴 boolean True if no problem

save() 공개 메소드

Note : $data is always "string" (serialization is done by the core not by the backend)
public save ( string $data, string $id, array $tags = [], integer $specificLifetime = false ) : boolean
$data string Datas to cache
$id string Cache id
$tags array Array of strings, the cache record will be tagged by each string entry
$specificLifetime integer If != false, set a specific lifetime for this cache record (null => infinite lifetime)
리턴 boolean True if no problem

set() 공개 메소드

public set ( integer $id, array $data, integer $lifetime, mixed $tags ) : boolean
$id integer
$data array
$lifetime integer
$tags mixed
리턴 boolean

setDirectives() 공개 메소드

Set the frontend directives
public setDirectives ( array $directives )
$directives array Assoc of directives

test() 공개 메소드

Test if a cache is available or not (for the given id)
public test ( string $id ) : mixed | false
$id string Cache id
리턴 mixed | false (a cache is not available) or "last modified" timestamp (int) of the available cache record

touch() 공개 메소드

Give (if possible) an extra lifetime to the given cache id
public touch ( string $id, integer $extraLifetime ) : boolean
$id string cache id
$extraLifetime integer
리턴 boolean true if ok

프로퍼티 상세

$_collection 보호되어 있는 프로퍼티

protected MongoCollection $_collection
리턴 MongoCollection

$_conn 보호되어 있는 프로퍼티

protected Mongo $_conn
리턴 Mongo

$_db 보호되어 있는 프로퍼티

protected MongoDB $_db
리턴 MongoDB

$_options 보호되어 있는 프로퍼티

=====> (array) servers : an array of mongodb server ; each mongodb server is described by an associative array : 'host' => (string) : the name of the mongodb server 'port' => (int) : the port of the mongodb server 'collection' => (string) : name of the collection to use 'dbname' => (string) : name of the database to use
protected $_options