public static buildPhpCommand ( array $settings ) : string | ||
$settings | array | The Neos.Flow settings |
return | string | A command line command for PHP, which can be extended and then exec()uted |
/** * Run a standalone development server * * Starts an embedded server, see http://php.net/manual/en/features.commandline.webserver.php * Note: This requires PHP 5.4+ * * To change the context Flow will run in, you can set the <b>FLOW_CONTEXT</b> environment variable: * <i>export FLOW_CONTEXT=Development && ./flow server:run</i> * * @param string $host The host name or IP address for the server to listen on * @param integer $port The server port to listen on * @return void */ public function runCommand($host = '127.0.0.1', $port = 8081) { $command = Scripts::buildPhpCommand($this->settings); $address = sprintf('%s:%s', $host, $port); $command .= ' -S ' . escapeshellarg($address) . ' -t ' . escapeshellarg(FLOW_PATH_WEB) . ' ' . escapeshellarg(FLOW_PATH_FLOW . '/Scripts/PhpDevelopmentServerRouter.php'); $this->outputLine('Server running. Please go to <b>http://' . $address . '</b> to browse the application.'); exec($command); }