projectDir = $projectDir; parent::__construct($name); } protected function configure() { $this->addOption('project', 'p', InputOption::VALUE_OPTIONAL, 'project (dir)', $this->projectDir); $this->addOption('env', 'e', InputOption::VALUE_OPTIONAL, 'environment', 'dev'); $this->addOption('config', 'c', InputOption::VALUE_OPTIONAL, 'configuration file'); $this->addOption('overwrite', null, InputOption::VALUE_NONE, 'overwrite existing files'); } public function execute(InputInterface $input, OutputInterface $output) { $env = $input->getOption('env'); $factory = new Factory($input->hasOption('project') ? $input->getOption('project') : $this->projectDir, $env); $factory->bootEnv(); $generator = $factory->createGenerator(); $output->writeln("Generating configuration files for {$env}"); $success = $generator->processConfigurations( 'symfony', $input->getOption('overwrite') ? true : false, $input->getOption('config') ?: null, $output ); return $success ? 0 : 1; } }