Class ilGlobalCache.
More...
◆ __construct()
ilGlobalCache::__construct |
( |
|
$service_type_id, |
|
|
|
$component = NULL |
|
) |
| |
|
protected |
◆ delete()
ilGlobalCache::delete |
( |
|
$key | ) |
|
- Parameters
-
- Exceptions
-
- Returns
- bool
Definition at line 344 of file class.ilGlobalCache.php.
344 {
345 if (!$this->isActive()) {
346
347 return false;
348 throw new RuntimeException(self::MSG);
349 }
350
351 return $this->global_cache->delete($key);
352 }
◆ exists()
ilGlobalCache::exists |
( |
|
$key | ) |
|
- Parameters
-
- Exceptions
-
- Returns
- bool
Definition at line 286 of file class.ilGlobalCache.php.
286 {
287 if (!$this->global_cache->isActive()) {
288 return false;
289 }
290
291 return $this->global_cache->exists($key);
292 }
◆ flush()
ilGlobalCache::flush |
( |
|
$complete = false | ) |
|
- Parameters
-
- Returns
- bool
- Exceptions
-
Definition at line 361 of file class.ilGlobalCache.php.
361 {
362 if ($this->global_cache->isActive()) {
363 if ($complete) {
364 return $this->global_cache->flush();
365 } else {
366 $this->global_cache->setInvalid();
367 }
368 }
369
370 return false;
371 }
◆ generateServiceId()
static ilGlobalCache::generateServiceId |
( |
| ) |
|
|
staticprotected |
- Returns
- string
Definition at line 130 of file class.ilGlobalCache.php.
130 {
131 if (!isset(self::$unique_service_id)) {
132 self::$unique_service_id = substr(md5('il_' . CLIENT_ID), 0, 6);
133 }
134
136 }
static $unique_service_id
References $unique_service_id.
◆ get()
ilGlobalCache::get |
( |
|
$key | ) |
|
- Parameters
-
- Exceptions
-
- Returns
- mixed
Definition at line 319 of file class.ilGlobalCache.php.
319 {
320 if (!$this->isActive()) {
321 return false;
322 }
323 $unserialized_return = $this->global_cache->unserialize($this->global_cache->get($key));
324 if ($unserialized_return) {
325
326 if ($this->global_cache->isValid($key)) {
327
328 return $unserialized_return;
329 } else {
330
331 }
332 }
333
334 return NULL;
335 }
◆ getActive()
ilGlobalCache::getActive |
( |
| ) |
|
◆ getAllInstallableTypes()
static ilGlobalCache::getAllInstallableTypes |
( |
| ) |
|
|
static |
◆ getAllTypes()
static ilGlobalCache::getAllTypes |
( |
| ) |
|
|
static |
◆ getComponent()
ilGlobalCache::getComponent |
( |
| ) |
|
◆ getInfo()
ilGlobalCache::getInfo |
( |
| ) |
|
◆ getInstallationFailureReason()
ilGlobalCache::getInstallationFailureReason |
( |
| ) |
|
- Returns
- string
Definition at line 275 of file class.ilGlobalCache.php.
275 {
276 return $this->global_cache->getInstallationFailureReason();
277 }
◆ getInstance()
static ilGlobalCache::getInstance |
( |
|
$component | ) |
|
|
static |
- Parameters
-
- Returns
- ilGlobalCache
Definition at line 115 of file class.ilGlobalCache.php.
115 {
119
120 self::$instances[
$component] = $ilGlobalCache;
121 }
122
124 }
References $component, and $service_type.
Referenced by ilGlobalCacheDBLayer\__construct(), ilCachedComponentData\__construct(), ilCachedCtrl\__construct(), ilCachedComponentData\__destruct(), ilCachedComponentData\flush(), ilCachedCtrl\flush(), ilGlobalCacheQueryWrapper\get(), ilCachedComponentData\getInstance(), ilCachedCtrl\getInstance(), ilAppEventHandler\initListeners(), ilCachedCtrl\isActive(), and ilObjectDefinition\readDefinitionData().
◆ getServiceid()
ilGlobalCache::getServiceid |
( |
| ) |
|
◆ getServiceType()
ilGlobalCache::getServiceType |
( |
| ) |
|
◆ isCacheServiceInstallable()
ilGlobalCache::isCacheServiceInstallable |
( |
| ) |
|
◆ isInstallable()
ilGlobalCache::isInstallable |
( |
| ) |
|
- Returns
- bool
Definition at line 259 of file class.ilGlobalCache.php.
259 {
260 return count(self::getAllInstallableTypes()) > 0;
261 }
◆ isValid()
ilGlobalCache::isValid |
( |
|
$key | ) |
|
- Parameters
-
- Returns
- bool
Definition at line 251 of file class.ilGlobalCache.php.
251 {
252 return $this->global_cache->isValid($key);
253 }
◆ lookupServiceName()
static ilGlobalCache::lookupServiceName |
( |
|
$type_id | ) |
|
|
staticprotected |
◆ set()
ilGlobalCache::set |
( |
|
$key, |
|
|
|
$value, |
|
|
|
$ttl = NULL |
|
) |
| |
- Parameters
-
- Exceptions
-
- Returns
- bool
Definition at line 303 of file class.ilGlobalCache.php.
303 {
304 if (!$this->isActive()) {
305 return false;
306 }
307 $this->global_cache->setValid($key);
308
309 return $this->global_cache->set($key, $this->global_cache->serialize($value), $ttl);
310 }
◆ setActive()
ilGlobalCache::setActive |
( |
|
$active | ) |
|
◆ setComponent()
ilGlobalCache::setComponent |
( |
|
$component | ) |
|
◆ setServiceid()
ilGlobalCache::setServiceid |
( |
|
$service_id | ) |
|
◆ setServiceType()
ilGlobalCache::setServiceType |
( |
|
$service_type | ) |
|
◆ $active
ilGlobalCache::$active = true |
|
protected |
◆ $active_components
ilGlobalCache::$active_components |
|
staticprotected |
Initial value:= array(
self::COMP_CLNG,
self::COMP_OBJ_DEF,
self::COMP_ILCTRL,
self::COMP_COMPONENT,
self::COMP_TEMPLATE,
self::COMP_EVENTS,
)
Definition at line 42 of file class.ilGlobalCache.php.
◆ $component
ilGlobalCache::$component |
|
protected |
◆ $global_cache
ilGlobalCache::$global_cache |
|
protected |
◆ $instances
ilGlobalCache::$instances |
|
staticprotected |
◆ $service_id
ilGlobalCache::$service_id = '' |
|
protected |
◆ $service_type
◆ $type_per_component
ilGlobalCache::$type_per_component = array() |
|
staticprotected |
◆ $types
◆ $unique_service_id
ilGlobalCache::$unique_service_id = NULL |
|
staticprotected |
◆ ACTIVE
const ilGlobalCache::ACTIVE = true |
◆ COMP_CLNG
const ilGlobalCache::COMP_CLNG = 'clng' |
◆ COMP_COMPONENT
const ilGlobalCache::COMP_COMPONENT = 'comp' |
◆ COMP_EVENTS
const ilGlobalCache::COMP_EVENTS = 'events' |
◆ COMP_ILCTRL
const ilGlobalCache::COMP_ILCTRL = 'ilctrl' |
◆ COMP_OBJ_DEF
const ilGlobalCache::COMP_OBJ_DEF = 'obj_def' |
◆ COMP_PLUGINS
const ilGlobalCache::COMP_PLUGINS = 'plugins' |
◆ COMP_RBAC_UA
const ilGlobalCache::COMP_RBAC_UA = 'rbac_ua' |
◆ COMP_TEMPLATE
const ilGlobalCache::COMP_TEMPLATE = 'tpl' |
◆ MSG
const ilGlobalCache::MSG = 'Global Cache not active, can not access cache' |
◆ TYPE_APC
const ilGlobalCache::TYPE_APC = 3 |
◆ TYPE_FALLBACK
const ilGlobalCache::TYPE_FALLBACK = self::TYPE_STATIC |
◆ TYPE_MEMCACHED
const ilGlobalCache::TYPE_MEMCACHED = 2 |
◆ TYPE_STATIC
const ilGlobalCache::TYPE_STATIC = 0 |
◆ TYPE_XCACHE
const ilGlobalCache::TYPE_XCACHE = 1 |
The documentation for this class was generated from the following file: