19declare(strict_types=1);
32 public function copy(
string $sourcePath,
string $destinationPath, array $placeholders = []): void
34 if (!$this->fs->has($destinationPath)) {
35 $templateContents = file_get_contents($sourcePath);
37 foreach ($placeholders as $placeholder => $value) {
38 if (is_callable($value)) {
42 $templateContents = str_replace(
'[[' . $placeholder .
']]', $value, $templateContents);
static getDataDir()
get data directory (outside webspace)
__construct(private Filesystem $fs)
copy(string $sourcePath, string $destinationPath, array $placeholders=[])
The filesystem interface provides the public interface for the Filesystem service API consumer.