Skip to content

Commit 2fc3888

Browse files
committed
- use the server timezone for time()
1 parent d6dac1c commit 2fc3888

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Client/FileClient.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Koded\Caching\{Cache, CacheException};
1616
use Psr\Log\LoggerInterface;
1717
use function Koded\Caching\verify_key;
18-
use function Koded\Stdlib\{now, rmdir};
18+
use function Koded\Stdlib\rmdir;
1919

2020
/**
2121
* @property FileClient client
@@ -89,16 +89,16 @@ public function clear()
8989
public function has($key, &$filename = '', &$cache = null)
9090
{
9191
verify_key($key);
92-
9392
$filename = $this->filename($key, false);
93+
9494
if (false === is_file($filename)) {
9595
return false;
9696
}
9797

9898
/** @noinspection PhpIncludeInspection */
9999
$cache = include $filename;
100100

101-
if ($cache['timestamp'] <= now()->getTimestamp()) {
101+
if ($cache['timestamp'] <= time()) {
102102
unlink($filename);
103103

104104
return false;
@@ -142,7 +142,7 @@ private function filename(string $key, bool $create): string
142142
*
143143
* @throws CacheException
144144
*/
145-
private function setDirectory(string $directory)
145+
private function setDirectory(string $directory): void
146146
{
147147
// Overrule shell misconfiguration or the web server
148148
umask(umask() | 0002);

0 commit comments

Comments
 (0)