/** * Downloads drupal scaffold files for the current process. */ public function downloadScaffold() { $drupalCorePackage = $this->getDrupalCorePackage(); $webroot = realpath($this->getWebRoot()); // Collect options, excludes and settings files. $options = $this->getOptions(); $files = array_diff($this->getIncludes(), $this->getExcludes()); // Call any pre-scaffold scripts that may be defined. $dispatcher = new EventDispatcher($this->composer, $this->io); $dispatcher->dispatch(self::PRE_DRUPAL_SCAFFOLD_CMD); $version = $this->getDrupalCoreVersion($drupalCorePackage); $remoteFs = new RemoteFilesystem($this->io); $fetcher = new FileFetcher($remoteFs, $options['source'], $files); $fetcher->fetch($version, $webroot); $initialFileFetcher = new InitialFileFetcher($remoteFs, $options['source'], $this->getInitial()); $initialFileFetcher->fetch($version, $webroot); // Call post-scaffold scripts. $dispatcher->dispatch(self::POST_DRUPAL_SCAFFOLD_CMD); }
public function testInitialFetch() { $fetcher = new InitialFileFetcher(new RemoteFilesystem(new NullIO()), 'http://cgit.drupalcode.org/drupal/plain/{path}?h={version}', ['sites/default/default.settings.php' => 'sites/default/settings.php']); $fetcher->fetch('8.1.1', $this->tmpDir); $this->assertFileExists($this->tmpDir . '/sites/default/settings.php'); }