From cd770328bc565b8dfa0a23461929f82af7187a0a Mon Sep 17 00:00:00 2001 From: Christopher Gutteridge Date: Wed, 11 Dec 2024 12:27:44 +0000 Subject: [PATCH] Update Server.php Don't call server cookie and ini methods when running in CLI mode for cron as this creates unhelpful warnings. --- lib/Server/Server.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Server/Server.php b/lib/Server/Server.php index 4966d78a5..966c1ea2a 100644 --- a/lib/Server/Server.php +++ b/lib/Server/Server.php @@ -55,7 +55,7 @@ public function SetSession($name, $value) public function GetSession($name) { - if (!$this->IsSessionStarted()) { + if (!$this->IsSessionStarted() && PHP_SAPI !== 'cli') { $parts = parse_url(Configuration::Instance()->GetScriptUrl()); $path = isset($parts['path']) ? $parts['path'] : ''; $seconds = Configuration::Instance()->GetKey(ConfigKeys::INACTIVITY_TIMEOUT, new IntConverter()) * 60;