Use PHP_SAPI

This commit is contained in:
the-djmaze 2024-08-12 17:07:44 +02:00
parent 8c6f0adc66
commit 55d7d52e35
2 changed files with 2 additions and 2 deletions

View file

@ -140,7 +140,7 @@ class Actions
. $oHttp->GetClientIp($this->oConfig->Get('labs', 'http_client_ip_check_proxy', false)) . $oHttp->GetClientIp($this->oConfig->Get('labs', 'http_client_ip_check_proxy', false))
. '][PID:' . (\MailSo\Base\Utils::FunctionCallable('getmypid') ? \getmypid() : 'unknown') . '][PID:' . (\MailSo\Base\Utils::FunctionCallable('getmypid') ? \getmypid() : 'unknown')
. '][' . \MailSo\Base\Http::GetServer('SERVER_SOFTWARE', '~') . '][' . \MailSo\Base\Http::GetServer('SERVER_SOFTWARE', '~')
. '][' . (\MailSo\Base\Utils::FunctionCallable('php_sapi_name') ? \php_sapi_name() : '~') . '][' . \PHP_SAPI
. '][Streams:' . \implode(',', \stream_get_transports()) . '][Streams:' . \implode(',', \stream_get_transports())
. '][' . $oHttp->GetMethod() . ' ' . $oHttp->GetScheme() . '://' . $oHttp->GetHost(false) . \MailSo\Base\Http::GetServer('REQUEST_URI', '') . ']' . '][' . $oHttp->GetMethod() . ' ' . $oHttp->GetScheme() . '://' . $oHttp->GetHost(false) . \MailSo\Base\Http::GetServer('REQUEST_URI', '') . ']'
); );

View file

@ -13,7 +13,7 @@ imapsync.php \
use MailSo\Net\Enumerations\ConnectionSecurityType as SecurityType; use MailSo\Net\Enumerations\ConnectionSecurityType as SecurityType;
if (4 > \count($_SERVER['argv']) || \in_array('--help', $_SERVER['argv'])) { if ('cli' !== PHP_SAPI || 4 > \count($_SERVER['argv']) || \in_array('--help', $_SERVER['argv'])) {
echo 'OPTIONS echo 'OPTIONS
usage: imapsync.php [options] usage: imapsync.php [options]