本文整理汇总了PHP中CacheControl::purgeItems方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheControl::purgeItems方法的具体用法?PHP CacheControl::purgeItems怎么用?PHP CacheControl::purgeItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CacheControl
的用法示例。
在下文中一共展示了CacheControl::purgeItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: flushEntry
function flushEntry($entryId = null)
{
global $database;
if (empty($entryId)) {
$entryId = '';
} else {
$entryId = $entryId . '\\_';
}
$cache = pageCache::getInstance();
$Entries = POD::queryColumn("SELECT name\n\t\t\tFROM {$database['prefix']}PageCacheLog\n\t\t\tWHERE blogid = " . getBlogId() . "\n\t\t\tAND (name like 'entry\\_" . $entryId . "%' OR name = 'commentRSS_" . $entryId . "')");
CacheControl::purgeItems($Entries);
if (!empty($entryId)) {
$entry = POD::queryCell("SELECT userid, category FROM {$database['prefix']}Entries\n\t\t\t\tWHERE blogid = " . getBlogId() . " AND id = {$entryId}");
if (!empty($entry)) {
CacheControl::flushAuthor($entry['userid']);
CacheControl::flushCategory($entry['category']);
CacheControl::flushDBCache();
}
} else {
CacheControl::flushAuthor();
CacheControl::flushCategory();
CacheControl::flushDBCache();
}
unset($cache);
return true;
}
示例2: flushEntry
function flushEntry($entryId = null)
{
global $database;
if (empty($entryId)) {
$entryId = '';
} else {
$entryId = intval($entryId);
}
$Entries = POD::queryColumn("SELECT name\n\t\t\tFROM {$database['prefix']}PageCacheLog\n\t\t\tWHERE blogid = " . getBlogId() . "\n\t\t\tAND (name like 'entry-" . $entryId . "-%' OR name like '%RSS-" . $entryId . "' OR name like '%ATOM-" . $entryId . "')");
if (!empty($Entries)) {
CacheControl::purgeItems($Entries);
}
if (!empty($entryId)) {
$entry = POD::queryRow("SELECT userid, category, published FROM {$database['prefix']}Entries\n\t\t\t\tWHERE blogid = " . getBlogId() . " AND id = {$entryId}");
if (!empty($entry)) {
$entry['period'] = Timestamp::getYearMonth($entry['published']);
CacheControl::flushAuthor($entry['userid']);
CacheControl::flushCategory($entry['category']);
CacheControl::flushArchive($entry['period']);
CacheControl::flushDBCache('entry');
}
} else {
CacheControl::flushAuthor();
CacheControl::flushCategory();
CacheControl::flushDBCache('entry');
}
return true;
}