[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/phpbb/cache/driver/ -> apc.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 APC
  18  */
  19  class apc extends \phpbb\cache\driver\memory
  20  {
  21      var $extension = 'apc';
  22  
  23      /**
  24      * {@inheritDoc}
  25      */
  26  	function purge()
  27      {
  28          apc_clear_cache('user');
  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          return apc_fetch($this->key_prefix . $var);
  43      }
  44  
  45      /**
  46      * Store data in the cache
  47      *
  48      * @access protected
  49      * @param string $var Cache key
  50      * @param mixed $data Data to store
  51      * @param int $ttl Time-to-live of cached data
  52      * @return bool True if the operation succeeded
  53      */
  54  	function _write($var, $data, $ttl = 2592000)
  55      {
  56          return apc_store($this->key_prefix . $var, $data, $ttl);
  57      }
  58  
  59      /**
  60      * Remove an item from the cache
  61      *
  62      * @access protected
  63      * @param string $var Cache key
  64      * @return bool True if the operation succeeded
  65      */
  66  	function _delete($var)
  67      {
  68          return apc_delete($this->key_prefix . $var);
  69      }
  70  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1