protected function initialize(InputInterface $input, OutputInterface $output) { $this->settings = $this->getApplication()->getSettings(); $loader = new \Twig_Loader_Filesystem($this->settings->getPackageBaseDir() . '/config-dist'); $this->twig = new \Twig_Environment($loader); $filter = new \Twig_SimpleFilter('bool', function ($value) { if ($value) { return 'true'; } else { return 'false'; } }); $this->twig->addFilter($filter); $this->parseComposerConfig(); }
/** * Install a Behat feature example. * * @param OutputInterface $output * * @codeCoverageIgnore */ protected function writeBehatExamples(OutputInterface $output) { if (is_dir($this->settings['featuresDir'])) { $output->writeln("<error>Features directory already present. No example features are installed.</error>"); return; } try { $filesystem = new Filesystem(); $filesystem->mirror($this->settings->getPackageBaseDir() . '/config-dist/features', $this->settings['featuresDir']); } catch (\Exception $e) { $output->writeln("<error>Something went wrong when creating the features directory" . $e->getMessage() . "</error>"); return; } }