Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
<?php
|
|
|
|
|
2019-08-22 02:45:53 +00:00
|
|
|
namespace Drupal\Composer\Plugin\Scaffold;
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
|
|
|
|
use Composer\Command\BaseCommand;
|
|
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
|
|
|
|
/**
|
2019-10-08 21:15:12 +00:00
|
|
|
* The "drupal:scaffold" command class.
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
*
|
|
|
|
* Manually run the scaffold operation that normally happens after
|
|
|
|
* 'composer install'.
|
2020-02-21 09:34:07 +00:00
|
|
|
*
|
|
|
|
* @internal
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
*/
|
|
|
|
class ComposerScaffoldCommand extends BaseCommand {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
|
|
|
protected function configure() {
|
|
|
|
$this
|
2019-10-08 21:15:12 +00:00
|
|
|
->setName('drupal:scaffold')
|
|
|
|
->setAliases(['scaffold'])
|
|
|
|
->setDescription('Update the Drupal scaffold files.')
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
->setHelp(
|
|
|
|
<<<EOT
|
2019-10-08 21:15:12 +00:00
|
|
|
The <info>drupal:scaffold</info> command places the scaffold files in their
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
respective locations according to the layout stipulated in the composer.json
|
|
|
|
file.
|
|
|
|
|
2019-10-08 21:15:12 +00:00
|
|
|
<info>php composer.phar drupal:scaffold</info>
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
|
2019-10-08 21:15:12 +00:00
|
|
|
It is usually not necessary to call <info>drupal:scaffold</info> manually,
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
because it is called automatically as needed, e.g. after an <info>install</info>
|
|
|
|
or <info>update</info> command. Note, though, that only packages explicitly
|
|
|
|
allowed to scaffold in the top-level composer.json will be processed by this
|
|
|
|
command.
|
|
|
|
|
|
|
|
For more information, see https://www.drupal.org/docs/develop/using-composer/using-drupals-composer-scaffold.
|
|
|
|
EOT
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* {@inheritdoc}
|
|
|
|
*/
|
2021-12-13 12:45:57 +00:00
|
|
|
protected function execute(InputInterface $input, OutputInterface $output): int {
|
2023-08-26 08:14:31 +00:00
|
|
|
$handler = new Handler($this->requireComposer(), $this->getIO());
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
$handler->scaffold();
|
2019-10-04 11:50:58 +00:00
|
|
|
return 0;
|
Issue #2982684 by greg.1.anderson, Mile23, Mixologic, webflo, alexpott, yogeshmpawar, pingwin4eg, vijaycs85, larowlan, dww, borisson_, phenaproxima, kim.pepper, bojanz, grasmash, hctom, kmbremner, pingers, Jax, sherakama, derhasi, claudiu.cristea, jhedstrom, Xano, Grimreaper: Add a composer scaffolding plugin to core
2019-07-10 21:47:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|