Log::get PHP Method

get() static public method

读取文件信息
static public get ( string $filename, string $name, $type = '' ) : boolean
$filename string 文件名
$name string 信息名 mtime或者content
return boolean
    static function get($filename, $name, $type = '')
    {
        if (!isset(self::$contents[$filename])) {
            if (!is_file($filename)) {
                return false;
            }
            self::$contents[$filename] = file_get_contents($filename);
        }
        $content = self::$contents[$filename];
        $info = array('mtime' => filemtime($filename), 'content' => $content);
        return $info[$name];
    }

Usage Example

Exemplo n.º 1
0
 function query()
 {
     $log = new Log();
     $log->pagename = get_query_var('pagename');
     $data = $log->get();
     $this->total = count($data);
     return $data;
 }
All Usage Examples Of Log::get