本文整理汇总了PHP中OA_Delivery_Cache_buildFileName函数的典型用法代码示例。如果您正苦于以下问题:PHP OA_Delivery_Cache_buildFileName函数的具体用法?PHP OA_Delivery_Cache_buildFileName怎么用?PHP OA_Delivery_Cache_buildFileName使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OA_Delivery_Cache_buildFileName函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteCacheFile
/**
* A function to delete a single cache entry or the entire delivery cache.
*
* @param string $name The cache entry name
* @return bool True if the entres were succesfully deleted
*/
function deleteCacheFile($name = '')
{
if ($name != '') {
$filename = OA_Delivery_Cache_buildFileName($name);
return $this->_deleteCacheFile($filename);
}
return $this->_deleteAll();
}
示例2: OA_Delivery_Cache_store
/**
* A function to store content a cache entry.
*
* @param string $name The cache entry name
* @param string $cache The cache content
* @param string $isHash Define if $name is already a cached value or not
* @param int $expireAt Define the exact time when cache is expired
* @return bool True if the entry was succesfully stored
*/
function OA_Delivery_Cache_store($name, $cache, $isHash = false, $expireAt = null)
{
if ($cache === OA_DELIVERY_CACHE_FUNCTION_ERROR) {
// Don't store the result to enable permanent caching
return false;
}
$filename = OA_Delivery_Cache_buildFileName($name, $isHash);
$aCacheVar = array();
$aCacheVar['cache_contents'] = $cache;
$aCacheVar['cache_name'] = $name;
$aCacheVar['cache_time'] = MAX_commonGetTimeNow();
$aCacheVar['cache_expire'] = $expireAt;
return OX_Delivery_Common_hook('cacheStore', array($filename, $aCacheVar), $GLOBALS['_MAX']['CONF']['delivery']['cacheStorePlugin']);
}
示例3: test__deleteAll
/**
* A method to test the _deleteAll mathod
*/
function test__deleteAll()
{
$oPlgOxCacheFile = new Plugins_DeliveryCacheStore_oxCacheFile_oxCacheFile('deliveryCacheStore', 'oxCacheFile', 'oxCacheFile');
$content = NULL;
$name = 'test';
$filename = OA_Delivery_Cache_buildFileName($name);
$cachefile = $GLOBALS['OA_Delivery_Cache']['path'] . $filename;
Plugin_deliveryCacheStore_oxCacheFile_oxCacheFile_Delivery_cacheStore($filename, $content);
$this->assertTrue(file_exists($cachefile));
$oPlgOxCacheFile->_deleteAll();
$this->assertFalse(file_exists($cachefile));
}