directory = $directory . (substr($directory, -1) != '/' ? '/' : ''); } public function get($key) { $cache = @file_get_contents($this->directory . md5($key)); return $cache === false ? null : unserialize($cache); } public function set($key, $value) { return @file_put_contents($this->directory . md5($key), serialize($value)); } public function invalidate($key) { return @unlink($this->directory . md5($key)); } }