Sets a value in the cache.
string $key A unique key:
string $value The value to cache:
Overrides CacheInterface::set
public function set($key, $value) {
if (!is_dir($this->dir) && false === @mkdir($this->dir, 0777, true)) {
throw new \RuntimeException('Unable to create directory ' . $this->dir);
}
$path = $this->dir . '/' . $key;
if (false === @file_put_contents($path, $value)) {
throw new \RuntimeException('Unable to write file ' . $path);
}
}