本文整理匯總了PHP中eZCache::purgeImageAlias方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZCache::purgeImageAlias方法的具體用法?PHP eZCache::purgeImageAlias怎麽用?PHP eZCache::purgeImageAlias使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZCache
的用法示例。
在下文中一共展示了eZCache::purgeImageAlias方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testPurgeImageAliasForObject
public function testPurgeImageAliasForObject()
{
$imageObject = $this->createImage("Original image");
// generate a couple aliases
$dataMap = $imageObject->dataMap();
$aliasHandler = $dataMap['image']->attribute('content');
foreach (array('small', 'medium', 'large') as $aliasName) {
$alias = $aliasHandler->attribute($aliasName);
$aliasFiles[] = $alias['url'];
}
// create a new version
$imageObject = $this->createNewVersionWithImage($imageObject);
// generate a couple aliases
$dataMap = $imageObject->dataMap();
$imageAttribute = $dataMap['image'];
$imageAttributeId = $imageAttribute->attribute('id');
$aliasHandler = $imageAttribute->attribute('content');
$aliasFiles = array();
foreach (array('small', 'medium', 'large') as $aliasName) {
$alias = $aliasHandler->attribute($aliasName);
$aliasFiles[] = $alias['url'];
}
// we will check that the original alias wasn't removed
$originalAlias = $aliasHandler->attribute('original');
$originalAliasFile = $originalAlias['url'];
unset($originalAlias);
$aliasFiles = array_unique($aliasFiles);
foreach ($aliasFiles as $aliasFile) {
self::assertImageFileExists($imageAttributeId, $aliasFile);
}
self::assertImageFileExists($imageAttributeId, $originalAliasFile);
eZCache::purgeImageAlias(array('reporter' => function () {
}));
foreach ($aliasFiles as $aliasFile) {
self::assertImageFileNotExists($imageAttributeId, $aliasFile);
}
self::assertImageFileExists($imageAttributeId, $originalAliasFile);
}