选择语言 :

 Module_Storage_Driver_File::get

取得数据,支持批量取

mixed Module_Storage_Driver_File::get( string/array $key )

参数列表

参数 类型 描述 默认值
$key string/array $key
返回值
  • mixed
File: ./modules/storage/driver/file.class.php
public function get($key)
{
    if (is_array($key))
    {
        # 支持多取
        $data = array();
        foreach ($key as $k=>$v)
        {
            $data[$k] = $this->get((string)$v);
        }
        return $data;
    }

    $filename = $this->get_filename_by_key($key);

    if (file_exists($filename))
    {
        $data = @file_get_contents($filename);

        $this->_de_format_data($data);
        return $data;
    }
    else
    {
        return null;
    }
}