读取文件

WBOY
WBOYOriginal
2016-06-23 14:01:31829browse

function read_static_cache($cache_name)
{
    if ((DEBUG_MODE & 2) == 2)
    {
        return false;
    }
    static $result = array();
    if (!empty($result[$cache_name]))
    {
        return $result[$cache_name];
    }
    $cache_file_path = ROOT_PATH . '/temp/static_caches/' . $cache_name . '.php';
    if (file_exists($cache_file_path))
    {
        include_once($cache_file_path);
        $result[$cache_name] = $data;
        return $result[$cache_name];
    }
    else
    {
        return false;
    }
}

变量$data何解,没定义就赋值


回复讨论(解决方案)

你看下 ROOT_PATH . '/temp/static_caches/' . $cache_name . '.php'这个临时文件 
里面应该有一个$data的数组

读取缓存的内容,而这个缓存是文件缓存。缓存的内容就是 $data = xxxx一大坨东西

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn