Skip to content

Commit 518590b

Browse files
committed
refactor time() to Cache and Database class
1 parent 98178a1 commit 518590b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

system/Cache/Handlers/FileHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ protected function getItem(string $filename)
242242
return false;
243243
}
244244

245-
if ($data['ttl'] > 0 && time() > $data['time'] + $data['ttl']) {
245+
if ($data['ttl'] > 0 && Time::now()->getTimestamp() > $data['time'] + $data['ttl']) {
246246
// If the file is still there then try to remove it
247247
if (is_file($this->path . $filename)) {
248248
@unlink($this->path . $filename);

system/Database/MigrationRunner.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use CodeIgniter\CLI\CLI;
1515
use CodeIgniter\Events\Events;
1616
use CodeIgniter\Exceptions\ConfigException;
17+
use CodeIgniter\I18n\Time;
1718
use Config\Database;
1819
use Config\Migrations as MigrationsConfig;
1920
use Config\Services;
@@ -596,7 +597,7 @@ protected function addHistory($migration, int $batch)
596597
'class' => $migration->class,
597598
'group' => $this->group,
598599
'namespace' => $migration->namespace,
599-
'time' => time(),
600+
'time' => Time::now()->getTimestamp(),
600601
'batch' => $batch,
601602
]);
602603

0 commit comments

Comments
 (0)