/**
  * This command enables a template
  *
  * @param InputInterface  $input  The input interface
  * @param OutputInterface $output The output interface
  *
  * @return void
  *
  * @throws Exception Template nof found
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $templateName = $input->getArgument('template');
     $templates = $this->configurationManager->get('store.templates');
     $templateFound = array_reduce($templates, function ($alreadyFound, $template) use($templateName) {
         return $alreadyFound || $template['bundle'] == $templateName;
     }, false);
     if (!$templateFound) {
         throw new Exception(sprintf('Template %s not found', $templateName));
     }
     $this->configurationManager->set('store.template', $templateName);
     $formatter = $this->getHelper('formatter');
     $formattedLine = $formatter->formatSection('OK', 'Template "' . $templateName . '" enabled');
     $output->writeln($formattedLine);
 }
示例#2
0
 /**
  * Load a parameter given the key and the namespace
  *
  * @param string $parameterKey       Parameter key
  * @param string $parameterNamespace Parameter namespace
  *
  * @return null|string|boolean Configuration parameter value
  *
  * @throws ConfigurationParameterNotFoundException Configuration not found
  */
 public function getParameter($parameterKey, $parameterNamespace = '')
 {
     return $this->configurationManager->get($parameterKey, $parameterNamespace);
 }