/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $io = new DrupalStyle($input, $output); $yes = $input->hasOption('yes') ? $input->getOption('yes') : false; // @see use Drupal\Console\Command\Shared\ConfirmationTrait::confirmGeneration if (!$this->confirmGeneration($io, $yes)) { return; } $module = $this->validator->validateModuleName($input->getOption('module')); $modulePath = $this->appRoot . $input->getOption('module-path'); $modulePath = $this->validator->validateModulePath($modulePath, true); $machineName = $this->validator->validateMachineName($input->getOption('machine-name')); $description = $input->getOption('description'); $core = $input->getOption('core'); $package = $input->getOption('package'); $moduleFile = $input->getOption('module-file'); $featuresBundle = $input->getOption('features-bundle'); $composer = $input->getOption('composer'); // Modules Dependencies, re-factor and share with other commands $dependencies = $this->validator->validateModuleDependencies($input->getOption('dependencies')); // Check if all module dependencies are available if ($dependencies) { $checked_dependencies = $this->checkDependencies($dependencies['success']); if (!empty($checked_dependencies['no_modules'])) { $io->warning(sprintf($this->trans('commands.generate.module.warnings.module-unavailable'), implode(', ', $checked_dependencies['no_modules']))); } $dependencies = $dependencies['success']; } $this->generator->generate($module, $machineName, $modulePath, $description, $core, $package, $moduleFile, $featuresBundle, $composer, $dependencies); }
/** * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output) { $io = new DrupalStyle($input, $output); // @see use Drupal\Console\Command\Shared\ConfirmationTrait::confirmGeneration if (!$this->confirmGeneration($io)) { return; } $theme = $this->validator->validateModuleName($input->getOption('theme')); $theme_path = $this->appRoot . $input->getOption('theme-path'); $theme_path = $this->validator->validateModulePath($theme_path, true); $machine_name = $this->validator->validateMachineName($input->getOption('machine-name')); $description = $input->getOption('description'); $core = $input->getOption('core'); $package = $input->getOption('package'); $base_theme = $input->getOption('base-theme'); $global_library = $input->getOption('global-library'); $regions = $input->getOption('regions'); $breakpoints = $input->getOption('breakpoints'); $this->generator->generate($theme, $machine_name, $theme_path, $description, $core, $package, $base_theme, $global_library, $regions, $breakpoints); }