Skip to content

Commit

Permalink
:octocat:
Browse files Browse the repository at this point in the history
  • Loading branch information
codemasher committed Jan 22, 2018
1 parent bf78fdc commit ac25a91
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Drivers/FileCacheDriver.php
Expand Up @@ -66,15 +66,15 @@ public function get(string $key, $default = null){

/** @inheritdoc */
public function set(string $key, $value, int $ttl = null):bool{
$filename = $this->filename($key);
$data = new stdClass;
$filename = $this->filename($key);
$data = new stdClass;
$data->ttl = null;
$data->content = $value;

if($ttl !== null){
$data->ttl = time() + $ttl;
}

$data->content = $value;

file_put_contents($filename, serialize($data));

if(is_file($filename)){
Expand Down

0 comments on commit ac25a91

Please sign in to comment.