5 * Contains \Drupal\Console\Command\Features\ImportCommand.
8 namespace Drupal\Console\Command\Features;
10 use Symfony\Component\Console\Input\InputArgument;
11 use Symfony\Component\Console\Input\InputOption;
12 use Symfony\Component\Console\Input\InputInterface;
13 use Symfony\Component\Console\Output\OutputInterface;
14 use Drupal\Console\Command\Shared\FeatureTrait;
15 use Drupal\Console\Annotations\DrupalCommand;
16 use Drupal\Console\Core\Command\Command;
20 * extension = "features",
21 * extensionType = "module"
25 class ImportCommand extends Command
29 public function __construct()
31 parent::__construct();
34 protected function configure()
37 ->setName('features:import')
38 ->setDescription($this->trans('commands.features.import.description'))
42 InputOption::VALUE_OPTIONAL,
43 $this->trans('commands.features.import.options.bundle')
47 InputArgument::IS_ARRAY,
48 $this->trans('commands.features.import.arguments.packages')
49 )->setAliases(['fei']);
53 protected function execute(InputInterface $input, OutputInterface $output)
55 $packages = $input->getArgument('packages');
56 $bundle = $input->getOption('bundle');
59 $packages = $this->getPackagesByBundle($bundle);
62 $this->getAssigner($bundle);
63 $this->importFeature($packages);
69 protected function interact(InputInterface $input, OutputInterface $output)
71 $packages = $input->getArgument('packages');
72 $bundle = $input->getOption('bundle');
74 // @see Drupal\Console\Command\Shared\FeatureTrait::packageQuestion
75 $package = $this->packageQuestion($bundle);
76 $input->setArgument('packages', $package);