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 / System / SharedMemory / Apc.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  2.4 KB  |  93 lines

  1. <?php
  2. /**
  3. *
  4. * The APC driver for SharedMemory
  5. *
  6. * PHP versions 4 and 5
  7. *
  8. * LICENSE: This source file is subject to version 3.0 of the PHP license
  9. * that is available through the world-wide-web at the following URI:
  10. * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  11. * the PHP License and are unable to obtain it through the web, please
  12. * send a note to license@php.net so we can mail you a copy immediately.
  13. *
  14. * @category   System
  15. * @package    System_Sharedmemory
  16. * @author     Evgeny Stepanischev <bolk@lixil.ru>
  17. * @copyright  2005 Evgeny Stepanischev
  18. * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  19. * @version    CVS: $Id:$
  20. * @link       http://pear.php.net/package/System_SharedMemory
  21. */
  22.  
  23. /**
  24. *
  25. * The methods PEAR SharedMemory uses to interact with PHP's APC extension
  26. * for interacting with APC shared memory
  27. *
  28. * These methods overload the ones declared System_SharedMemory_Common
  29. *
  30. * @category   System
  31. * @package    System_Sharedmemory
  32. * @package    System_Sharedmemory
  33. * @author     Evgeny Stepanischev <bolk@lixil.ru>
  34. * @copyright  2005 Evgeny Stepanischev
  35. * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  36. * @version    CVS: $Id:$
  37. * @link       http://pear.php.net/package/System_SharedMemory
  38. */
  39.  
  40. require_once 'System/SharedMemory/Common.php';
  41.  
  42. // {{{ class System_SharedMemory_Apc
  43. class System_SharedMemory_Apc extends System_SharedMemory_Common
  44. {
  45.     // {{{ get()
  46.  
  47.     /**
  48.      * returns value of variable in shared mem
  49.      *
  50.      * @param string $name name of variable
  51.      *
  52.      * @return mixed value of the variable
  53.      * @access public
  54.      */
  55.      function get($name)
  56.      {
  57.          return apc_fetch($name);
  58.      }
  59.      // }}}
  60.      // {{{ set()
  61.  
  62.     /**
  63.      * set value of variable in shared mem
  64.      *
  65.      * @param string $name  name of the variable
  66.      * @param string $value value of the variable
  67.      * @param int $ttl (optional) time to life of the variable
  68.      *
  69.      * @return bool true on success
  70.      * @access public
  71.      */
  72.      function set($name, $value, $ttl = 0)
  73.      {
  74.          return apc_store($name, $value, $ttl);
  75.      }
  76.      // }}}
  77.      // {{{ rm()
  78.  
  79.     /**
  80.      * remove variable from memory
  81.      *
  82.      * @param string $name  name of the variable
  83.      *
  84.      * @return bool true on success
  85.      * @access public
  86.      */
  87.      function rm($name)
  88.      {
  89.          return apc_delete($name);
  90.      }
  91.      // }}}
  92. }
  93. ?>