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 / Eaccelerator.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  2.5 KB  |  95 lines

  1. <?php
  2. /**
  3. *
  4. * The eAccelerator 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 eAccelerator 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_Eaccelerator
  43.  
  44. class System_SharedMemory_Eaccelerator extends System_SharedMemory_Common
  45. {
  46.     // {{{ get()
  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 eaccelerator_get($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.          eaccelerator_lock($name);
  75.          return eaccelerator_put ($name, $value, $ttl);
  76.      }
  77.      // }}}
  78.     // {{{ rm()
  79.  
  80.     /**
  81.      * remove variable from memory
  82.      *
  83.      * @param string $name  name of the variable
  84.      *
  85.      * @return bool true on success
  86.      * @access public
  87.      */
  88.      function rm($name)
  89.      {
  90.          return eaccelerator_rm($name);
  91.      }
  92.      // }}}
  93. }
  94. // }}}
  95. ?>