3declare(strict_types=1);
22require_once
"./Services/GlobalCache/classes/class.ilGlobalCache.php";
58 return $this->global_cache->isActive();
66 if ($this->global_cache->isActive()) {
80 if ($this->global_cache->isActive()) {
93 if ($this->global_cache->isActive()) {
94 $this->global_cache->delete(
"translations_" . $this->
getLanguageKey());
107 $q =
'SELECT module, lang_array FROM lng_modules WHERE lang_key = %s';
109 $translations = array();
110 while ($set =
$ilDB->fetchObject(
$res)) {
112 $lang_array = unserialize($set->lang_array, [
'allowed_classes' =>
false]);
113 }
catch (Throwable $t) {
116 if (is_array($lang_array)) {
125 if (!isset(self::$instances[
$key])) {
126 self::$instances[
$key] =
new self(
$key);
129 return self::$instances[
$key];
134 if ($this->global_cache->isActive()) {
135 $this->global_cache->flush();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
readFromDB()
Read data from table lng_module from DB.
setLanguageKey(string $language_key)
Set language key.
ilGlobalCache $global_cache
isActive()
Return whether the global cache is active.
readFromCache()
Read from cache.
deleteInCache()
Delete the cache entry for this language without flushing the whole global cache Using this function ...
setTranslations(array $translations)
Set translations.
getTranslations()
Return translations as array.
writeToCache()
Write to global cache.
getLanguageKey()
Return language key.
__construct(string $language_key)
ilCachedLanguage constructor.
static getInstance(?string $component)