protected function execute(InputInterface $input, OutputInterface $output) { foreach ($this->config->getParameters() as $key) { if ($input->getOption($key) !== NULL) { $this->config->setParameter($key, $input->getOption($key)); $this->getContainer()->setParameter($key, $input->getOption($key)); } } $this->config->save(); }
protected function execute(InputInterface $input, OutputInterface $output) { $rows = array(); foreach ($this->config->getParameters() as $key) { $rows[] = array($key, $this->getContainer()->getParameter($key), $this->config->getDescription($key)); } $table = $this->getApplication()->getHelperSet()->get('table'); $table->setHeaders(array('Key', 'Value', 'Description')); $table->setRows($rows); $table->render($output); }
protected function execute(InputInterface $input, OutputInterface $output) { $found = FALSE; foreach ($this->config->getParameters() as $key) { if ($input->getOption($key) || $input->getOption('all')) { $this->config->unsetParameter($key); $found = TRUE; } } if ($found) { $this->config->save(); } else { $output->writeln('<error>No properties specified</error>'); } }
protected function execute(InputInterface $input, OutputInterface $output) { // Deprecated options. if ($input->getOption('mysql_type') !== NULL) { if ($input->getOption('db_type') === NULL) { $input->setOption('db_type', 'mysql_' . $input->getOption('mysql_type')); $output->writeln('<error>Option "--mysql_type" is deprecated and will be removed in the future. Please use "--db_type" instead.</error>'); } else { throw new \RuntimeException('Conflicting input. Use "--db_type" instead of "--mysql_type".'); } } // Main options. foreach ($this->config->getParameters() as $key) { if ($input->getOption($key) !== NULL) { $this->config->setParameter($key, $input->getOption($key)); $this->getContainer()->setParameter($key, $input->getOption($key)); } } $this->config->save(); }