File::moveFile
ファイルを移動(名前を変更)します
説明
public bool File::moveFile( string $from, string $to )
rename()で$fromを$toに移動します。$fromがない場合や、移動できない場合はfalseを返します。
引数
| 名前 | データ型 | デフォルト | 備考 |
|---|---|---|---|
| $from | string | 移動元のファイル | |
| $to | string | 移動先のファイル |
例
Controller
use Fegg\Tool\File;
$file = new File();
$file->moveFile('path/to/foo.txt', 'path/to/bar.txt');