存数据
boolean Module_Storage_Driver_File::set( string/array $key [, $data $value = null ] )
参数列表
参数 类型 描述 默认值 $keystring/array支持多存 $value$dataValue 多存时此项可空 null
boolean public function set($key, $value = null)
{
if (is_array($key))
{
# 支持多存
$i=0;
foreach ($key as $k=>$v)
{
if ($this->set((string)$k, $v))
{
$i++;
}
}
return $i==count($key)?true:false;
}
$filename = $this->get_filename_by_key($key);
$this->_format_data($value);
return File::create_file($filename, $value, null, null, $this->storage);
}