/** * Console constructor. * * @param string $appNamespace Application namespace (autodetect, if empty) * @param array $values Default options * @param array $fixPaths Path fixes * * @return Console */ public function __construct($appNamespace = '', array $values = [], array $fixPaths = []) { parent::__construct($appNamespace, $values, $fixPaths); $this->commandPath = isset($fixPaths['commandDir']) ? $fixPaths['commandDir'] : Utils::fixPath($this->getRootDir() . '/src/Command/'); $this->loadCommands($this->getCommandPath()); // load Propel commands if ($this['minion.usePropel']) { $this->loadCommands(Utils::fixPath(($this['environment'] === 'test' ? $this->getRootDir() . '/../' : $this->getRootDir()) . '/vendor/propel/propel/src/Propel/Generator/Command/'), 'propel'); // replace default config-dir value command option /** @var Command $command */ foreach ($this['console']->all('propel') as $command) { $def = $command->getDefinition(); $old = $def->getOptions(); foreach ($old as $i => $o) { if ($o->getName() === 'config-dir') { unset($old[$i]); break; } } $opt = new InputOption('config-dir', null, InputOption::VALUE_REQUIRED, 'The directory where the configuration file is placed.', $this->getPackageDir()); $def->setOptions(\array_merge($old, [$opt])); } } }