ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilSetupLanguage Class Reference

language handling for setup More...

+ Inheritance diagram for ilSetupLanguage:
+ Collaboration diagram for ilSetupLanguage:

Public Member Functions

 __construct (string $a_lang_key, ?LanguageFileDirectoryManager $language_file_directory_manager=null, private readonly ?ilDBInterface $connection=null, private readonly TranslationCache $translation_cache=new NullTranslationCache(), private readonly ?LoggerInterface $logger=null, private readonly ?\Closure $client_data_dir_resolver=null,)
 
 setClientDataDir (?string $client_data_dir)
 null resets to the resolver of the constructor. More...
 
 getClientDataDir ()
 
 usesDefaultLanguageFileDirectories ()
 Such an instance (e.g. More...
 
 getLanguageFileDirectoryManager ()
 
 installLanguages (array $a_lang_keys, array $a_local_keys=[])
 install languages More...
 
 registerInstalledLanguage (string $lang_key, array $known_languages, array $local_language_keys)
 Single place for the object_data row ("installed" vs. More...
 
 getAvailableLanguagesForInstallation ()
 
 getInstallableLanguagesForInstallation ()
 
 checkLanguageForInstallation (string $lang_key)
 
 checkLocalLanguageFileForInstallation (string $lang_key)
 Unlike checkLanguageForInstallation(), a missing local file is not acceptable here. More...
 
 flushLanguageForInstallation (string $lang_key)
 
 flushLanguageForUninstallation (string $lang_key)
 
 getSkippedInvalidMarkupEntries ()
 
 getSkippedDuplicateEntries ()
 
 getSkippedUnreadableOverlays ()
 
 getOverlaysOfUnshippedModules ()
 
 getUnrecordedTakenOverModules ()
 
 insertLanguageForInstallation (string $lang_key)
 
 insertLanguageForApplyingLocalChanges (string $lang_key)
 See LanguageInstallationManager::insertLanguageForApplyingLocalChanges(). More...
 
 findUnwritableOverlayDirectories (array $lang_keys, ?int $for_user_id=null)
 File-based, needs no database (unlike manager()). More...
 
 hasMigratedModules (array $lang_keys)
 File-based, needs no database. More...
 
 getInstalledLanguages ()
 get already installed languages (in db) More...
 
 getInstalledLocalLanguages ()
 get already installed local languages (in db) More...
 
 getLocalChanges (string $a_lang_key, string $a_min_date="", string $a_max_date="")
 get locally changed language entries $a_lang_key language key $a_min_date minimum change date "yyyy-mm-dd hh:mm:ss" $a_max_date maximum change date "yyyy-mm-dd hh:mm:ss" Returned value [module][identifier] => value More...
 
 getLocalLanguages ()
 Searches for the existence of *.lang.local files. More...
 
 getInvalidLocalLanguageFiles (array $language_keys)
 Local language files that contain a requested key but do not match the naming scheme. More...
 
 getInstallableLanguages ()
 Return installable languages. More...
 
 setDbHandler (ilDBInterface $a_db_handler)
 Takes precedence over $GLOBALS['ilDB']. More...
 
 loadLanguageModule (string $a_module)
 Load language module. More...
 
- Public Member Functions inherited from ilLanguage
 __construct (string $a_lang_key, ?TranslationRepository $translations=null)
 Constructor read the single-language file and put this in an array text. More...
 
 getLangKey ()
 Return lang key. More...
 
 getDefaultLanguage ()
 Return default language. More...
 
 getTextDirection ()
 Return text direction. More...
 
 getContentLanguage ()
 Return content language. More...
 
 txtlng (string $a_module, string $a_topic, string $a_language)
 gets the text for a given topic in a given language if the topic is not in the list, the topic itself with "-" will be returned Another language than this one is always read via gettext (_lookupEntry()), never from the injected repository. More...
 
 txt (string|LanguageIdentifier $a_topic, ?int $n=null)
 gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be returned More...
 
 exists (string $a_topic)
 Check if language entry exists. More...
 
 loadLanguageModule (string $a_module)
 Load language module. More...
 
 getInstalledLanguages ()
 Get installed languages. More...
 
 getUsedTopics ()
 Return used topics. More...
 
 getUsedModules ()
 Return used modules. More...
 
 getUserLanguage ()
 Return language of user. More...
 
 getCustomLangPath ()
 
 toJS ($a_lang_key, ?ilGlobalTemplateInterface $a_tpl=null)
 Transfer text to Javascript. More...
 
 toJSMap (array $a_map, ?ilGlobalTemplateInterface $a_tpl=null)
 Transfer text to Javascript. More...
 
 __destruct ()
 destructor saves all language usages to db if log is enabled and ilDB exists More...
 
- Public Member Functions inherited from ILIAS\Language\Language
 txt (string|LanguageIdentifier $a_topic, ?int $n=null)
 $n selects a plural form, e.g. More...
 
 loadLanguageModule (string $a_module)
 
 getLangKey ()
 
 toJS ($key)
 

Static Public Member Functions

static _deleteLangData (string $a_lang_key, bool $a_keep_local_change)
 Delete languge data. More...
 
- Static Public Member Functions inherited from ilLanguage
static forgetInstalledLanguage (string $lang_key)
 $lang_key was uninstalled in this request: its migrated state is no longer served (see isInstalledLanguage()), More...
 
static invalidateMigratedLanguageFileCache (string $a_module, string $lang_key)
 Makes an overlay write (see MigratedLanguageFileSync) visible to the rest of the request. More...
 
static _getInstalledLanguages ()
 Get installed languages. More...
 
static _lookupEntry (string $a_lang_key, string $a_mod, string $a_id)
 
static lookupId (string $a_lang_key)
 Lookup obj_id of language. More...
 
static getFallbackInstance ()
 Builds a global default language instance. More...
 
static getGlobalInstance ()
 Builds the global language object. More...
 

Data Fields

array $text
 
string $lang_default = "en"
 
string $lang_key
 
string $separator = "#:#"
 
string $comment_separator = "###"
 
- Data Fields inherited from ilLanguage
ILIAS $ilias
 
array $text = []
 
string $lang_default
 
string $lang_user
 
string $lang_path
 
string $lang_key
 
string $lang_name
 
string $separator = "#:#"
 
string $comment_separator = "###"
 
array $loaded_modules = array()
 

Protected Member Functions

 checkLanguage (string $a_lang_key)
 validate the logical structure of a lang-file More...
 

Protected Attributes

ilDBInterface $db = null
 
- Protected Attributes inherited from ilLanguage
array $migrated_key_modules = []
 
array $cached_modules = array()
 
array $map_modules_txt = array()
 
bool $usage_log_enabled = false
 
string $cust_lang_path
 
ilLogger $log
 
ilCachedLanguage $global_cache
 

Private Member Functions

 db ()
 Resolved per call, so a later setDbHandler() takes effect. More...
 
 repository ()
 Without a database only the file-based methods work. More...
 
 manager ()
 Kept across calls because the manager collects getSkippedInvalidMarkupEntries() over a run; rebuilt only when db() changes. More...
 

Private Attributes

string $absolute_path
 
string $client_data_dir = null
 
readonly bool $uses_default_language_file_directories
 
readonly LanguageFileDirectoryManager $language_file_directory_manager
 
LanguageInstallationManager $manager = null
 
ilDBInterface $manager_db = null
 

Additional Inherited Members

- Static Protected Member Functions inherited from ilLanguage
static logUsage (string $a_module, string $a_identifier)
 saves tupel of language module and identifier More...
 
static isUsageLogEnabled ()
 checks if language usage log is enabled you need MySQL to use this function this function is automatically enabled if DEVMODE is on this function is also enabled if language_log is 1 More...
 
- Static Protected Attributes inherited from ilLanguage
static array $used_topics = array()
 
static array $used_modules = array()
 
static array $lng_log = array()
 

Detailed Description

language handling for setup

this class offers the language handling for an application. the constructor is called with a small language abbreviation e.g. $lng = new Language("en"); the constructor reads the single-languagefile en.lang and puts this into an array. with e.g. $lng->txt("user_updated"); you can translate a lang-topic into the actual language

Author
Peter Gabriel pgabr.nosp@m.iel@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$

Language implementation for Setup (txt() before the runtime DIC exists). Installation is delegated to \ILIAS\Language\Setup\InstalledLanguageRepository (read) and LanguageInstallationManager (write); kept as entry point for callers not wired through Language.php.

Definition at line 53 of file class.ilSetupLanguage.php.

Constructor & Destructor Documentation

◆ __construct()

ilSetupLanguage::__construct ( string  $a_lang_key,
?LanguageFileDirectoryManager  $language_file_directory_manager = null,
private readonly ?ilDBInterface  $connection = null,
private readonly TranslationCache  $translation_cache = new NullTranslationCache(),
private readonly ?LoggerInterface  $logger = null,
private readonly ?\Closure  $client_data_dir_resolver = null 
)
Parameters
LanguageFileDirectoryManager | null$language_file_directory_managerdirectories contributed through the component graph; without it only main lang/ and customizing are known (usesDefaultLanguageFileDirectories())
ilDBInterface | null$connectionnone for callers outside the component graph
LoggerInterface | null$loggerfor the installation manager's warnings; none in the Setup (PHP error log then)
(

Closure():?string)|null $client_data_dir_resolver without it, MigratedLanguageFilePaths::resolveClientDataDir() is used

Definition at line 75 of file class.ilSetupLanguage.php.

82 {
83 $this->lang_key = $a_lang_key ?: $this->lang_default;
84 $this->absolute_path = (string) realpath(__DIR__ . "/../../../../../");
85 $this->uses_default_language_file_directories = $language_file_directory_manager === null;
86 $this->language_file_directory_manager = $language_file_directory_manager ?? new LanguageFileDirectoryManager(
89 );
90 $this->cust_lang_path = $this->absolute_path . "/lang/customizing";
91 $this->lang_path = $this->absolute_path . "/lang";
92 }
readonly LanguageFileDirectoryManager $language_file_directory_manager

References $lang_default, and $language_file_directory_manager.

Member Function Documentation

◆ _deleteLangData()

static ilSetupLanguage::_deleteLangData ( string  $a_lang_key,
bool  $a_keep_local_change 
)
static

Delete languge data.

$a_lang_key lang key

Definition at line 406 of file class.ilSetupLanguage.php.

406 : void
407 {
408 global $ilDB;
409
410 if (!$a_keep_local_change) {
411 $ilDB->manipulate("DELETE FROM lng_data WHERE lang_key = " .
412 $ilDB->quote($a_lang_key, "text"));
413 } else {
414 $ilDB->manipulate("DELETE FROM lng_data WHERE lang_key = " .
415 $ilDB->quote($a_lang_key, "text") .
416 " AND local_change IS NULL");
417 }
418 }

References $ilDB.

◆ checkLanguage()

ilSetupLanguage::checkLanguage ( string  $a_lang_key)
protected

validate the logical structure of a lang-file

This function checks if a lang-file of a given lang_key exists, the file has a header, and each lang-entry consists of exactly three elements (module, identifier, value).

$a_lang_key international language key (2 digits)

Definition at line 396 of file class.ilSetupLanguage.php.

396 : bool
397 {
398 return $this->repository()->checkLanguage($a_lang_key);
399 }
repository()
Without a database only the file-based methods work.

References ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ checkLanguageForInstallation()

ilSetupLanguage::checkLanguageForInstallation ( string  $lang_key)

Definition at line 253 of file class.ilSetupLanguage.php.

253 : bool
254 {
255 return $this->repository()->checkLanguage($lang_key);
256 }

References ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ checkLocalLanguageFileForInstallation()

ilSetupLanguage::checkLocalLanguageFileForInstallation ( string  $lang_key)

Unlike checkLanguageForInstallation(), a missing local file is not acceptable here.

Definition at line 261 of file class.ilSetupLanguage.php.

261 : bool
262 {
263 return $this->repository()->checkLocalLanguageFile($lang_key);
264 }

References ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ db()

ilSetupLanguage::db ( )
private

Resolved per call, so a later setDbHandler() takes effect.

Order: setDbHandler(), constructor connection, $GLOBALS['ilDB'].

Definition at line 98 of file class.ilSetupLanguage.php.

99 {
100 return $this->db ?? $this->connection ?? $GLOBALS["ilDB"] ?? null;
101 }
db()
Resolved per call, so a later setDbHandler() takes effect.
Interface ilDBInterface.
$GLOBALS["DIC"]
Definition: wac.php:66

References $GLOBALS, and db().

Referenced by db(), manager(), and repository().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findUnwritableOverlayDirectories()

ilSetupLanguage::findUnwritableOverlayDirectories ( array  $lang_keys,
?int  $for_user_id = null 
)

File-based, needs no database (unlike manager()).

Parameters
list<string>$lang_keys
int | null$for_user_idevaluate the writability for this user instead of the current process
Returns
list<string>

Definition at line 346 of file class.ilSetupLanguage.php.

346 : array
347 {
348 return MigratedLanguageFileSync::findUnwritableOverlayDirectories(
349 $this->language_file_directory_manager,
350 $this->absolute_path,
351 $lang_keys,
352 $this->getClientDataDir(),
353 $for_user_id
354 );
355 }

◆ flushLanguageForInstallation()

ilSetupLanguage::flushLanguageForInstallation ( string  $lang_key)

Definition at line 266 of file class.ilSetupLanguage.php.

266 : void
267 {
268 $this->manager()->flushLanguageForInstallation($lang_key);
269 }
manager()
Kept across calls because the manager collects getSkippedInvalidMarkupEntries() over a run; rebuilt o...

◆ flushLanguageForUninstallation()

ilSetupLanguage::flushLanguageForUninstallation ( string  $lang_key)

Definition at line 271 of file class.ilSetupLanguage.php.

271 : void
272 {
273 $this->manager()->flushLanguageForUninstallation($lang_key);
274 }

◆ getAvailableLanguagesForInstallation()

ilSetupLanguage::getAvailableLanguagesForInstallation ( )

Definition at line 240 of file class.ilSetupLanguage.php.

240 : array
241 {
242 return $this->repository()->getAvailableLanguages();
243 }

References ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ getClientDataDir()

ilSetupLanguage::getClientDataDir ( )

Definition at line 146 of file class.ilSetupLanguage.php.

146 : ?string
147 {
148 if ($this->client_data_dir !== null) {
150 }
151 if ($this->client_data_dir_resolver !== null) {
152 return ($this->client_data_dir_resolver)();
153 }
154 return MigratedLanguageFilePaths::resolveClientDataDir($this->absolute_path);
155 }

References $client_data_dir.

Referenced by manager().

+ Here is the caller graph for this function:

◆ getInstallableLanguages()

ilSetupLanguage::getInstallableLanguages ( )

Return installable languages.

Definition at line 455 of file class.ilSetupLanguage.php.

455 : array
456 {
457 return $this->repository()->getInstallableLanguages();
458 }

References ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ getInstallableLanguagesForInstallation()

ilSetupLanguage::getInstallableLanguagesForInstallation ( )
Returns
list<string> the keys with a main language file

Definition at line 248 of file class.ilSetupLanguage.php.

248 : array
249 {
250 return array_values($this->repository()->getInstallableLanguages());
251 }
getInstallableLanguages()
Return installable languages.

References ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ getInstalledLanguages()

ilSetupLanguage::getInstalledLanguages ( )

get already installed languages (in db)

Reimplemented from ilLanguage.

Definition at line 374 of file class.ilSetupLanguage.php.

374 : array
375 {
376 return $this->repository()->getInstalledLanguages();
377 }

References ILIAS\UI\examples\Deck\repository().

Referenced by ilSetupLanguageTest\databaseMethods().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInstalledLocalLanguages()

ilSetupLanguage::getInstalledLocalLanguages ( )

get already installed local languages (in db)

Definition at line 382 of file class.ilSetupLanguage.php.

382 : array
383 {
384 return $this->repository()->getInstalledLocalLanguages();
385 }

References ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ getInvalidLocalLanguageFiles()

ilSetupLanguage::getInvalidLocalLanguageFiles ( array  $language_keys)

Local language files that contain a requested key but do not match the naming scheme.

Parameters
list<string>$language_keys
Returns
list<string>

Definition at line 447 of file class.ilSetupLanguage.php.

447 : array
448 {
449 return $this->repository()->getInvalidLocalLanguageFiles($language_keys);
450 }

References ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ getLanguageFileDirectoryManager()

ilSetupLanguage::getLanguageFileDirectoryManager ( )

◆ getLocalChanges()

ilSetupLanguage::getLocalChanges ( string  $a_lang_key,
string  $a_min_date = "",
string  $a_max_date = "" 
)

get locally changed language entries $a_lang_key language key $a_min_date minimum change date "yyyy-mm-dd hh:mm:ss" $a_max_date maximum change date "yyyy-mm-dd hh:mm:ss" Returned value [module][identifier] => value

Definition at line 427 of file class.ilSetupLanguage.php.

427 : array
428 {
429 return $this->repository()->getLocalChanges($a_lang_key, $a_min_date, $a_max_date);
430 }

References ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ getLocalLanguages()

ilSetupLanguage::getLocalLanguages ( )

Searches for the existence of *.lang.local files.

Returns array with language keys

Definition at line 436 of file class.ilSetupLanguage.php.

436 : array
437 {
438 return $this->repository()->getLocalLanguages();
439 }

References ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ getOverlaysOfUnshippedModules()

ilSetupLanguage::getOverlaysOfUnshippedModules ( )
Returns
array<string, list<string>>

Definition at line 303 of file class.ilSetupLanguage.php.

303 : array
304 {
305 // without the contributed directories every overlay looks unshipped
306 if ($this->uses_default_language_file_directories) {
307 return [];
308 }
309
310 return $this->manager?->getOverlaysOfUnshippedModules() ?? [];
311 }

◆ getSkippedDuplicateEntries()

ilSetupLanguage::getSkippedDuplicateEntries ( )
Returns
array<string, array<string, list<string>>> see LanguageInstallationManager::getSkippedDuplicateEntries()

Definition at line 287 of file class.ilSetupLanguage.php.

287 : array
288 {
289 return $this->manager?->getSkippedDuplicateEntries() ?? [];
290 }

◆ getSkippedInvalidMarkupEntries()

ilSetupLanguage::getSkippedInvalidMarkupEntries ( )
Returns
array<string, array<string, list<string>>>

Definition at line 279 of file class.ilSetupLanguage.php.

279 : array
280 {
281 return $this->manager?->getSkippedInvalidMarkupEntries() ?? [];
282 }

◆ getSkippedUnreadableOverlays()

ilSetupLanguage::getSkippedUnreadableOverlays ( )
Returns
array<string, list<string>> see LanguageInstallationManager::getSkippedUnreadableOverlays()

Definition at line 295 of file class.ilSetupLanguage.php.

295 : array
296 {
297 return $this->manager?->getSkippedUnreadableOverlays() ?? [];
298 }

◆ getUnrecordedTakenOverModules()

ilSetupLanguage::getUnrecordedTakenOverModules ( )
Returns
array<string, list<string>>

Definition at line 316 of file class.ilSetupLanguage.php.

316 : array
317 {
318 return $this->manager?->getUnrecordedTakenOverModules() ?? [];
319 }

◆ hasMigratedModules()

ilSetupLanguage::hasMigratedModules ( array  $lang_keys)

File-based, needs no database.

Parameters
list<string>$lang_keys

Definition at line 362 of file class.ilSetupLanguage.php.

362 : bool
363 {
364 return MigratedLanguageFileSync::hasShippedModules(
365 $this->language_file_directory_manager,
366 $this->absolute_path,
367 $lang_keys
368 );
369 }

◆ insertLanguageForApplyingLocalChanges()

ilSetupLanguage::insertLanguageForApplyingLocalChanges ( string  $lang_key)

See LanguageInstallationManager::insertLanguageForApplyingLocalChanges().

Returns
list<string> see insertLanguageForInstallation()

Definition at line 334 of file class.ilSetupLanguage.php.

334 : array
335 {
336 return $this->manager()->insertLanguageForApplyingLocalChanges($lang_key);
337 }

◆ insertLanguageForInstallation()

ilSetupLanguage::insertLanguageForInstallation ( string  $lang_key)
Returns
list<string> the migrated modules whose overlay could not be written

Definition at line 324 of file class.ilSetupLanguage.php.

324 : array
325 {
326 return $this->manager()->insertLanguageForInstallation($lang_key);
327 }

Referenced by ilSetupLanguageTest\databaseMethods().

+ Here is the caller graph for this function:

◆ installLanguages()

ilSetupLanguage::installLanguages ( array  $a_lang_keys,
array  $a_local_keys = [] 
)

install languages

$a_lang_keys array with lang_keys of languages to install

Returns
array|bool

Definition at line 217 of file class.ilSetupLanguage.php.

218 {
219 if (empty($a_lang_keys)) {
220 $a_lang_keys = [];
221 }
222
223 return $this->manager()->installLanguages($a_lang_keys, $a_local_keys);
224 }

References manager().

+ Here is the call graph for this function:

◆ loadLanguageModule()

ilSetupLanguage::loadLanguageModule ( string  $a_module)

Load language module.

Reimplemented from ilLanguage.

Definition at line 471 of file class.ilSetupLanguage.php.

471 : void
472 {
473 }

◆ manager()

ilSetupLanguage::manager ( )
private

Kept across calls because the manager collects getSkippedInvalidMarkupEntries() over a run; rebuilt only when db() changes.

Definition at line 119 of file class.ilSetupLanguage.php.

120 {
121 $db = $this->db() ?? throw new LogicException("No database available for " . self::class . ".");
122 if ($this->manager === null || $this->manager_db !== $db) {
123 $this->manager_db = $db;
125 $db,
126 $this->language_file_directory_manager,
127 $this->absolute_path,
128 $this->repository(),
129 null,
130 $this->translation_cache,
131 fn(): ?string => $this->getClientDataDir(),
132 $this->logger
133 );
134 }
135 return $this->manager;
136 }
Write access to the language installation: installing, flushing and registering languages in the data...
LanguageInstallationManager $manager

References $db, $manager, db(), getClientDataDir(), ILIAS\Repository\logger(), manager(), and repository().

Referenced by installLanguages(), and manager().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ registerInstalledLanguage()

ilSetupLanguage::registerInstalledLanguage ( string  $lang_key,
array  $known_languages,
array  $local_language_keys 
)

Single place for the object_data row ("installed" vs.

"installed_local"), also used by InstallLanguage::perform().

Parameters
array<string,array{obj_id:int,status:string}>$known_languages result of getAvailableLanguages()/getAvailableLanguagesForInstallation()
list<string>$local_language_keys result of getLocalLanguages()

Definition at line 232 of file class.ilSetupLanguage.php.

236 : void {
237 $this->manager()->registerInstalledLanguage($lang_key, $known_languages, $local_language_keys);
238 }

◆ repository()

ilSetupLanguage::repository ( )
private

Without a database only the file-based methods work.

Definition at line 106 of file class.ilSetupLanguage.php.

107 {
109 $this->db(),
110 $this->language_file_directory_manager,
111 new FixedInstallationRoot($this->absolute_path)
112 );
113 }
A root determined by the caller, for the classes which are not wired by the component bootstrap.
Read-only access to the installed languages (database) and the available or valid language files (fil...

References db().

Referenced by manager().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setClientDataDir()

ilSetupLanguage::setClientDataDir ( ?string  $client_data_dir)

null resets to the resolver of the constructor.

Definition at line 141 of file class.ilSetupLanguage.php.

141 : void
142 {
143 $this->client_data_dir = $client_data_dir;
144 }

References $client_data_dir.

◆ setDbHandler()

ilSetupLanguage::setDbHandler ( ilDBInterface  $a_db_handler)

Takes precedence over $GLOBALS['ilDB'].

Return true on success

Definition at line 465 of file class.ilSetupLanguage.php.

465 : bool
466 {
467 $this->db = $a_db_handler;
468 return true;
469 }

Referenced by ilSetupLanguageTest\managerOf().

+ Here is the caller graph for this function:

◆ usesDefaultLanguageFileDirectories()

ilSetupLanguage::usesDefaultLanguageFileDirectories ( )

Such an instance (e.g.

‘new ilSetupLanguage('en’)` in plugin Setup Objectives) must not refresh an installed language: that would drop the lng_data rows of every component-contributed module.

Definition at line 161 of file class.ilSetupLanguage.php.

161 : bool
162 {
164 }
readonly bool $uses_default_language_file_directories

References $uses_default_language_file_directories.

Field Documentation

◆ $absolute_path

string ilSetupLanguage::$absolute_path
private

Definition at line 55 of file class.ilSetupLanguage.php.

◆ $client_data_dir

string ilSetupLanguage::$client_data_dir = null
private

Definition at line 62 of file class.ilSetupLanguage.php.

Referenced by getClientDataDir(), and setClientDataDir().

◆ $comment_separator

string ilSetupLanguage::$comment_separator = "###"

Definition at line 60 of file class.ilSetupLanguage.php.

◆ $db

ilDBInterface ilSetupLanguage::$db = null
protected

Definition at line 61 of file class.ilSetupLanguage.php.

Referenced by manager().

◆ $lang_default

string ilSetupLanguage::$lang_default = "en"

Definition at line 57 of file class.ilSetupLanguage.php.

Referenced by __construct().

◆ $lang_key

string ilSetupLanguage::$lang_key

Definition at line 58 of file class.ilSetupLanguage.php.

◆ $language_file_directory_manager

readonly LanguageFileDirectoryManager ilSetupLanguage::$language_file_directory_manager
private

Definition at line 64 of file class.ilSetupLanguage.php.

Referenced by __construct(), and getLanguageFileDirectoryManager().

◆ $manager

LanguageInstallationManager ilSetupLanguage::$manager = null
private

Definition at line 65 of file class.ilSetupLanguage.php.

Referenced by manager().

◆ $manager_db

ilDBInterface ilSetupLanguage::$manager_db = null
private

Definition at line 66 of file class.ilSetupLanguage.php.

◆ $separator

string ilSetupLanguage::$separator = "#:#"

Definition at line 59 of file class.ilSetupLanguage.php.

◆ $text

array ilSetupLanguage::$text

Definition at line 56 of file class.ilSetupLanguage.php.

◆ $uses_default_language_file_directories

readonly bool ilSetupLanguage::$uses_default_language_file_directories
private

Definition at line 63 of file class.ilSetupLanguage.php.

Referenced by usesDefaultLanguageFileDirectories().


The documentation for this class was generated from the following file: