本文整理汇总了PHP中getcacheinfo函数的典型用法代码示例。如果您正苦于以下问题:PHP getcacheinfo函数的具体用法?PHP getcacheinfo怎么用?PHP getcacheinfo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getcacheinfo函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajax_clear
public function ajax_clear()
{
/*写入应用列表缓存*/
$applist = $this->applications_db->listinfo('', '', 1, 100, 'appid');
setcache('applist', $applist);
$applistinfo = getcacheinfo('applist');
$return['filesize'] = sizecount($applistinfo['filesize']);
$return['filemtime'] = date('Y-m-d H:i:s', $applistinfo['filemtime']);
exit(json_encode($return));
}
示例2: tpl_cache
/**
* ����ģ���ǩ����
* @param string $name ������
* @param integer $times ����ʱ��
*/
function tpl_cache($name, $times = 0)
{
$filepath = 'tpl_data';
$info = getcacheinfo($name, $filepath);
if (SYS_TIME - $info['filemtime'] >= $times) {
return false;
} else {
return getcache($name, $filepath);
}
}
示例3: deletethreadcaches
function deletethreadcaches($tids)
{
global $cachethreadon;
if (!$cachethreadon) {
return FALSE;
}
include_once DISCUZ_ROOT . './include/forum.func.php';
if (!empty($tids)) {
foreach (explode(',', $tids) as $tid) {
$fileinfo = getcacheinfo($tid);
@unlink($fileinfo['filename']);
}
}
return TRUE;
}
示例4: viewthread_loadcache
function viewthread_loadcache()
{
global $_G;
$_G['forum']['livedays'] = ceil((TIMESTAMP - $_G['forum']['dateline']) / 86400);
$_G['forum']['lastpostdays'] = ceil((TIMESTAMP - $_G['forum']['lastthreadpost']) / 86400);
$threadcachemark = 100 - ($_G['forum']['displayorder'] * 15 + $_G['thread']['digest'] * 10 + min($_G['thread']['views'] / max($_G['forum']['livedays'], 10) * 2, 50) + max(-10, 15 - $_G['forum']['lastpostdays']) + min($_G['thread']['replies'] / $_G['setting']['postperpage'] * 1.5, 15));
if ($threadcachemark < $_G['forum']['threadcaches']) {
$threadcache = getcacheinfo($_G['tid']);
if (TIMESTAMP - $threadcache['filemtime'] > $_G['setting']['cachethreadlife']) {
@unlink($threadcache['filename']);
define('CACHE_FILE', $threadcache['filename']);
} else {
readfile($threadcache['filename']);
viewthread_updateviews($_G['forum_thread']['threadtableid']);
$_G['setting']['debug'] && debuginfo();
$_G['setting']['debug'] ? die('<script type="text/javascript">document.getElementById("debuginfo").innerHTML = " ' . ($_G['setting']['debug'] ? 'Updated at ' . gmdate("H:i:s", $threadcache['filemtime'] + 3600 * 8) . ', Processed in ' . $debuginfo['time'] . ' second(s), ' . $debuginfo['queries'] . ' Queries' . ($_G['gzipcompress'] ? ', Gzip enabled' : '') : '') . '";</script>') : die;
}
}
}
示例5: deletethreadcaches
function deletethreadcaches($tids)
{
global $_G;
if (!$_G['setting']['cachethreadon']) {
return FALSE;
}
require_once libfile('function/forumlist');
if (!empty($tids)) {
foreach (explode(',', $tids) as $tid) {
$fileinfo = getcacheinfo($tid);
@unlink($fileinfo['filename']);
}
}
return TRUE;
}
示例6: exit
<?php
/*
[Discuz!] (C)2001-2009 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: index_classics.inc.php 21260 2009-11-23 08:33:35Z monkey $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
require_once DISCUZ_ROOT . './include/forum.func.php';
$discuz_action = 1;
if ($cacheindexlife && !$discuz_uid && $showoldetails != 'yes' && (!$_DCACHE['settings']['frameon'] || $_DCACHE['settings']['frameon'] && $_GET['frameon'] != 'yes') && empty($gid)) {
$indexcache = getcacheinfo(0);
if ($timestamp - $indexcache['filemtime'] > $cacheindexlife) {
@unlink($indexcache['filename']);
define('CACHE_FILE', $indexcache['filename']);
$styleid = $_DCACHE['settings']['styleid'];
} elseif ($indexcache['filename']) {
@readfile($indexcache['filename']);
$debug && debuginfo();
$debug ? die('<script type="text/javascript">document.getElementById("debuginfo").innerHTML = " ' . ($debug ? 'Updated at ' . gmdate("H:i:s", $indexcache['filemtime'] + 3600 * 8) . ', Processed in ' . $debuginfo['time'] . ' second(s), ' . $debuginfo['queries'] . ' Queries' . ($gzipcompress ? ', Gzip enabled' : '') : '') . '";</script>') : die;
}
}
if (isset($showoldetails)) {
switch ($showoldetails) {
case 'no':
dsetcookie('onlineindex', 0, 86400 * 365);
break;
case 'yes':
示例7: get_index_page_guest_cache
function get_index_page_guest_cache()
{
global $_G;
$indexcache = getcacheinfo(0);
if (TIMESTAMP - $indexcache['filemtime'] > $_G['setting']['cacheindexlife']) {
@unlink($indexcache['filename']);
define('CACHE_FILE', $indexcache['filename']);
} elseif ($indexcache['filename']) {
@readfile($indexcache['filename']);
$updatetime = dgmdate($indexcache['filemtime'], 'H:i:s');
$gzip = $_G['gzipcompress'] ? ', Gzip enabled' : '';
echo "<script type=\"text/javascript\">\r\n\t\t\tif(\$('debuginfo')) {\r\n\t\t\t\t\$('debuginfo').innerHTML = '. This page is cached at {$updatetime} {$gzip} .';\r\n\t\t\t}\r\n\t\t\t</script>";
exit;
}
}
示例8: viewthread_loadcache
function viewthread_loadcache()
{
global $tid, $forum, $timestamp, $cachethreadlife, $_DCACHE, $gzipcompress, $debug, $styleid;
$forum['livedays'] = ceil(($timestamp - $forum['dateline']) / 86400);
$forum['lastpostdays'] = ceil(($timestamp - $forum['lastthreadpost']) / 86400);
$threadcachemark = 100 - ($forum['displayorder'] * 15 + $forum['digest'] * 10 + min($forum['views'] / max($forum['livedays'], 10) * 2, 50) + max(-10, 15 - $forum['lastpostdays']) + min($forum['replies'] / $_DCACHE['settings']['postperpage'] * 1.5, 15));
if ($threadcachemark < $forum['threadcaches']) {
$threadcache = getcacheinfo($tid);
if ($timestamp - $threadcache['filemtime'] > $cachethreadlife) {
@unlink($threadcache['filename']);
define('CACHE_FILE', $threadcache['filename']);
$styleid = $_DCACHE['settings']['styleid'];
@(include DISCUZ_ROOT . './forumdata/cache/style_' . $styleid . '.php');
} else {
readfile($threadcache['filename']);
viewthread_updateviews();
$debug && debuginfo();
$debug ? die('<script type="text/javascript">document.getElementById("debuginfo").innerHTML = " ' . ($debug ? 'Updated at ' . gmdate("H:i:s", $threadcache['filemtime'] + 3600 * 8) . ', Processed in ' . $debuginfo['time'] . ' second(s), ' . $debuginfo['queries'] . ' Queries' . ($gzipcompress ? ', Gzip enabled' : '') : '') . '";</script>') : die;
}
}
}
示例9: get_index_page_guest_cache
function get_index_page_guest_cache()
{
global $_G;
$indexcache = getcacheinfo(0);
if (TIMESTAMP - $indexcache['filemtime'] > $_G['setting']['cacheindexlife']) {
@unlink($indexcache['filename']);
define('CACHE_FILE', $indexcache['filename']);
$_G['setting']['styleid'] = $_G['cache']['settings']['styleid'];
$styleid = $_G['setting']['styleid'];
} elseif ($indexcache['filename']) {
@readfile($indexcache['filename']);
$_G['setting']['debug'] && debuginfo();
$_G['setting']['debug'] ? die('<script type="text/javascript">document.getElementById("debuginfo").innerHTML = " ' . ($_G['setting']['debug'] ? 'Updated at ' . gmdate("H:i:s", $indexcache['filemtime'] + 3600 * 8) . ', Processed in ' . $debuginfo['time'] . ' second(s), ' . $debuginfo['queries'] . ' Queries' . ($_G['gzipcompress'] ? ', Gzip enabled' : '') : '') . '";</script>') : die;
}
}