mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
Merge branch 'encrypt' into php8
This commit is contained in:
@@ -424,9 +424,12 @@ function isHttps()
|
||||
|
||||
function getSchemeAndHttpHost()
|
||||
{
|
||||
global $BASEURL;
|
||||
if (isRunningInConsole()) {
|
||||
return $BASEURL;
|
||||
}
|
||||
$isHttps = isHttps();
|
||||
$protocol = $isHttps ? 'https' : 'http';
|
||||
$port = $_SERVER['SERVER_PORT'];
|
||||
$result = "$protocol://" . $_SERVER['HTTP_HOST'];
|
||||
return $result;
|
||||
|
||||
@@ -576,3 +579,8 @@ function nexus_trans($key, $replace = [], $locale = null)
|
||||
do_log("key: $key, replace: " . nexus_json_encode($replace) . ", locale: $locale, getKey: $getKey, result: $result");
|
||||
return $result;
|
||||
}
|
||||
|
||||
function isRunningInConsole(): bool
|
||||
{
|
||||
return php_sapi_name() == 'cli';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user