1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace Fgm\Drupal\Composer;
- use Composer\Command\BaseCommand;
- use Symfony\Component\Console\Input\InputInterface;
- use Symfony\Component\Console\Output\OutputInterface;
- class BuildSettingsCommand extends BaseCommand
- {
- /**
- * @var string
- */
- protected $eventName;
- /**
- * {@inheritDoc}
- */
- public function configure()
- {
- parent::configure();
- $this->eventName = $this->getName();
- $this
- ->setName('build:settings')
- ->setDescription('Builds the *.settings.local.php files.')
- ->setDefinition([])
- ->setHelp(<<<EOT
- The build:settings command combines shared and per-environment parameters and passes
- them to the settings.local.php.twig template to build the settings/(build|run).settings.local.php files.
- EOT
- );
- }
- /**
- * {@inheritDoc}
- */
- public function execute(InputInterface $input, OutputInterface $output)
- {
- $conf = $this->getComposer()->getPackage()->getExtra()[Builder::NAME] ?? [];
- $messageFormat = empty($this->eventName)
- ? "BuildSettingsCommand Executed on its own"
- : "BuildSettingsCommand Executed on \"%s\" event";
- $output->write(sprintf($messageFormat, $this->eventName), true);
- }
- }
|