Пример #1
0
 /**
  * 添付ファイルを移動します
  * @param array $file_info
  * @param string $newname
  */
 public function move_file($file_info, $newname)
 {
     if (is_string($file_info)) {
         $file_info = $this->in_files($file_info);
     }
     if (!$this->has_file($file_info)) {
         throw new \ebi\exception\NotFoundException('file not found ');
     }
     if (!is_dir(dirname($newname))) {
         \ebi\Util::mkdir(dirname($newname));
     }
     \ebi\Util::copy($file_info['tmp_name'], $newname);
     \ebi\Util::rm($file_info['tmp_name']);
 }