Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

Commit

Permalink
Change Docker entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
k911 committed May 18, 2018
1 parent 440707e commit 472a834
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 31 deletions.
28 changes: 13 additions & 15 deletions Command/SwooleServerHandle.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,22 @@ protected function execute(InputInterface $input, OutputInterface $output): void
$driver->boot($trustedHosts, $trustedProxies);
$output->writeln(\sprintf('<info>Swoole HTTP Server started on http://%s:%d for %d requests</info>', $host, $port, $requestLimit));

if ($profilingEnabled) {
$io->newLine();
$rows = [
['env', $this->kernel->getEnvironment()],
['debug', \var_export($this->kernel->isDebug(), true)],
['profiling', \var_export($profilingEnabled, true)],
['memory_limit', ServerUtils::formatBytes(ServerUtils::getMaxMemory())],
['trusted_hosts', \implode(', ', $trustedHosts)],
['trusted_proxies', \implode(', ', $trustedProxies)],
];

if ($staticFilesServingEnabled) {
$rows[] = ['document_root', $this->kernel->getRootDir().'/public'];
}
$rows = [
['env', $this->kernel->getEnvironment()],
['debug', \var_export($this->kernel->isDebug(), true)],
['profiling', \var_export($profilingEnabled, true)],
['memory_limit', ServerUtils::formatBytes(ServerUtils::getMaxMemory())],
['trusted_hosts', \implode(', ', $trustedHosts)],
['trusted_proxies', \implode(', ', $trustedProxies)],
];

$io->table(['Configuration', 'Values'], $rows);
if ($staticFilesServingEnabled) {
$rows[] = ['document_root', $this->kernel->getRootDir().'/public'];
}

$io->newLine();
$io->table(['Configuration', 'Values'], $rows);

$server->start();
}
}
30 changes: 14 additions & 16 deletions Command/SwooleServerRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,24 @@ protected function execute(InputInterface $input, OutputInterface $output): void
$trustedHosts = ServerUtils::decodeStringAsSet($_SERVER['APP_TRUSTED_HOSTS']);
$trustedProxies = ServerUtils::decodeStringAsSet($_SERVER['APP_TRUSTED_PROXIES']);
$driver->boot($trustedHosts, $trustedProxies);
$output->writeln(\sprintf('<info>Swoole HTTP Server started on http://%s:%d</info>', $host, $port));

if ($profilingEnabled) {
$io->newLine();
$rows = [
['env', $this->kernel->getEnvironment()],
['debug', \var_export($this->kernel->isDebug(), true)],
['profiling', \var_export($profilingEnabled, true)],
['memory_limit', ServerUtils::formatBytes(ServerUtils::getMaxMemory())],
['trusted_hosts', \implode(', ', $trustedHosts)],
['trusted_proxies', \implode(', ', $trustedProxies)],
];

if ($staticFilesServingEnabled) {
$rows[] = ['document_root', $this->kernel->getRootDir().'/public'];
}
$rows = [
['env', $this->kernel->getEnvironment()],
['debug', \var_export($this->kernel->isDebug(), true)],
['profiling', \var_export($profilingEnabled, true)],
['memory_limit', ServerUtils::formatBytes(ServerUtils::getMaxMemory())],
['trusted_hosts', \implode(', ', $trustedHosts)],
['trusted_proxies', \implode(', ', $trustedProxies)],
];

$io->table(['Configuration', 'Values'], $rows);
if ($staticFilesServingEnabled) {
$rows[] = ['document_root', $this->kernel->getRootDir().'/public'];
}

$output->writeln(\sprintf('<info>Swoole HTTP Server started on http://%s:%d</info>', $host, $port));
$io->newLine();
$io->table(['Configuration', 'Values'], $rows);

$server->start();
}
}

0 comments on commit 472a834

Please sign in to comment.