mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 12:30:49 +08:00
add get ip&schema function
This commit is contained in:
@@ -443,15 +443,10 @@ function arr_set(&$array, $key, $value)
|
||||
return $array;
|
||||
}
|
||||
|
||||
function isHttps()
|
||||
function isHttps(): bool
|
||||
{
|
||||
if (RUNNING_IN_OCTANE) {
|
||||
$https = request()->server('HTTPS');
|
||||
$result = !empty($https) && (strtolower($https) !== 'off');
|
||||
} else {
|
||||
$result = !empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) !== 'off');
|
||||
}
|
||||
return $result;
|
||||
$schema = nexus()->getRequestSchema();
|
||||
return $schema == 'https';
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user