X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrupal-composer%2Fdrupal-scaffold%2Fsrc%2FHandler.php;fp=vendor%2Fdrupal-composer%2Fdrupal-scaffold%2Fsrc%2FHandler.php;h=1bdefe0f69135a0aaa134a458c30a65c5fe87cde;hp=71307322be9be7724761670a6d12ddcb14fa2e12;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/vendor/drupal-composer/drupal-scaffold/src/Handler.php b/vendor/drupal-composer/drupal-scaffold/src/Handler.php index 71307322b..1bdefe0f6 100644 --- a/vendor/drupal-composer/drupal-scaffold/src/Handler.php +++ b/vendor/drupal-composer/drupal-scaffold/src/Handler.php @@ -1,12 +1,10 @@ composer = $composer; $this->io = $io; + $this->progress = TRUE; + + // Pre-load all of our sources so that we do not run up + // against problems in `composer update` operations. + $this->manualLoad(); + } + + protected function manualLoad() { + $src_dir = __DIR__; + + $classes = [ + 'CommandProvider', + 'DrupalScaffoldCommand', + 'FileFetcher', + 'PrestissimoFileFetcher', + ]; + + foreach ($classes as $src) { + if (!class_exists('\\DrupalComposer\\DrupalScaffold\\' . $src)) { + include "{$src_dir}/{$src}.php"; + } + } } /** @@ -66,12 +96,26 @@ class Handler { return NULL; } + /** + * Get the command options. + * + * @param \Composer\Plugin\CommandEvent $event + */ + public function onCmdBeginsEvent(CommandEvent $event) { + if ($event->getInput()->hasOption('no-progress')) { + $this->progress = !($event->getInput()->getOption('no-progress')); + } + else { + $this->progress = TRUE; + } + } + /** * Marks scaffolding to be processed after an install or update command. * * @param \Composer\Installer\PackageEvent $event */ - public function onPostPackageEvent(\Composer\Installer\PackageEvent $event){ + public function onPostPackageEvent(PackageEvent $event) { $package = $this->getCorePackage($event->getOperation()); if ($package) { // By explicitly setting the core package, the onPostCmdEvent() will @@ -85,7 +129,7 @@ class Handler { * * @param \Composer\Script\Event $event */ - public function onPostCmdEvent(\Composer\Script\Event $event) { + public function onPostCmdEvent(Event $event) { // Only install the scaffolding if drupal/core was installed, // AND there are no scaffolding files present. if (isset($this->drupalCorePackage)) { @@ -114,11 +158,12 @@ class Handler { $remoteFs = new RemoteFilesystem($this->io); - $fetcher = new PrestissimoFileFetcher($remoteFs, $options['source'], $files, $this->io, $this->composer->getConfig()); - $fetcher->fetch($version, $webroot); + $fetcher = new PrestissimoFileFetcher($remoteFs, $options['source'], $this->io, $this->progress, $this->composer->getConfig()); + $fetcher->setFilenames(array_combine($files, $files)); + $fetcher->fetch($version, $webroot, TRUE); - $initialFileFetcher = new InitialFileFetcher($remoteFs, $options['source'], $this->getInitial()); - $initialFileFetcher->fetch($version, $webroot); + $fetcher->setFilenames($this->getInitial()); + $fetcher->fetch($version, $webroot, FALSE); // Call post-scaffold scripts. $dispatcher->dispatch(self::POST_DRUPAL_SCAFFOLD_CMD); @@ -189,7 +234,7 @@ EOF; * Look up the Drupal core package object, or return it from where we cached * it in the $drupalCorePackage field. * - * @return PackageInterface + * @return \Composer\Package\PackageInterface */ public function getDrupalCorePackage() { if (!isset($this->drupalCorePackage)) { @@ -217,7 +262,7 @@ EOF; /** * Retrieve the path to the web root. * - * @return string + * @return string */ public function getWebRoot() { $drupalCorePackage = $this->getDrupalCorePackage(); @@ -235,7 +280,7 @@ EOF; * @param string $name * Name of the package to get from the current composer installation. * - * @return PackageInterface + * @return \Composer\Package\PackageInterface */ protected function getPackage($name) { return $this->composer->getRepositoryManager()->getLocalRepository()->findPackage($name, '*'); @@ -298,7 +343,7 @@ EOF; 'excludes' => [], 'includes' => [], 'initial' => [], - 'source' => 'http://cgit.drupalcode.org/drupal/plain/{path}?h={version}', + 'source' => 'https://cgit.drupalcode.org/drupal/plain/{path}?h={version}', // Github: https://raw.githubusercontent.com/drupal/drupal/{version}/{path} ]; return $options; @@ -322,7 +367,7 @@ EOF; /** * Files from 8.3.x * - * @see http://cgit.drupalcode.org/drupal/tree/?h=8.3.x + * @see https://cgit.drupalcode.org/drupal/tree/?h=8.3.x */ $common = [ '.csslintrc', @@ -338,7 +383,7 @@ EOF; 'sites/example.settings.local.php', 'sites/example.sites.php', 'update.php', - 'web.config' + 'web.config', ]; // Version specific variations.