Skip to content
Snippets Groups Projects
Commit d5d3b5ac authored by efalcy's avatar efalcy
Browse files

Merge branch 'hotline_cache_key_force_string' into 'master'

add function getAllCacheKeys() an cache volatile

See merge request !64
parents fa8c81af cf93aa1d
1 merge request!64add function getAllCacheKeys() an cache volatile
Pipeline #43053 passed with stage
in 48 seconds
<?php <?php
/* /*
STORM is under the MIT License (MIT) STORM is under the MIT License (MIT)
Copyright (c) 2010-2011 Agence Française Informatique http://www.afi-sa.fr Copyright (c) 2010-2011 Agence Française Informatique http://www.afi-sa.fr
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software. all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
*/ */
...@@ -31,11 +31,13 @@ class Storm_Cache_Volatile { ...@@ -31,11 +31,13 @@ class Storm_Cache_Volatile {
return $this->test($key) ? $this->_cache[$key] : false; return $this->test($key) ? $this->_cache[$key] : false;
} }
public function save($data, $key){ public function save($data, $key){
$this->_cache[$key] = $data; $this->_cache[$key] = $data;
return true; return true;
} }
public function remove($key) { public function remove($key) {
if (!$this->test($key)) if (!$this->test($key))
return false; return false;
...@@ -44,18 +46,24 @@ class Storm_Cache_Volatile { ...@@ -44,18 +46,24 @@ class Storm_Cache_Volatile {
return true; return true;
} }
public function test($key) { public function test($key) {
return array_key_exists($key, $this->_cache); return array_key_exists($key, $this->_cache);
} }
public function getOption($name) { public function getOption($name) {
return 0; return 0;
} }
public function clean() { public function clean() {
$this->_cache = []; $this->_cache = [];
return true; return true;
} }
}
?>
\ No newline at end of file public function getAllCacheKeys() :array {
return array_keys($this->_cache);
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment