/**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln("Running Configuration for {$this->getApplication()->getLongVersion()}");
     $this->input = $input;
     $this->output = $output;
     $redmine = $this->getRedmineUrl();
     $this->output->writeln("Saving <comment>{$this->redmineUrl}</comment> to configuration.");
     $token = $this->getRedmineUserToken();
     $this->output->writeln("Saving <comment>{$this->redmineUserToken}</comment> to configuration.");
     $configuration = new Configuration();
     $configuration->save(['server' => $redmine, 'token' => $token]);
     $output->writeln('Configuration successful you can now use the app!');
 }
Пример #2
0
 /**
  * Application constructor.
  */
 public function __construct()
 {
     parent::__construct(self::NAME, self::VERSION);
     $configuration = new Config();
     // Not configured lets configure it
     if (!$configuration->isConfigured()) {
         $this->add(new ConfigureCommand());
         $this->setDefaultCommand('configure');
     }
     // all ready and good to go
     if ($configuration->isConfigured()) {
         $this->addCommands($this->getCommands());
     }
     $this->run();
 }