PHP Класс Pimcore\Cache\Backend\Mongodb

Наследование: extends Zend_Cache_Backend, implements Zend_Cache_Backend_ExtendedInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_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
public isAutomaticCleaningAvailable ( ) : boolean
Результат boolean

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