home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Services / Ebay / Cache / ExpiryCheck / Static.php
Encoding:
PHP Script  |  2008-07-02  |  951 b   |  44 lines

  1. <?PHP
  2. /**
  3.  * Static Expiry Check
  4.  *
  5.  * $Id: Static.php,v 1.1 2005/01/04 22:38:23 schst Exp $
  6.  *
  7.  * @package Services_Ebay
  8.  * @author  Stephan Schmidt <schst@php.net>
  9.  */
  10. class Services_Ebay_Cache_ExpiryCheck_Static
  11. {
  12.    /**
  13.     * static lifetime of the cache
  14.     *
  15.     * @var  integer
  16.     */
  17.     private $lifetime = null;
  18.     
  19.    /**
  20.     * constructor
  21.     *
  22.     * @param   integer      lifetime in seconds
  23.     */
  24.     public function __construct($lifetime)
  25.     {
  26.         $this->lifetime = $lifetime;
  27.     }
  28.     
  29.    /**
  30.     * check, whether the cache is valid
  31.     *
  32.     * @param   string      type of the model
  33.     * @param   integer      timestamp the cache has been created
  34.     * @param   array        model properties stored in the cache
  35.     */
  36.     public function isValid($Type, $timestamp, $props)
  37.     {
  38.         if ($timestamp + $this->lifetime > time()) {
  39.             return true;
  40.         }
  41.         return false;
  42.     }
  43. }
  44. ?>