function ReplaceOp::symlinkScaffold
Same name in other branches
- 8.9.x composer/Plugin/Scaffold/Operations/ReplaceOp.php \Drupal\Composer\Plugin\Scaffold\Operations\ReplaceOp::symlinkScaffold()
- 10 composer/Plugin/Scaffold/Operations/ReplaceOp.php \Drupal\Composer\Plugin\Scaffold\Operations\ReplaceOp::symlinkScaffold()
- 11.x composer/Plugin/Scaffold/Operations/ReplaceOp.php \Drupal\Composer\Plugin\Scaffold\Operations\ReplaceOp::symlinkScaffold()
Symlinks the scaffold file.
Parameters
\Drupal\Composer\Plugin\Scaffold\ScaffoldFilePath $destination: Scaffold file to process.
\Composer\IO\IOInterface $io: IOInterface to writing to.
Return value
\Drupal\Composer\Plugin\Scaffold\Operations\ScaffoldResult The scaffold result.
1 call to ReplaceOp::symlinkScaffold()
- ReplaceOp::process in composer/
Plugin/ Scaffold/ Operations/ ReplaceOp.php - Process this scaffold operation.
File
-
composer/
Plugin/ Scaffold/ Operations/ ReplaceOp.php, line 113
Class
- ReplaceOp
- Scaffold operation to copy or symlink from source to destination.
Namespace
Drupal\Composer\Plugin\Scaffold\OperationsCode
protected function symlinkScaffold(ScaffoldFilePath $destination, IOInterface $io) {
$interpolator = $destination->getInterpolator();
try {
$fs = new Filesystem();
$fs->relativeSymlink($this->source
->fullPath(), $destination->fullPath());
} catch (\Exception $e) {
throw new \RuntimeException($interpolator->interpolate("Could not symlink source file <info>[src-rel-path]</info> to <info>[dest-rel-path]</info>!"), [], $e);
}
$io->write($interpolator->interpolate(" - Link <info>[dest-rel-path]</info> from <info>[src-rel-path]</info>"));
return new ScaffoldResult($destination, $this->overwrite);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.