ManaPHP\Filesystem\Adapter\File::fileMove PHP Метод

fileMove() публичный Метод

public fileMove ( string $src, string $dst, boolean $overwrite = false ) : void
$src string
$dst string
$overwrite boolean
Результат void
    public function fileMove($src, $dst, $overwrite = false)
    {
        $src = $this->alias->resolve($src);
        $dst = $this->alias->resolve($dst);
        if (rtrim($dst, '\\/') !== $dst) {
            $dst .= basename($src);
        }
        if (!$overwrite && is_file($dst)) {
            throw new FileException('move `:src` to `:dst` failed: file exists already', ['src' => $src, 'dst' => $dst]);
        }
        if (!rename($src, $dst)) {
            throw new FileException('move `:src` to `:dst` failed: :last_error_message', ['src' => $src, 'dst' => $dst]);
        }
    }