protected function execute(InputInterface $input, OutputInterface $output) { if ($workingDir = $input->getArgument('working-directory')) { chdir($workingDir); } $config = $this->loadConfig($input); if (file_exists($this->file)) { $modified = ''; $fileConfig = json_decode(file_get_contents($this->file), true); if (json_encode($fileConfig) !== json_encode($config)) { $modified = ', modified by command arguments'; } $output->writeln(sprintf('<info>Read configuration %s%s.</info>', realpath($this->file), $modified)); } $output->writeln(sprintf('<info>%s</info>', getcwd())); $this->renderConfig($output, $config); $handler = new ProcessManager($output, $config['port'], $config['host'], $config['workers']); $handler->setBridge($config['bridge']); $handler->setAppEnv($config['app-env']); $handler->setDebug((bool) $config['debug']); $handler->setLogging((bool) $config['logging']); $handler->setAppBootstrap($config['bootstrap']); $handler->setMaxRequests($config['max-requests']); $handler->setPhpCgiExecutable($config['php-cgi']); $handler->setConcurrentRequestsPerWorker($config['concurrent-requests']); $handler->run(); }
protected function execute(InputInterface $input, OutputInterface $output) { $config = $this->initializeConfig($input, $output); $handler = new ProcessManager($output, $config['port'], $config['host'], $config['workers']); $handler->setBridge($config['bridge']); $handler->setAppEnv($config['app-env']); $handler->setDebug((bool) $config['debug']); $handler->setLogging((bool) $config['logging']); $handler->setAppBootstrap($config['bootstrap']); $handler->setMaxRequests($config['max-requests']); $handler->setPhpCgiExecutable($config['cgi-path']); $handler->setSocketPath($config['socket-path']); $handler->setConcurrentRequestsPerWorker($config['concurrent-requests']); $handler->setServingStatic($config['static']); $handler->run(); }