ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilShm.php
Go to the documentation of this file.
1<?php
2
3require_once('./Services/GlobalCache/classes/class.ilGlobalCacheService.php');
4
14
18 protected static $shm_id = NULL;
22 protected static $block_size = 0;
23
24
28 protected function getActive() {
29 self::$active = function_exists('shmop_open');
30 }
31
32
36 protected function getInstallable() {
37 return false;
38 self::$active = function_exists('shmop_open');
39 }
40
41
47 parent::__construct($service_id, $component);
48 self::$shm_id = shmop_open(0xff3, "c", 0644, 100);
49 self::$block_size = shmop_size(self::$shm_id);
50 }
51
52
58 public function exists($key) {
59 return shm_has_var(self::$shm_id, $key);
60 }
61
62
70 public function set($key, $serialized_value, $ttl = NULL) {
71 return shmop_write(self::$shm_id, $key, $serialized_value);
72 }
73
74
80 public function get($key) {
81 return shmop_read(self::$shm_id, 0, self::$block_size);
82 }
83
84
90 public function delete($key) {
91 return shm_remove_var(self::$shm_id, $key);
92 }
93
94
98 public function flush() {
99 shmop_delete(self::$id);
100
101 return true;
102 }
103
104
110 public function serialize($value) {
111 return serialize($value);
112 }
113
114
120 public function unserialize($serialized_value) {
121 return unserialize($serialized_value);
122 }
123}
124
125?>
Class ilGlobalCacheService.
Class ilShm.
Definition: class.ilShm.php:13
__construct($service_id, $component)
Definition: class.ilShm.php:46
unserialize($serialized_value)
serialize($value)
getActive()
@description set self::$active
Definition: class.ilShm.php:28
getInstallable()
@description set self::$installable
Definition: class.ilShm.php:36
static $shm_id
Definition: class.ilShm.php:18
exists($key)
Definition: class.ilShm.php:58
static $block_size
Definition: class.ilShm.php:22