Add drupal scaffold

This commit is contained in:
Rob Davies 2017-03-16 15:11:34 +00:00
parent 6fa31ad086
commit 3e6a5cbed2
15 changed files with 2748 additions and 1 deletions
web/vendor/drupal-composer/drupal-scaffold/src

View 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);
}
});
}
}