[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/libraries/pattemplate/patTemplate/ -> TemplateCache.php (source)

   1  <?PHP
   2  /**
   3   * Base class for patTemplate template cache
   4   *
   5   * $Id: TemplateCache.php 10381 2008-06-01 03:35:53Z pasamio $
   6   *
   7   * A template cache is used to cache the data after
   8   * the template has been read, but before the variables
   9   * have been added.
  10   *
  11   * Data is normally stored in serialized format. This
  12   * will increase performance.
  13   *
  14   * This is not related to an output cache!
  15   *
  16   * @package        patTemplate
  17   * @subpackage    Caches
  18   * @author        Stephan Schmidt <schst@php.net>
  19   */
  20  
  21  // Check to ensure this file is within the rest of the framework
  22  defined('JPATH_BASE') or die();
  23  
  24  /**
  25   * Base class for patTemplate template cache
  26   *
  27   * $Id: TemplateCache.php 10381 2008-06-01 03:35:53Z pasamio $
  28   *
  29   * A template cache is used to cache the data after
  30   * the template has been read, but before the variables
  31   * have been added.
  32   *
  33   * Data is normally stored in serialized format. This
  34   * will increase performance.
  35   *
  36   * This is not related to an output cache!
  37   *
  38   * @abstract
  39   * @package        patTemplate
  40   * @subpackage    Caches
  41   * @author        Stephan Schmidt <schst@php.net>
  42   */
  43  class patTemplate_TemplateCache extends patTemplate_Module
  44  {
  45      /**
  46      * load template from cache
  47      *
  48      * @access    public
  49      * @param    string            cache key
  50      * @param    integer            modification time of original template
  51      * @return    array|boolean    either an array containing the templates or false cache could not be loaded
  52      */
  53  	function load( $key, $modTime = -1 )
  54      {
  55          return false;
  56      }
  57  
  58      /**
  59      * write template to cache
  60      *
  61      * @access    public
  62      * @param    string        cache key
  63      * @param    array        templates to store
  64      */
  65  	function write( $key, $templates )
  66      {
  67          return true;
  68      }
  69  
  70      /**
  71      * get the cache key for the input
  72      *
  73      * @param    mixed    input to read from.
  74      *                    This can be a string, a filename, a resource or whatever the derived class needs to read from
  75      * @param    array    options
  76      * @return    string    key
  77      */
  78  	function getKey( $input, $options = array() )
  79      {
  80          return    md5( $input . serialize( $options ) );
  81      }
  82  }
  83  ?>


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1