内部调用删除文件
null Core_Controller_File::action_unlink( )
public function action_unlink()
{
# 目录
$dirs = (array)$this->arguments[0];
# 文件
$filenames = (array)$this->arguments[1];
if (count($dirs)!=count($filenames))
{
$this->show_error('参数错误');
}
$files = array();
foreach ($dirs as $k=>$dir)
{
if ( !isset(File::$dir[$dir]) )
{
# 目录不允许操作
$this->show_error('目录不允许操作');
}
$files[] = File::$dir[$dir] . $filenames[$k];
}
if ( File::unlink($files) )
{
$this->show_success();
}
else
{
# 记录错误日志
Core::log($files,'delete file error');
$this->show_error('执行失败');
}
}