ReplaceOp
class ReplaceOp extends AbstractOperation (View source)
| internal |
Scaffold operation to copy or symlink from source to destination.
Constants
| ID |
Identifies Replace operations. |
Properties
| protected string | $contents | Cached contents of scaffold file to be written to disk. |
from AbstractOperation |
| protected ScaffoldFilePath | $source | The relative path to the source file. |
|
| protected bool | $overwrite | Whether to overwrite existing files. |
Methods
Returns the exact data that will be written to the scaffold files.
Load the scaffold contents or otherwise generate what is needed.
Determines what to do if operation is used at same path as a previous op.
Determines what to do if operation is used without a previous operation.
Process this scaffold operation.
Details
final string
contents()
Returns the exact data that will be written to the scaffold files.
protected string
generateContents()
Load the scaffold contents or otherwise generate what is needed.
OperationInterface
scaffoldOverExistingTarget(OperationInterface $existing_target)
Determines what to do if operation is used at same path as a previous op.
Default behavior is to scaffold this operation at the specified destination, ignoring whatever was there before.
OperationInterface
scaffoldAtNewLocation(ScaffoldFilePath $destination)
Determines what to do if operation is used without a previous operation.
Default behavior is to scaffold this operation at the specified destination. Most operations overwrite rather than modify existing files, and therefore do not need to do anything special when there is no existing file.
__construct(ScaffoldFilePath $sourcePath, bool $overwrite = TRUE)
Constructs a ReplaceOp.
ScaffoldResult
process(ScaffoldFilePath $destination, IOInterface $io, ScaffoldOptions $options)
Process this scaffold operation.
protected ScaffoldResult
copyScaffold(ScaffoldFilePath $destination, IOInterface $io)
Copies the scaffold file.
protected ScaffoldResult
symlinkScaffold(ScaffoldFilePath $destination, IOInterface $io)
Symlinks the scaffold file.