本文整理汇总了PHP中ObjectCache::getUrgency方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectCache::getUrgency方法的具体用法?PHP ObjectCache::getUrgency怎么用?PHP ObjectCache::getUrgency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectCache
的用法示例。
在下文中一共展示了ObjectCache::getUrgency方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public function save(array $data)
{
if (apc_add(parent::getName(), serialize($data), parent::getTimeToLive()) === false) {
# logging me hearties
# logging me hearties
$types = parent::getTypes();
$urgency = parent::getUrgency();
parent::writeLog($types['error'], $urgency['high'], 'Could not successfully save to cache', 'APC Cache info: ' . PHP_EOL . serialize(apc_cache_info()));
return false;
}
return true;
}
示例2: load
public function load()
{
if ($this->__testForApc() === false) {
return false;
}
if (($data = apc_fetch(parent::getName())) === false) {
# logging me hearties
$types = parent::getTypes();
$urgency = parent::getUrgency();
parent::writeLog($types['notice'], array_key_exists("low", $urgency) ? $urgency["low"] : "", 'Could not successfully read from cache', 'APC Cache info: ' . PHP_EOL . serialize(apc_cache_info()));
return false;
}
return unserialize($data);
}
示例3: _testForCacheDateTable
private function _testForCacheDateTable()
{
$query = (string) "describe `cache_query_times`;";
if (self::query($query, false) === false) {
$query = (string) "create table `cache_query_times` (\n\t\t\t\t`id` integer(100) unsigned not null auto_increment primary key,\n\t\t\t\t`table` char(200),\n\t\t\t\t`timestamp` integer(100) unsigned not null default 0,\n\t\t\t\tindex `cacheQueryTimes` (`table`(100), `timestamp`)\n\t\t\t) engine=InnoDb default charset=UTF8;";
if (self::query($query, false) === false) {
# logging me hearties
$types = parent::getTypes();
$urgency = parent::getUrgency();
parent::writeLog($types['error'], $urgency['high'], 'Could not successfully create table for cache timing', "mySQL returned the following error: " . self::getConnection()->real_escape_string(self::getConnection()->error) . "\n");
return false;
}
return true;
}
return true;
}