Skip to content

Commit

Permalink
Use config instead of settings
Browse files Browse the repository at this point in the history
  • Loading branch information
grimpirate authored Oct 16, 2024
1 parent ea225a1 commit 5d5d946
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions system/Session/Handlers/DatabaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,17 +312,17 @@ protected function releaseLock(): bool
*/
private function now($interval = null): string
{
$DBDriver = service('settings')->get("Database.{$this->DBGroup}")['DBDriver'];
return !is_null($interval)
$DBDriver = config(Database::class)->{$this->DBGroup}['DBDriver'];
return null === $interval
? match($DBDriver)
{
'SQLite3' => "datetime('now', '-{$interval}')",
default => "now() - INTERVAL {$interval}",
'SQLite3' => "datetime('now')",
default => "now()",
}
: match($DBDriver)
{
'SQLite3' => "datetime('now')",
default => "now()",
'SQLite3' => "datetime('now', '-{$interval}')",
default => "now() - INTERVAL {$interval}",
};
}
}

0 comments on commit 5d5d946

Please sign in to comment.