root/eaccelerator/trunk/doc/php/shared_memory.php
| Revision 265, 2.6 kB (checked in by hans, 2 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | <?php |
| 2 | /* |
| 3 | * This file is a file with dummy php function to document the functions in |
| 4 | * the eAccelerator extension. |
| 5 | */ |
| 6 | |
| 7 | /** |
| 8 | * eAccelerator shared memory access. |
| 9 | * eAccelerator can be used to store data in shared memory and share this |
| 10 | * between script. This can be used instead of the php shm or shmop API. |
| 11 | * These functions can be enabled with --with-eaccelerator-shared-memory |
| 12 | * at compile time |
| 13 | * |
| 14 | * @package eAccelerator |
| 15 | */ |
| 16 | |
| 17 | /** |
| 18 | * Put key. |
| 19 | * Put key in the eaccelerator shared memory. |
| 20 | * eAccelerator doesn't serialize object, so you need to do it you're self or |
| 21 | * php will segfault on object retrieval. |
| 22 | * |
| 23 | * @param string The key to identify the data |
| 24 | * @param mixed The data to store in shared memory |
| 25 | * @param int Cache the key for $ttl seconds, 0 for never |
| 26 | * @return boolean Returns true if the function was succesfull otherwise it |
| 27 | * will return false. When false is returned, this could mean the limit of |
| 28 | * the total cache is exceeded or the size of the data is to big for the |
| 29 | * eaccelerator.shm_max directive. |
| 30 | * @see eaccelerator_get() |
| 31 | * @see eaccelerator_rm() |
| 32 | */ |
| 33 | function eaccelerator_put ($key, $value, $ttl = 0) {} |
| 34 | |
| 35 | /** |
| 36 | * Get data. |
| 37 | * Get data from shared memory. Object need to be serialized when storing them |
| 38 | * so unserializing is necessary when retrieving them. |
| 39 | * |
| 40 | * @param string The key to identify the data |
| 41 | * @return mixed Returns the requested data on succes otherwise NULL if the key doesn't exist or the key was expired. |
| 42 | * @see eaccelerator_put() |
| 43 | */ |
| 44 | function eaccelerator_get ($key) {} |
| 45 | |
| 46 | /** |
| 47 | * Remove key. |
| 48 | * Remove key from shared memory |
| 49 | * |
| 50 | * @param string The key to identify the data |
| 51 | * @return boolean Return true on success and false on failure |
| 52 | * @see eaccelerator_put() |
| 53 | */ |
| 54 | function eaccelerator_rm ($key) {} |
| 55 | |
| 56 | /** |
| 57 | * Garbage collection. |
| 58 | * Removes expired keys (session data and content) from shared memory |
| 59 | */ |
| 60 | function eaccelerator_gc () {} |
| 61 | |
| 62 | /** |
| 63 | * Lock. |
| 64 | * Create a lock with the given key, this allows you to prevent concurrent |
| 65 | * access to some part of your code. Warning, you don't need this to lock the |
| 66 | * keys used with eaccelerator_get and eaccelerator_put. The lock can be |
| 67 | * released with eaccelerator_unlock or automatic at the end of the request. |
| 68 | * |
| 69 | * @param string The key to identify the data to lock |
| 70 | * @return boolean Return true on success and false on failure |
| 71 | * @see eaccelerator_unlock() |
| 72 | * @example eaccelerator_lock.php Lock example |
| 73 | */ |
| 74 | function eaccelerator_lock ($key) {} |
| 75 | |
| 76 | /** |
| 77 | * Unlock. |
| 78 | * Unlock the access to a key |
| 79 | * |
| 80 | * @param string The key to identify the data to lock |
| 81 | * @return boolean Return true on success and false on failure |
| 82 | * @see eaccelerator_lock() |
| 83 | */ |
| 84 | function eaccelerator_unlock ($key) {} |
| 85 | |
| 86 | ?> |
| 87 |
Note: See TracBrowser for help on using the browser.