public function execute(Config $config, Logger $logger) { $params = $this->parseArguments(); $backend = null; if (!isset($params['backend'])) { $params['backend'] = BaseBackend::getActiveBackend(); } $className = 'Zephir\\Backends\\' . $params['backend'] . '\\Backend'; if (!class_exists($className)) { throw new \InvalidArgumentException('Backend ' . $params['backend'] . ' does not exist'); } $backend = new $className($config); $compiler = new Compiler($config, $logger, $backend); if (isset($params['parser-compiled'])) { if ($params['parser-compiled'] !== 'force') { $compiler->parserCompiled = true; } else { $compiler->parserCompiled = 'force'; } } $command = $this->getCommand(); $compiler->{$command}($this); }
public function execute(Config $config, Logger $logger) { if (isset($_SERVER['argv'][2])) { $this->setParameter('namespace', strtolower(preg_replace('/[^0-9a-zA-Z]/', '', $_SERVER['argv'][2]))); } parent::execute($config, $logger); }