本文整理汇总了PHP中tools::deleteCache方法的典型用法代码示例。如果您正苦于以下问题:PHP tools::deleteCache方法的具体用法?PHP tools::deleteCache怎么用?PHP tools::deleteCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tools
的用法示例。
在下文中一共展示了tools::deleteCache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_online_users
function get_online_users()
{
$dir = _DIR_ . '/data/';
$files = scandir($dir);
$count = 0;
foreach ($files as $filename) {
if (is_dir($dir . $filename)) {
continue;
}
if (substr($filename, 0, 11) == 'user_count_') {
$isOnline = tools::readCache($filename);
if (!empty($isOnline)) {
$count++;
} else {
tools::deleteCache($filename);
}
}
}
return $count;
}
示例2: date
$peak = tools::isPeakNow(true);
if (strtotime($peak['peak_start']) < time()) {
$peak['peak_start'] = date('Y-m-d H:i:s', strtotime($peak['peak_start']) + 86400);
}
$seconds_after_peak = strtotime($auction['end_time']) - strtotime($peak['peak_end']);
$time = strtotime($peak['peak_start']) + $seconds_after_peak;
$endTime = date('Y-m-d H:i:s', $time);
if (strtotime($endTime) < time()) {
$endTime = date('Y-m-d H:i:s', strtotime($endTime) + 86400);
}
$db->update('auctions', "end_time = '{$endTime}'", "id = {$auction['id']}");
} else {
$data['auction_peak_start'] = get('auction_peak_start');
$data['auction_peak_end'] = get('auction_peak_end');
$data['isPeakNow'] = $isPeakNow;
$data['time_increment'] = get('time_increment', $auction['id'], 0);
$data['bid_debit'] = get('bid_debit', $auction['id'], 0);
$data['price_increment'] = get('price_increment', $auction['id'], 0);
placeAutobid($auction['id'], $data, false, 3);
}
} else {
closeAuction($auction);
}
}
}
}
usleep(500000);
}
tools::deleteCache('close.pid');
break;
}
示例3: getUserInfos
private function getUserInfos()
{
if (isset($_SESSION['user_id']) && !empty($_SESSION['user_id'])) {
$isOnline = tools::readCache('user_count_' . $_SESSION['user_id']);
if (!empty($isOnline)) {
tools::deleteCache('user_count_' . $_SESSION['user_id']);
tools::writeCache('user_count_' . $_SESSION['user_id'], $_SESSION['user_id'], 300);
} else {
tools::writeCache('user_count_' . $_SESSION['user_id'], $_SESSION['user_id'], 300);
}
$balance = $this->db->select("fetch", "bids", "SUM(credit) - SUM(debit) AS total", array("user_id" => $_SESSION['user_id']));
$this->user['balance'] = $balance['total'];
}
}
示例4: clearCache
function clearCache($auction_id = null, $user_id = null)
{
if (!empty($auction_id)) {
tools::deleteCache('auction_view_' . $auction_id);
tools::deleteCache('auction_' . $auction_id);
}
if (!empty($user_id)) {
tools::deleteCache('bids_balance_' . $user_id);
}
}