| @@ 107-114 (lines=8) @@ | ||
| 104 | * @param mixed $new |
|
| 105 | * @return bool |
|
| 106 | */ |
|
| 107 | public function cas($key, $old, $new) { |
|
| 108 | // apc only does cas for ints |
|
| 109 | if (is_int($old) and is_int($new)) { |
|
| 110 | return apc_cas($this->getPrefix() . $key, $old, $new); |
|
| 111 | } else { |
|
| 112 | return $this->casEmulated($key, $old, $new); |
|
| 113 | } |
|
| 114 | } |
|
| 115 | ||
| 116 | static public function isAvailable() { |
|
| 117 | if (!extension_loaded('apc')) { |
|
| @@ 112-119 (lines=8) @@ | ||
| 109 | * @param mixed $new |
|
| 110 | * @return bool |
|
| 111 | */ |
|
| 112 | public function cas($key, $old, $new) { |
|
| 113 | // apc only does cas for ints |
|
| 114 | if (is_int($old) and is_int($new)) { |
|
| 115 | return apcu_cas($this->getPrefix() . $key, $old, $new); |
|
| 116 | } else { |
|
| 117 | return $this->casEmulated($key, $old, $new); |
|
| 118 | } |
|
| 119 | } |
|
| 120 | ||
| 121 | /** |
|
| 122 | * @return bool |
|