This repository has been archived on 2025-01-19. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
drupalcampbristol/web/vendor/drupal-composer/drupal-scaffold/src/InitialFileFetcher.php
2017-03-16 15:11:34 +00:00

24 lines
688 B
PHP

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