当前位置: 首页>>代码示例>>PHP>>正文


PHP getcacheinfo函数代码示例

本文整理汇总了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));
 }
开发者ID:ahmatjan,项目名称:huluphp,代码行数:10,代码来源:cache.php

示例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);
     }
 }
开发者ID:u0mo5,项目名称:app,代码行数:15,代码来源:Cache.php

示例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;
}
开发者ID:lilhorse,项目名称:cocoa,代码行数:15,代码来源:post.func.php

示例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;
        }
    }
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:19,代码来源:forum_viewthread.php

示例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;
}
开发者ID:v998,项目名称:discuzx-en,代码行数:15,代码来源:function_post.php

示例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':
开发者ID:lilhorse,项目名称:cocoa,代码行数:31,代码来源:index_classics.inc.php

示例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;
    }
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:15,代码来源:forum_index.php

示例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;
        }
    }
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:21,代码来源:viewthread.php

示例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;
    }
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:15,代码来源:forum_index.php


注:本文中的getcacheinfo函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。