本文整理汇总了PHP中Tinebase_Helper::arrayToCacheId方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_Helper::arrayToCacheId方法的具体用法?PHP Tinebase_Helper::arrayToCacheId怎么用?PHP Tinebase_Helper::arrayToCacheId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinebase_Helper
的用法示例。
在下文中一共展示了Tinebase_Helper::arrayToCacheId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFolderCacheId
/**
* Gets a folder cache id
* @param integer $folderId
*/
public function getFolderCacheId($folderId)
{
return Tinebase_Helper::arrayToCacheId(array(self::EXPRESSOMAIL_MODEL_FOLDER, $folderId));
}
示例2: _createExpressomailModelAccountCacheId
/**
* Create Expressomail_Model_Account cache id
*
* @param string Expressomail Model Account id
* @return string cache id
*/
protected function _createExpressomailModelAccountCacheId($_id)
{
return Tinebase_Helper::arrayToCacheId(array(Tinebase_Core::getUser()->accountId, $_id));
}
示例3: getNodesFromCache
/**
* get nodes from cache
* if cache miss or cache etag is outdated, updates cache with nodes from backend
*
* @param string $path path
* @param string $etag hash etag
* @return array of nodes
*/
private function getNodesFromCache($path, $etag)
{
$cache = Tinebase_Core::get('cache');
$cacheId = Tinebase_Helper::arrayToCacheId(array(self::GETEXPRESSODRIVEETAGS, sha1(Tinebase_getUser()->getId()) . $this->encodePath($path)));
$result = $cache->load($cacheId);
if (!$result) {
$result = $this->getNodesFromBackend($path);
$cache->save($result, $cacheId, array(self::EXPRESSODRIVEETAGS), $this->cacheLifetime);
} else {
if ($result[0]['hash'] != $etag) {
$result = $this->getNodesFromBackend($path);
$cache->save($result, $cacheId, array(self::EXPRESSODRIVEETAGS), $this->cacheLifetime);
}
}
return $result;
}