Skip to content

Commit 80daacc

Browse files
committed
Fix FileSystemCacheEngine when there is no TTS (never set cache)
1 parent 0ea50ca commit 80daacc

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ addons:
1010
- redis-container
1111

1212
php:
13+
- "7.2"
1314
- "7.1"
1415
- "7.0"
1516
- "5.6"

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
"psr/log": "1.0.2",
1919
"psr/simple-cache": "1.0.*"
2020
},
21+
"require-dev": {
22+
"phpunit/phpunit": "5.7.*|6.5.*"
23+
},
2124
"suggest": {
22-
"ext-memcached": "*"
25+
"ext-memcached": "*",
26+
"ext-redis": "*"
2327
},
2428
"license": "MIT"
2529
}

src/Psr16/FileSystemCacheEngine.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function __construct($prefix = 'cache', $logger = null)
2727
* @param string $key The object KEY
2828
* @param mixed $default IGNORED IN MEMCACHED.
2929
* @return mixed Description
30+
* @throws \Psr\SimpleCache\InvalidArgumentException
3031
*/
3132
public function get($key, $default = null)
3233
{
@@ -84,6 +85,8 @@ public function set($key, $value, $ttl = null)
8485
try {
8586
if (file_exists($fileKey)) {
8687
unlink($fileKey);
88+
}
89+
if (file_exists("$fileKey.ttl")) {
8790
unlink("$fileKey.ttl");
8891
}
8992

0 commit comments

Comments
 (0)