Fileクラスは、ファイルとディレクトリを扱うさまざまなメソッドを提供する。
メソッド | 説明 |
---|---|
copy | ファイルのコピー |
delete | ファイルの削除 |
download | ファイルのダウンロード |
read | ファイルの読み出し |
public static function copy($path, $new_path, $area = null, $source_area = null, $target_area = null)
public static function delete($path, $area = null)
download($path, $name = null, $mime = null, $area = null)
$path
$name
$mime
File::download(DOCROOT . 'index.php', 'newfile.php');
static int|string read($path, $as_string = false, $area = null);
$path
$as_string
true
を指定した場合、file_get_contents
関数で読み出す。false
を指定した場合、readfile
関数を使ってファイルを読み出す。static function rename($path, $new_path, $source_area = null, $target_area = null)