class Cloner implements WriterInterface (View source)

Class that save the package files to a new directory.

Properties

protected string $destinationDirectory

The absolute path to the destination directory.

protected bool $overwrite

Overwrite files if they already exist in the destination directory?

protected OutputInterface $output
protected Filesystem $fs
protected array $directoriesToAdd
protected array $filesToAdd

Methods

__construct(string $destinationDirectory, bool $overwrite, OutputInterface $output, Filesystem $fs)

Initialize the instance.

$this
add(PackerFile $file)

Add a file/directory.

completed()

Called after all the files have been processed succesfully.

createDestinationDirectory()

Create the destination directory.

createDirectory(string $relativePath)

Create a directory in the destination directory.

copyFile(string $sourceFile, string $relativePath)

Copy a file.

Details

__construct(string $destinationDirectory, bool $overwrite, OutputInterface $output, Filesystem $fs)

Initialize the instance.

Parameters

string $destinationDirectory

the absolute path to the destination directory

bool $overwrite

overwrite files if they already exist in the destination directory?

OutputInterface $output
Filesystem $fs

$this add(PackerFile $file)

Add a file/directory.

Parameters

PackerFile $file

Return Value

$this

See also

WriterInterface::add

completed()

Called after all the files have been processed succesfully.

protected createDestinationDirectory()

Create the destination directory.

Exceptions

RuntimeException

protected createDirectory(string $relativePath)

Create a directory in the destination directory.

Parameters

string $relativePath

Exceptions

RuntimeException

protected copyFile(string $sourceFile, string $relativePath)

Copy a file.

Parameters

string $sourceFile
string $relativePath

Exceptions

RuntimeException