2require_once(
'./Services/GlobalCache/classes/Memcache/class.ilMemcache.php');
 
    3require_once(
'./Services/GlobalCache/classes/Xcache/class.ilXcache.php');
 
    4require_once(
'./Services/GlobalCache/classes/Apc/class.ilApc.php');
 
    5require_once(
'./Services/GlobalCache/classes/Static/class.ilStaticCache.php');
 
    6require_once(
'Settings/class.ilGlobalCacheSettings.php');
 
   16        const MSG = 
'Global Cache not active, can not access cache';
 
   55                self::COMP_TPL_BLOCKS,
 
   56                self::COMP_TPL_VARIABLES,
 
  112                        $ilGlobalCache->initCachingService();
 
  114                        self::$instances[
$component] = $ilGlobalCache;
 
  131        protected function initCachingService() {
 
  139                $ilGlobalCacheService = 
new $serviceName(self::$unique_service_id, $this->
getComponent());
 
  141                $this->global_cache = $ilGlobalCacheService;
 
  158        public static function log($message, $log_level) {
 
  159                if ($log_level <= self::getSettings()->getLogLevel()) {
 
  161                        $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
 
  162                        $function = $backtrace[1][
'function'];
 
  163                        $class = $backtrace[1][
'class'];
 
  165                                $ilLog->write($class . 
'::' . $function . 
'(): ' . $message);
 
  175                if (! isset(self::$unique_service_id)) {
 
  176                        self::$unique_service_id = substr(md5(
'il_' . CLIENT_ID), 0, 6);
 
  181        public static function flushAll() {
 
  186                foreach (self::$types as $type) {
 
  188                        $service = 
new $serviceName(self::generateServiceId(), 
'flush');
 
  189                        if ($service->isActive()) {
 
  191                                $returned = $service->flush();
 
  203                foreach (self::getAllTypes() as $type) {
 
  204                        if ($type->isCacheServiceInstallable()) {
 
  218                foreach (self::$types as $type) {
 
  219                        $obj = 
new self($type);
 
  220                        $obj->initCachingService();
 
  245                                return 'ilStaticCache';
 
  261                if (self::$active_cache[$this->
getComponent()] !== NULL) {
 
  264                if (! self::ACTIVE) {
 
  276                $isActive = $this->global_cache->isActive();
 
  291                return $this->global_cache->isValid($key);
 
  299                return count(self::getAllInstallableTypes()) > 0;
 
  307                return $this->global_cache->isInstallable();
 
  315                return $this->global_cache->getInstallationFailureReason();
 
  326                if (! $this->global_cache->isActive()) {
 
  330                return $this->global_cache->exists($key);
 
  342        public function set($key, $value, $ttl = NULL) {
 
  347                $this->global_cache->setValid($key);
 
  349                return $this->global_cache->set($key, $this->global_cache->serialize($value), $ttl);
 
  359        public function get($key) {
 
  363                $unserialized_return = $this->global_cache->unserialize($this->global_cache->get($key));
 
  364                if ($unserialized_return) {
 
  366                        if ($this->global_cache->isValid($key)) {
 
  369                                return $unserialized_return;
 
  384        public function delete($key) {
 
  389                return $this->global_cache->delete($key);
 
  399        public function flush($complete = 
false) {
 
  400                if ($this->global_cache->isActive()) {
 
  402                                return $this->global_cache->flush();
 
  404                                $this->global_cache->setInvalid();
 
  413                return $this->global_cache->getInfo();
 
  465                        return $this->global_cache->getServiceType();
 
Class ilGlobalCacheService.
Class ilGlobalCacheSettings.
setServiceType($service_type)
static setSettings($settings)
static $active_components
getInstallationFailureReason()
static setAvailableComponents($available_components)
static $available_components
isCacheServiceInstallable()
static setup(ilGlobalCacheSettings $ilGlobalCacheSettings)
static lookupServiceClassName($service_type)
static getAllInstallableTypes()
static setActiveComponents($active_components)
static getActiveComponents()
static $unique_service_id
static log($message, $log_level)
__construct($service_type)
static $type_per_component
static getAvailableComponents()
static getInstance($component)
static generateServiceId()