[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/includes/Cache/Lite/ -> Output.php (source)

   1  <?php
   2  
   3  /**
   4  * This class extends Cache_Lite and uses output buffering to get the data to cache.
   5  *
   6  * There are some examples in the 'docs/examples' file
   7  * Technical choices are described in the 'docs/technical' file
   8  *
   9  * @package Cache_Lite
  10  * @version $Id: Output.php 49 2005-09-15 02:55:27Z rhuk $
  11  * @author Fabien MARTY <fab@php.net>
  12  */
  13  
  14  require_once('Cache/Lite.php');
  15  
  16  class Cache_Lite_Output extends Cache_Lite
  17  {
  18  
  19      // --- Public methods ---
  20  
  21      /**
  22      * Constructor
  23      *
  24      * $options is an assoc. To have a look at availables options,
  25      * see the constructor of the Cache_Lite class in 'Cache_Lite.php'
  26      *
  27      * @param array $options options
  28      * @access public
  29      */
  30  	function Cache_Lite_Output($options)
  31      {
  32          $this->Cache_Lite($options);
  33      }
  34  
  35      /**
  36      * Start the cache
  37      *
  38      * @param string $id cache id
  39      * @param string $group name of the cache group
  40      * @return boolean true if the cache is hit (false else)
  41      * @access public
  42      */
  43  	function start($id, $group = 'default')
  44      {
  45          $data = $this->get($id, $group);
  46          if ($data !== false) {
  47              echo($data);
  48              return true;
  49          } else {
  50              ob_start();
  51              ob_implicit_flush(false);
  52              return false;
  53          }
  54      }
  55  
  56      /**
  57      * Stop the cache
  58      *
  59      * @access public
  60      */
  61  	function end()
  62      {
  63          $data = ob_get_contents();
  64          ob_end_clean();
  65          $this->save($data, $this->_id, $this->_group);
  66          echo($data);
  67      }
  68  
  69  }
  70  
  71  
  72  ?>


Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics