uw Fri Mar 2 06:30:04 2001 EDT Modified files: /php4/pear/Cache Container.php Log: - changed $max_age to an absolute timestamp value Index: php4/pear/Cache/Container.php diff -u php4/pear/Cache/Container.php:1.2 php4/pear/Cache/Container.php:1.3 --- php4/pear/Cache/Container.php:1.2 Thu Mar 1 09:18:22 2001 +++ php4/pear/Cache/Container.php Fri Mar 2 06:30:03 2001 @@ -16,7 +16,7 @@ // | Sebastian Bergmann <[EMAIL PROTECTED]> | // +----------------------------------------------------------------------+ // -// $Id: Container.php,v 1.2 2001/03/01 17:18:22 sbergmann Exp $ +// $Id: Container.php,v 1.3 2001/03/02 14:30:03 uw Exp $ /** * Common base class of all cache storage container. @@ -36,7 +36,7 @@ * not recommended! * * @author Ulf Wendel <[EMAIL PROTECTED]> -* @version $Id: Container.php,v 1.2 2001/03/01 17:18:22 sbergmann Exp $ +* @version $Id: Container.php,v 1.3 2001/03/02 14:30:03 uw Exp $ * @package Cache * @access public * @abstract @@ -100,6 +100,7 @@ if ($this->id != $id) $this->preload($id); + return $this->data; } else { @@ -115,7 +116,7 @@ * Checks if a dataset is expired. * * @param string dataset ID - * @param integer maximum age in seconds of the data set + * @param integer maximum age timestamp * @return boolean * @access public */ @@ -144,7 +145,7 @@ return false; // you feel fine, Ulf? - if ($expired = ($this->expires <= time() || ($max_age && $this->expires <= time() + $max_age)) ) { + if ($expired = ($this->expires <= time() || ($max_age && ($this->expires <= +$max_age))) ) { $this->delete($id); $this->flushPreload(); @@ -167,7 +168,7 @@ if ($this->id != $id) $this->preload($id); - return !($this->unknown); + return !($this->unknown); } else { @@ -270,6 +271,7 @@ $this->id = $id; list($this->expires, $this->data) = $this->fetch($id); + if (NULL === $this->data) { // Uuups, unknown ID -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]