[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/phpbb/cache/driver/ -> wincache.php (source)

   1  <?php
   2  /**
   3  *
   4  * This file is part of the phpBB Forum Software package.
   5  *
   6  * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7  * @license GNU General Public License, version 2 (GPL-2.0)
   8  *
   9  * For full copyright and license information, please see
  10  * the docs/CREDITS.txt file.
  11  *
  12  */
  13  
  14  namespace phpbb\cache\driver;
  15  
  16  /**
  17  * ACM for WinCache
  18  */
  19  class wincache extends \phpbb\cache\driver\memory
  20  {
  21      var $extension = 'wincache';
  22  
  23      /**
  24      * {@inheritDoc}
  25      */
  26  	function purge()
  27      {
  28          wincache_ucache_clear();
  29  
  30          parent::purge();
  31      }
  32  
  33      /**
  34      * Fetch an item from the cache
  35      *
  36      * @access protected
  37      * @param string $var Cache key
  38      * @return mixed Cached data
  39      */
  40  	function _read($var)
  41      {
  42          $success = false;
  43          $result = wincache_ucache_get($this->key_prefix . $var, $success);
  44  
  45          return ($success) ? $result : false;
  46      }
  47  
  48      /**
  49      * Store data in the cache
  50      *
  51      * @access protected
  52      * @param string $var Cache key
  53      * @param mixed $data Data to store
  54      * @param int $ttl Time-to-live of cached data
  55      * @return bool True if the operation succeeded
  56      */
  57  	function _write($var, $data, $ttl = 2592000)
  58      {
  59          return wincache_ucache_set($this->key_prefix . $var, $data, $ttl);
  60      }
  61  
  62      /**
  63      * Remove an item from the cache
  64      *
  65      * @access protected
  66      * @param string $var Cache key
  67      * @return bool True if the operation succeeded
  68      */
  69  	function _delete($var)
  70      {
  71          return wincache_ucache_delete($this->key_prefix . $var);
  72      }
  73  }


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1