class SourceUpdater implements WriterInterface (View source)

Class that updates the source package directory.

Properties

protected string $basePath

The path to the package directory (with directory separators normalized to '/', without trailing slashes).

protected OutputInterface $output
protected Filesystem $fs
protected array $filesToReplace

Methods

__construct(string $basePath, 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.

saveFile(string $sourceAbsolutePath, string $destinationRelativePath)

Copy the contents of a source file to the package source directory.

Details

__construct(string $basePath, OutputInterface $output, Filesystem $fs)

Initialize the instance.

Parameters

string $basePath

the path to the package directory (with directory separators normalized to '/', without trailing slashes)

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 saveFile(string $sourceAbsolutePath, string $destinationRelativePath)

Copy the contents of a source file to the package source directory.

Parameters

string $sourceAbsolutePath

The absolute path to the file to be copied.$this

string $destinationRelativePath

the path to the destination file relative to the package root directory