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 upgradeV1ToV2() { $container = $this->getContainer(); foreach (self::$mapV1ToV2 as $from => $mapping) { if ($container->hasParameter($from)) { $oldValue = $container->getParameter($from); $container->setParameter($mapping['name'], $mapping['values'][$oldValue]); $container->getParameterBag()->remove($from); $this->config->setParameter($mapping['name'], $mapping['values'][$oldValue]); $this->config->unsetParameter($from); } } $container->setAlias('db', 'db.' . $container->getParameter('db_type')); $this->config->setParameter('version', LATEST_SCHEMA_VERSION); }