示例#1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $config = new Config();
     $config->setBasePath(getcwd());
     $config->setFromArray($input->getArguments());
     $config->setFromArray(array('bare' => $input->getOption('bare')));
     $moduleConfig = new ConfigWriter($config);
     $state = new State($moduleConfig);
     $builder = new FullContainer($config);
     $builder->prepare($state);
     $builder->build($state);
     $writeState = new State($moduleConfig);
     $models = array('service' => $state->getServiceModel(), 'factory' => $state->getModel('service-factory'), 'trait' => $state->getModel('service-trait'), 'test' => $state->getModel('service-test'));
     foreach (array_keys($models) as $key) {
         if ($input->getOption('no-' . $key)) {
             $models[$key] = false;
         }
         if ($input->getOption('only-' . $key)) {
             foreach (array_keys($models) as $index) {
                 if ($key != $index) {
                     $models[$index] = false;
                 }
             }
         }
     }
     foreach ($models as $model) {
         if ($model) {
             $writeState->addModel($model);
         }
     }
     $writer = new ModelWriter($config);
     $writer->write($writeState, $output);
     $moduleConfig->save($output);
 }
 /**
  * Prepare config
  *
  * @param InputInterface $input
  */
 protected function prepareConfig(InputInterface $input)
 {
     $this->config = new Config();
     $this->config->setBasePath(getcwd());
     $this->config->setFromArray($input->getArguments());
     $this->config->setFromArray($input->getOptions());
     $this->configWriter = new ConfigWriter($this->config);
 }
示例#3
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $config = new Config();
     $config->setBasePath(getcwd());
     $config->setFromArray($input->getArguments());
     $config->setFromArray($input->getOptions());
     $moduleConfig = new ConfigWriter($config);
     $state = new State($moduleConfig);
     $builder = new ModuleContainer($config);
     $builder->prepare($state);
     $builder->build($state);
     $writer = new ModelWriter($config);
     $writer->write($state, $output);
 }