예제 #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $this->check($input, $output);
     $this->toggle(true);
     $output->writeln(sprintf("<info>Extension %s has been enabled</info>", $this->extension));
 }
예제 #2
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $type = false;
     // passed in type argument
     $forceType = $input->getArgument('type');
     // Try to load the type based on naming convention if we aren't passing a 'type' argument
     if (!$forceType) {
         $prefix = substr($this->extension, 0, 4);
         $type = isset($this->typeMap[$prefix]) ? $this->typeMap[$prefix] : false;
     }
     // only allow ones that exist.
     if (in_array($forceType, $this->typeMap)) {
         $type = $forceType;
     }
     // set the type.
     if (!$type) {
         $output->writeln("<comment>'{$type}' is not allowed as an extension type. Changing to 'component'</comment>");
         $this->type = 'component';
     } else {
         $this->type = $type;
     }
     $this->check($input, $output);
     $this->register($input, $output);
 }