From: Stricted Date: Sat, 11 Oct 2014 20:15:04 +0000 (+0200) Subject: add some changes X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=HEAD;p=Snippets.git add some changes --- diff --git a/APC.class.php b/APC.class.php index 2328aa4..f3a289e 100644 --- a/APC.class.php +++ b/APC.class.php @@ -59,7 +59,7 @@ class APC { 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; } diff --git a/db.class.php b/db.class.php index 664d6d5..9874ed3 100644 --- a/db.class.php +++ b/db.class.php @@ -159,5 +159,20 @@ class DB { 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); + } } ?>