PHP Class Horde_Kolab_Storage_Cache, horde

The Horde_Kolab_Storage_Cache singleton instance provides caching for all storage folders. So before operating on the cache data it is necessary to load the desired folder data. Before switching the folder the cache data should be saved. This class does not offer a lot of safeties and is primarily intended to be used within the Horde_Kolab_Storage_Data class. Copyright 2007-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
显示文件 Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_data_caches array Data cache instances.
$_horde_cache Horde_Cache The link to the horde cache.

Public Methods

Method Description
__construct ( Horde_Cache $cache ) Constructor.
deleteAttachment ( string $data_id, string $obid, string $attachment_id ) Delete a cached attachment.
getDataCache ( array $data_params ) : Horde_Kolab_Storage_Cache_Data Return a data cache.
loadAttachment ( string $data_id, string $obid, string $attachment_id ) : resource Retrieve an attachment.
loadData ( string $data_id ) : string Retrieve data set.
loadList ( string $list_id ) : string Retrieve list data.
requireParameter ( $parameters, $type, $key ) Determine if a necessary parameter is set.
storeAttachment ( string $data_id, string $obid, string $attachment_id, resource $data ) Store an attachment.
storeData ( string $data_id, string $data ) Cache data set.
storeList ( string $list_id, string $data ) Cache list data.

Private Methods

Method Description
_getAttachmentId ( string $data_id, string $obid, string $attachment_id ) : string Compose the attachment key.
_getDataId ( array $data_params ) : string Compose the data key.

Method Details

__construct() public method

Constructor.
public __construct ( Horde_Cache $cache )
$cache Horde_Cache The global cache for temporary data storage.

deleteAttachment() public method

Delete a cached attachment.
public deleteAttachment ( string $data_id, string $obid, string $attachment_id )
$data_id string ID of the data set.
$obid string Object backend id.
$attachment_id string Attachment ID.

getDataCache() public method

Return a data cache.
public getDataCache ( array $data_params ) : Horde_Kolab_Storage_Cache_Data
$data_params array Return the data cache for a data set with these parameters.
return Horde_Kolab_Storage_Cache_Data The data cache.

loadAttachment() public method

Retrieve an attachment.
public loadAttachment ( string $data_id, string $obid, string $attachment_id ) : resource
$data_id string ID of the data set.
$obid string Object backend id.
$attachment_id string Attachment ID.
return resource A stream opened to the attachment data.

loadData() public method

Retrieve data set.
public loadData ( string $data_id ) : string
$data_id string ID of the data set.
return string The cached data set.

loadList() public method

Retrieve list data.
public loadList ( string $list_id ) : string
$list_id string ID of the connection matching the list.
return string The data of the object.

requireParameter() public method

Determine if a necessary parameter is set.
public requireParameter ( $parameters, $type, $key )

storeAttachment() public method

Store an attachment.
public storeAttachment ( string $data_id, string $obid, string $attachment_id, resource $data )
$data_id string ID of the data set.
$obid string Object backend id.
$attachment_id string Attachment ID.
$data resource A stream opened to the attachment data.

storeData() public method

Cache data set.
public storeData ( string $data_id, string $data )
$data_id string ID of the data set.
$data string The data to be cached.

storeList() public method

Cache list data.
public storeList ( string $list_id, string $data )
$list_id string ID of the connection matching the list.
$data string The data to be cached.

Property Details

$_data_caches protected_oe property

Data cache instances.
protected array $_data_caches
return array

$_horde_cache protected_oe property

The link to the horde cache.
protected Horde_Cache $_horde_cache
return Horde_Cache