This commit is contained in:
Eric Espie
2022-11-23 10:34:24 +01:00
parent 6b1c033ec1
commit c05684945f
2 changed files with 139 additions and 114 deletions

View File

@@ -24,10 +24,12 @@ class Session
protected static $bIsInitialized = false;
/** @var bool */
protected static $bSessionStarted = false;
/** @var bool */
public static $bAllowCLI = false;
public static function Start()
{
if (utils::IsModeCLI()) {
if (self::IsModeCLI()) {
return;
}
@@ -49,7 +51,7 @@ class Session
public static function FlushSession()
{
if (utils::IsModeCLI()) {
if (self::IsModeCLI()) {
return;
}
@@ -62,7 +64,7 @@ class Session
public static function RegenerateId($bDeleteOldSession = false)
{
if (utils::IsModeCLI()) {
if (self::IsModeCLI()) {
return;
}
@@ -73,7 +75,7 @@ class Session
public static function WriteClose()
{
if (utils::IsModeCLI()) {
if (self::IsModeCLI()) {
return;
}
@@ -212,4 +214,14 @@ class Session
{
return print_r($_SESSION, true);
}
private static function IsModeCLI(): bool
{
if (self::$bAllowCLI) {
return false;
}
return utils::IsModeCLI();
}
}