Add drupal scaffold
This commit is contained in:
parent
6fa31ad086
commit
3e6a5cbed2
15 changed files with 2748 additions and 1 deletions
web/vendor/drupal-composer/drupal-scaffold/src
24
web/vendor/drupal-composer/drupal-scaffold/src/InitialFileFetcher.php
vendored
Normal file
24
web/vendor/drupal-composer/drupal-scaffold/src/InitialFileFetcher.php
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \DrupalComposer\DrupalScaffold\FileFetcher.
|
||||
*/
|
||||
|
||||
namespace DrupalComposer\DrupalScaffold;
|
||||
|
||||
use Composer\Util\Filesystem;
|
||||
use Composer\Util\RemoteFilesystem;
|
||||
|
||||
class InitialFileFetcher extends FileFetcher {
|
||||
public function fetch($version, $destination) {
|
||||
array_walk($this->filenames, function ($filename, $sourceFilename) use ($version, $destination) {
|
||||
$target = "$destination/$filename";
|
||||
if (!file_exists($target)) {
|
||||
$url = $this->getUri($sourceFilename, $version);
|
||||
$this->fs->ensureDirectoryExists($destination . '/' . dirname($filename));
|
||||
$this->remoteFilesystem->copy($url, $url, $target);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
Reference in a new issue