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.
345 if (!$this->isActive()) {
348 throw new RuntimeException(self::MSG);
351 return $this->global_cache->delete($key);
◆ exists()
ilGlobalCache::exists |
( |
|
$key | ) |
|
- Parameters
-
- Exceptions
-
- Returns
- bool
Definition at line 286 of file class.ilGlobalCache.php.
287 if (!$this->global_cache->isActive()) {
291 return $this->global_cache->exists($key);
◆ flush()
ilGlobalCache::flush |
( |
|
$complete = false | ) |
|
- Parameters
-
- Returns
- bool
- Exceptions
-
Definition at line 361 of file class.ilGlobalCache.php.
362 if ($this->global_cache->isActive()) {
364 return $this->global_cache->flush();
366 $this->global_cache->setInvalid();
◆ generateServiceId()
static ilGlobalCache::generateServiceId |
( |
| ) |
|
|
staticprotected |
- Returns
- string
Definition at line 130 of file class.ilGlobalCache.php.
131 if (!isset(self::$unique_service_id)) {
132 self::$unique_service_id = substr(md5(
'il_' . CLIENT_ID), 0, 6);
135 return self::$unique_service_id;
◆ get()
ilGlobalCache::get |
( |
|
$key | ) |
|
- Parameters
-
- Exceptions
-
- Returns
- mixed
Definition at line 319 of file class.ilGlobalCache.php.
320 if (!$this->isActive()) {
323 $unserialized_return = $this->global_cache->unserialize($this->global_cache->get($key));
324 if ($unserialized_return) {
326 if ($this->global_cache->isValid($key)) {
328 return $unserialized_return;
◆ 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.
276 return $this->global_cache->getInstallationFailureReason();
◆ getInstance()
static ilGlobalCache::getInstance |
( |
|
$component | ) |
|
|
static |
- Parameters
-
- Returns
- ilGlobalCache
Definition at line 115 of file class.ilGlobalCache.php.
References $component, and $service_type.
Referenced by ilGlobalCacheDBLayer\__construct(), ilCachedCtrl\__construct(), ilCachedComponentData\__construct(), ilCachedComponentData\__destruct(), ilCachedCtrl\flush(), ilCachedComponentData\flush(), ilGlobalCacheQueryWrapper\get(), ilCachedCtrl\getInstance(), ilCachedComponentData\getInstance(), ilAppEventHandler\initListeners(), ilCachedCtrl\isActive(), and ilObjectDefinition\readDefinitionData().
120 self::$instances[
$component] = $ilGlobalCache;
◆ getServiceid()
ilGlobalCache::getServiceid |
( |
| ) |
|
◆ getServiceType()
ilGlobalCache::getServiceType |
( |
| ) |
|
◆ isCacheServiceInstallable()
ilGlobalCache::isCacheServiceInstallable |
( |
| ) |
|
◆ isInstallable()
ilGlobalCache::isInstallable |
( |
| ) |
|
◆ isValid()
ilGlobalCache::isValid |
( |
|
$key | ) |
|
◆ lookupServiceName()
static ilGlobalCache::lookupServiceName |
( |
|
$type_id | ) |
|
|
staticprotected |
- Parameters
-
- Returns
- string
Definition at line 201 of file class.ilGlobalCache.php.
References getActive().
206 case self::TYPE_MEMCACHED:
209 case self::TYPE_XCACHE:
213 return 'ilStaticCache';
◆ set()
ilGlobalCache::set |
( |
|
$key, |
|
|
|
$value, |
|
|
|
$ttl = NULL |
|
) |
| |
- Parameters
-
- Exceptions
-
- Returns
- bool
Definition at line 303 of file class.ilGlobalCache.php.
304 if (!$this->isActive()) {
307 $this->global_cache->setValid($key);
309 return $this->global_cache->set($key, $this->global_cache->serialize($value), $ttl);
◆ 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: