Todaymade\Daux\Console\Serve::execute PHP Метод

execute() защищенный Метод

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $host = $input->getOption('host');
        $port = $input->getOption('port');
        $daux = $this->prepareDaux($input);
        // Daux can only serve HTML
        $daux->getParams()->setFormat('html');
        chdir(__DIR__ . '/../../');
        putenv('DAUX_SOURCE=' . $daux->getParams()->getDocumentationDirectory());
        putenv('DAUX_THEME=' . $daux->getParams()->getThemesPath());
        putenv('DAUX_CONFIGURATION=' . $daux->getParams()->getConfigurationOverrideFile());
        putenv('DAUX_EXTENSION=' . DAUX_EXTENSION);
        $base = ProcessUtils::escapeArgument(__DIR__ . '/../../');
        $binary = ProcessUtils::escapeArgument((new PhpExecutableFinder())->find(false));
        echo "Daux development server started on http://{$host}:{$port}/\n";
        if (defined('HHVM_VERSION')) {
            if (version_compare(HHVM_VERSION, '3.8.0') >= 0) {
                passthru("{$binary} -m server -v Server.Type=proxygen -v Server.SourceRoot={$base}/ -v Server.IP={$host} -v Server.Port={$port} -v Server.DefaultDocument=server.php -v Server.ErrorDocument404=server.php");
            } else {
                throw new Exception("HHVM's built-in server requires HHVM >= 3.8.0.");
            }
        } else {
            passthru("{$binary} -S {$host}:{$port} {$base}/index.php");
        }
    }