public function fetch ($key) {
if ($this->exists($key)) {
$cacheTime = $this->getCacheTime($key);
- if ($cacheTime['ttl'] > 0 && (TIME_NOW - $cacheTime['mtime']) > $cacheTime['ttl']) {
+ if ($cacheTime['ttl'] > 0 && (time() - $cacheTime['mtime']) > $cacheTime['ttl']) {
$this->delete($key);
return null;
}
public function error () {
return $this->error;
}
+
+ /**
+ * call PDO methods
+ *
+ * @param string $name
+ * @param array $arguments
+ * @return mixed
+ */
+ public function __call($name, $arguments) {
+ if (!method_exists($this->conn, $name)) {
+ throw new Exception("unknown method '".$name."'");
+ }
+
+ return call_user_func_array(array($this->conn, $name), $arguments);
+ }
}
?>