ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilInitialisation Class Reference

ILIAS Initialisation Utility Class perform basic setup: init database handler, load configuration file, init user authentification & error handler, load object type definitions. More...

+ Collaboration diagram for ilInitialisation:

Static Public Member Functions

static initFileUploadService (\ILIAS\DI\Container $dic)
 Initializes the file upload service. More...
 
static setSessionHandler ()
 set session handler to db More...
 
static goToPublicSection ()
 go to public section More...
 
static reinitILIAS ()
 
static initILIAS ()
 ilias initialisation More...
 
static handleErrorReporting ()
 Set error reporting level. More...
 
static resumeUserSession ()
 Resume an existing user session. More...
 
static authenticate ()
 Try authentication. More...
 

Static Protected Member Functions

static removeUnsafeCharacters ()
 Remove unsafe characters from GET. More...
 
static recursivelyRemoveUnsafeCharacters ($var)
 
static requireCommonIncludes ()
 get common include code files More...
 
static includePhp5Compliance ()
 This is a hack for authentication. More...
 
static initIliasIniFile ()
 This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilIliasIniFile. More...
 
static buildHTTPPath ()
 builds http path More...
 
static determineClient ()
 This method determines the current client and sets the constant CLIENT_ID. More...
 
static initClientIniFile ()
 This method provides a global instance of class ilIniFile for the client.ini.php file in variable $ilClientIniFile. More...
 
static handleMaintenanceMode ()
 handle maintenance mode More...
 
static initDatabase ()
 initialise database object $ilDB More...
 
static setCookieConstants ()
 
static setSessionCookieParams ()
 set session cookie params More...
 
static initMail (\ILIAS\DI\Container $c)
 
static initAvatar (\ILIAS\DI\Container $c)
 
static initSettings ()
 initialise $ilSettings object and define constants More...
 
static initStyle ()
 provide $styleDefinition object More...
 
static initLocale ()
 Init Locale. More...
 
static goToLogin ()
 go to login More...
 
static initAccessHandling ()
 $ilAccess and $rbac... More...
 
static initLog ()
 Init log instance. More...
 
static initGlobal ($a_name, $a_class, $a_source_file=null)
 Initialize global instance. More...
 
static abortAndDie ($a_message)
 Exit. More...
 
static handleDevMode ()
 Prepare developer tools. More...
 
static initSession ()
 Init auth session. More...
 
static initCore ()
 Init core objects (level 0) More...
 
static initClient ()
 Init client-based objects (level 1) More...
 
static initUser ()
 Init user / authentification (level 2) More...
 
static initHTTPServices (\ILIAS\DI\Container $container)
 
static initUIFramework (\ILIAS\DI\Container $c)
 init the ILIAS UI framework. More...
 
static initHTML ()
 init HTML output (level 3) More...
 
static getCurrentCmd ()
 Extract current cmd from request. More...
 
static blockedAuthentication ($a_current_script)
 Block authentication based on current request. More...
 
static showingLoginForm ($a_current_script)
 Is current view the login form? More...
 
static translateMessage ($a_message_id, array $a_message_static=null)
 Translate message if possible. More...
 
static redirect ($a_target, $a_message_id='', array $a_message_static=null)
 Redirects to target url if context supports it. More...
 

Static Protected Attributes

static $already_initialized
 

Static Private Member Functions

static initBackgroundTasks (\ILIAS\DI\Container $c)
 
static initInjector (\ILIAS\DI\Container $c)
 

Detailed Description

ILIAS Initialisation Utility Class perform basic setup: init database handler, load configuration file, init user authentification & error handler, load object type definitions.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Sascha Hofmann shofm.nosp@m.ann@.nosp@m.datab.nosp@m.ay.d.nosp@m.e
Version
$Id$

Definition at line 36 of file class.ilInitialisation.php.

Member Function Documentation

◆ abortAndDie()

static ilInitialisation::abortAndDie (   $a_message)
staticprotected

Exit.

Parameters
string$a_message

Definition at line 911 of file class.ilInitialisation.php.

References $GLOBALS.

912  {
913  if (is_object($GLOBALS['ilLog'])) {
914  $GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - " . $a_message);
915  }
916  die($a_message);
917  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

◆ authenticate()

static ilInitialisation::authenticate ( )
static

Try authentication.

This will basically validate the current session

Definition at line 1235 of file class.ilInitialisation.php.

References $_SERVER, $GLOBALS, $ilErr, $ilSetting, $ilUser, ilContext\CONTEXT_SOAP, ilContext\CONTEXT_WAC, ilPublicSectionSettings\getInstance(), ilLoggerFactory\getLogger(), and ilContext\getType().

1236  {
1237  global $ilAuth, $ilias, $ilErr;
1238 
1239  $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1240 
1241  if (self::blockedAuthentication($current_script)) {
1242  return;
1243  }
1244 
1245  $oldSid = session_id();
1246 
1247  $ilAuth->start();
1248  $ilias->setAuthError($ilErr->getLastError());
1249 
1250  if ($ilAuth->getAuth() && $ilAuth->getStatus() == '') {
1251  self::initUserAccount();
1252 
1253  self::handleAuthenticationSuccess();
1254  } else {
1255  if (!self::showingLoginForm($current_script)) {
1256  // :TODO: should be moved to context?!
1257  $mandatory_auth = ($current_script != "shib_login.php"
1258  && $current_script != "shib_logout.php"
1259  && $current_script != "saml.php"
1260  && $current_script != "error.php"
1261  && $current_script != "chat.php"
1262  && $current_script != "wac.php"
1263  && $current_script != "index.php"); // #10316
1264 
1265  if ($mandatory_auth) {
1266  self::handleAuthenticationFail();
1267  }
1268  }
1269  }
1270  }
global $ilErr
Definition: raiseError.php:16
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
+ Here is the call graph for this function:

◆ blockedAuthentication()

static ilInitialisation::blockedAuthentication (   $a_current_script)
staticprotected

Block authentication based on current request.

Returns
boolean

Definition at line 1520 of file class.ilInitialisation.php.

References $_GET, array, ilContext\CONTEXT_APACHE_SSO, ilContext\CONTEXT_LTI_PROVIDER, ilContext\CONTEXT_SAML, ilContext\CONTEXT_SHIBBOLETH, ilContext\CONTEXT_WAC, ilContext\CONTEXT_WEBDAV, ilLoggerFactory\getLogger(), and ilContext\getType().

1521  {
1523  ilLoggerFactory::getLogger('init')->debug('Blocked authentication for WAC request.');
1524  return true;
1525  }
1527  ilLoggerFactory::getLogger('init')->debug('Blocked authentication for sso request.');
1528  return true;
1529  }
1531  ilLoggerFactory::getLogger('init')->debug('Blocked authentication for webdav request');
1532  return true;
1533  }
1535  ilLoggerFactory::getLogger('init')->debug('Blocked authentication for shibboleth request.');
1536  return true;
1537  }
1539  ilLoggerFactory::getLogger('init')->debug('Blocked authentication for lti provider requests.');
1540  return true;
1541  }
1543  ilLoggerFactory::getLogger('init')->debug('Blocked authentication for SAML request.');
1544  return true;
1545  }
1546  if (
1547  $a_current_script == "register.php" ||
1548  $a_current_script == "pwassist.php" ||
1549  $a_current_script == "confirmReg.php" ||
1550  $a_current_script == "il_securimage_play.php" ||
1551  $a_current_script == "il_securimage_show.php" ||
1552  $a_current_script == 'login.php'
1553  ) {
1554  ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for script: ' . $a_current_script);
1555  return true;
1556  }
1557 
1558  if ($_REQUEST["baseClass"] == "ilStartUpGUI") {
1559  $cmd_class = $_REQUEST["cmdClass"];
1560 
1561  if ($cmd_class == "ilaccountregistrationgui" ||
1562  $cmd_class == "ilpasswordassistancegui") {
1563  ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmdClass: ' . $cmd_class);
1564  return true;
1565  }
1566 
1567  $cmd = self::getCurrentCmd();
1568  if (
1569  $cmd == "showTermsOfService" || $cmd == "showClientList" ||
1570  $cmd == 'showAccountMigration' || $cmd == 'migrateAccount' ||
1571  $cmd == 'processCode' || $cmd == 'showLoginPage' || $cmd == 'doStandardAuthentication' || $cmd == 'doCasAuthentication'
1572  ) {
1573  ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmd: ' . $cmd);
1574  return true;
1575  }
1576  }
1577 
1578  // #12884
1579  if (($a_current_script == "goto.php" && $_GET["target"] == "impr_0") ||
1580  $_GET["baseClass"] == "ilImprintGUI") {
1581  ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for baseClass: ' . $_GET['baseClass']);
1582  return true;
1583  }
1584 
1585  if ($a_current_script == 'goto.php' && in_array($_GET['target'], array(
1586  'usr_registration', 'usr_nameassist', 'usr_pwassist', 'usr_agreement'
1587  ))) {
1588  ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for goto target: ' . $_GET['target']);
1589  return true;
1590  }
1591 
1592  ilLoggerFactory::getLogger('auth')->debug('Authentication required');
1593  return false;
1594  }
const CONTEXT_WAC
$_GET["client_id"]
const CONTEXT_WEBDAV
const CONTEXT_LTI_PROVIDER
const CONTEXT_SHIBBOLETH
const CONTEXT_SAML
Create styles array
The data for the language used.
static getLogger($a_component_id)
Get component logger.
static getType()
Get context type.
const CONTEXT_APACHE_SSO
+ Here is the call graph for this function:

◆ buildHTTPPath()

static ilInitialisation::buildHTTPPath ( )
staticprotected

builds http path

Definition at line 289 of file class.ilInitialisation.php.

References $_SERVER, $https, $module, $path, GuzzleHttp\Psr7\$protocol, ilContext\CONTEXT_APACHE_SSO, defined, ilContext\getType(), ILIAS_MODULE, and ilUtil\removeTrailingPathSeparators().

290  {
291  include_once './Services/Http/classes/class.ilHTTPS.php';
292  $https = new ilHTTPS();
293 
294  if ($https->isDetected()) {
295  $protocol = 'https://';
296  } else {
297  $protocol = 'http://';
298  }
299  $host = $_SERVER['HTTP_HOST'];
300 
301  $rq_uri = strip_tags($_SERVER['REQUEST_URI']);
302 
303  // security fix: this failed, if the URI contained "?" and following "/"
304  // -> we remove everything after "?"
305  if (is_int($pos = strpos($rq_uri, "?"))) {
306  $rq_uri = substr($rq_uri, 0, $pos);
307  }
308 
309  if (!defined('ILIAS_MODULE')) {
310  $path = pathinfo($rq_uri);
311  if (!$path['extension']) {
312  $uri = $rq_uri;
313  } else {
314  $uri = dirname($rq_uri);
315  }
316  } else {
317  // if in module remove module name from HTTP_PATH
318  $path = dirname($rq_uri);
319 
320  // dirname cuts the last directory from a directory path e.g content/classes return content
321 
323 
324  $dirs = explode('/', $module);
325  $uri = $path;
326  foreach ($dirs as $dir) {
327  $uri = dirname($uri);
328  }
329  }
331  return define('ILIAS_HTTP_PATH', ilUtil::removeTrailingPathSeparators(dirname($protocol . $host . $uri)));
332  }
333  return define('ILIAS_HTTP_PATH', ilUtil::removeTrailingPathSeparators($protocol . $host . $uri));
334  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
if($modEnd===false) $module
Definition: module.php:59
HTTPS.
$https
Definition: imgupload.php:19
static removeTrailingPathSeparators($path)
const ILIAS_MODULE
Definition: server.php:14
static getType()
Get context type.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
const CONTEXT_APACHE_SSO
+ Here is the call graph for this function:

◆ determineClient()

static ilInitialisation::determineClient ( )
staticprotected

This method determines the current client and sets the constant CLIENT_ID.

Definition at line 340 of file class.ilInitialisation.php.

References $_COOKIE, $_GET, League\OAuth2\Client\Provider\$clientId, $ilIliasIniFile, defined, ilUtil\getClientIdByString(), ilUtil\setCookie(), and ilContext\supportsPersistentSessions().

341  {
342  global $ilIliasIniFile;
343 
344  // check whether ini file object exists
345  if (!is_object($ilIliasIniFile)) {
346  self::abortAndDie('Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.');
347  }
348 
349  if (isset($_GET['client_id']) && strlen($_GET['client_id']) > 0) {
350  $_GET['client_id'] = \ilUtil::getClientIdByString((string) $_GET['client_id'])->toString();
351  if (!defined('IL_PHPUNIT_TEST')) {
353  ilUtil::setCookie('ilClientId', $_GET['client_id']);
354  }
355  }
356  } elseif (!isset($_COOKIE['ilClientId'])) {
357  ilUtil::setCookie('ilClientId', $ilIliasIniFile->readVariable('clients', 'default'));
358  }
359 
360  if (!defined('IL_PHPUNIT_TEST') && ilContext::supportsPersistentSessions()) {
361  $clientId = $_COOKIE['ilClientId'];
362  } else {
363  $clientId = $_GET['client_id'];
364  }
365 
366  define('CLIENT_ID', \ilUtil::getClientIdByString((string) $clientId)->toString());
367  }
$_COOKIE['client_id']
Definition: server.php:9
$_GET["client_id"]
static getClientIdByString($clientId)
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)
static supportsPersistentSessions()
Check if context supports persistent session handling.
$ilIliasIniFile
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
+ Here is the call graph for this function:

◆ getCurrentCmd()

static ilInitialisation::getCurrentCmd ( )
staticprotected

Extract current cmd from request.

Returns
string

Definition at line 1505 of file class.ilInitialisation.php.

1506  {
1507  $cmd = $_REQUEST["cmd"];
1508  if (is_array($cmd)) {
1509  return array_shift(array_keys($cmd));
1510  } else {
1511  return $cmd;
1512  }
1513  }

◆ goToLogin()

static ilInitialisation::goToLogin ( )
staticprotected

go to login

Parameters
int$a_auth_stat

Definition at line 790 of file class.ilInitialisation.php.

References $_COOKIE, $_GET, $DIC, $GLOBALS, array, ilLanguage\getFallbackInstance(), ilLoggerFactory\getLogger(), ilSession\SESSION_CLOSE_EXPIRE, ilSession\SESSION_CLOSE_LOGIN, and ilSession\setClosingContext().

791  {
792  ilLoggerFactory::getLogger('init')->debug('Redirecting to login page.');
793 
794  if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
796  }
797  if (!$GLOBALS['DIC']['ilAuthSession']->isAuthenticated()) {
799  }
800 
801  $script = "login.php?target=" . $_GET["target"] . "&client_id=" . $_COOKIE["ilClientId"] .
802  "&auth_stat=" . $a_auth_stat;
803 
804  self::redirect(
805  $script,
806  "init_error_authentication_fail",
807  array(
808  "en" => "Authentication failed.",
809  "de" => "Authentifizierung fehlgeschlagen.")
810  );
811  }
$_COOKIE['client_id']
Definition: server.php:9
$_GET["client_id"]
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
const SESSION_CLOSE_LOGIN
const SESSION_CLOSE_EXPIRE
Create styles array
The data for the language used.
static setClosingContext($a_context)
set closing context (for statistics)
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

◆ goToPublicSection()

static ilInitialisation::goToPublicSection ( )
static

go to public section

Parameters
int$a_auth_stat

Definition at line 735 of file class.ilInitialisation.php.

References $_GET, $_SERVER, $GLOBALS, ilSession\SESSION_CLOSE_EXPIRE, ilSession\SESSION_CLOSE_PUBLIC, and ilSession\setClosingContext().

Referenced by ilAuthUtils\handleForcedAuthentication(), ilStartUpGUI\processIndexPHP(), and redirect().

736  {
737  global $ilAuth;
738 
739  if (ANONYMOUS_USER_ID == "") {
740  self::abortAndDie("Public Section enabled, but no Anonymous user found.");
741  }
742 
743  $session_destroyed = false;
744  if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
745  $session_destroyed = true;
747  }
748  if (!$GLOBALS['DIC']['ilAuthSession']->isAuthenticated()) {
749  $session_destroyed = true;
751  }
752 
753  if ($session_destroyed) {
754  $GLOBALS['DIC']['ilAuthSession']->setAuthenticated(true, ANONYMOUS_USER_ID);
755  }
756 
757  self::initUserAccount();
758 
759  // if target given, try to go there
760  if (strlen($_GET["target"])) {
761  // when we are already "inside" goto.php no redirect is needed
762  $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
763  if ($current_script == "goto.php") {
764  return;
765  }
766  // goto will check if target is accessible or redirect to login
767  self::redirect("goto.php?target=" . $_GET["target"]);
768  }
769 
770  // check access of root folder otherwise redirect to login
771  #if(!$GLOBALS['DIC']->rbac()->system()->checkAccess('read', ROOT_FOLDER_ID))
772  #{
773  # return self::goToLogin();
774  #}
775 
776  // we do not know if ref_id of request is accesible, so redirecting to root
777  $_GET["ref_id"] = ROOT_FOLDER_ID;
778  $_GET["cmd"] = "frameset";
779  self::redirect(
780  "ilias.php?baseClass=ilrepositorygui&reloadpublic=1&cmd=" .
781  $_GET["cmd"] . "&ref_id=" . $_GET["ref_id"]
782  );
783  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$_GET["client_id"]
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
const SESSION_CLOSE_EXPIRE
const SESSION_CLOSE_PUBLIC
static setClosingContext($a_context)
set closing context (for statistics)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleDevMode()

static ilInitialisation::handleDevMode ( )
staticprotected

Prepare developer tools.

Definition at line 922 of file class.ilInitialisation.php.

References defined.

923  {
924  if (defined(SHOWNOTICES) && SHOWNOTICES) {
925  // no further differentiating of php version regarding to 5.4 neccessary
926  // when the error reporting is set to E_ALL anyway
927 
928  // add notices to error reporting
929  error_reporting(E_ALL);
930  }
931 
932  if (defined('DEBUGTOOLS') && DEBUGTOOLS) {
933  include_once "include/inc.debug.php";
934  }
935  }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

◆ handleErrorReporting()

static ilInitialisation::handleErrorReporting ( )
static

Set error reporting level.

Definition at line 1030 of file class.ilInitialisation.php.

Referenced by ilWebAccessCheckerDelivery\handleRequest().

1031  {
1032  // push the error level as high as possible / sane
1033  error_reporting(E_ALL & ~E_NOTICE);
1034 
1035  // see handleDevMode() - error reporting might be overwritten again
1036  // but we need the client ini first
1037  }
+ Here is the caller graph for this function:

◆ handleMaintenanceMode()

static ilInitialisation::handleMaintenanceMode ( )
staticprotected

handle maintenance mode

Definition at line 462 of file class.ilInitialisation.php.

References array, and ilContext\hasHTML().

463  {
464  global $ilClientIniFile;
465 
466  if (!$ilClientIniFile->readVariable("client", "access")) {
467  $mess = array("en" => "The server is not available due to maintenance." .
468  " We apologise for any inconvenience.",
469  "de" => "Der Server ist aufgrund von Wartungsarbeiten nicht verfügbar." .
470  " Wir bitten um Verständnis.");
471  $mess_id = "init_error_maintenance";
472 
473  if (ilContext::hasHTML() && is_file("./maintenance.html")) {
474  self::redirect("./maintenance.html", $mess_id, $mess);
475  } else {
476  $mess = self::translateMessage($mess_id, $mess);
477  self::abortAndDie($mess);
478  }
479  }
480  }
static hasHTML()
Has HTML output.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ includePhp5Compliance()

static ilInitialisation::includePhp5Compliance ( )
staticprotected

This is a hack for authentication.

Since the phpCAS lib ships with its own compliance functions.

Definition at line 94 of file class.ilInitialisation.php.

References ilAuthFactory\CONTEXT_CAS, and ilAuthFactory\getContext().

95  {
96  include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
98  require_once("include/inc.xml5compliance.php");
99  }
100  require_once("include/inc.xsl5compliance.php");
101  }
+ Here is the call graph for this function:

◆ initAccessHandling()

static ilInitialisation::initAccessHandling ( )
staticprotected

$ilAccess and $rbac...

initialisation

Definition at line 843 of file class.ilInitialisation.php.

References ilRbacSystem\getInstance().

844  {
845  self::initGlobal(
846  "rbacreview",
847  "ilRbacReview",
848  "./Services/AccessControl/classes/class.ilRbacReview.php"
849  );
850 
851  require_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
852  $rbacsystem = ilRbacSystem::getInstance();
853  self::initGlobal("rbacsystem", $rbacsystem);
854 
855  self::initGlobal(
856  "rbacadmin",
857  "ilRbacAdmin",
858  "./Services/AccessControl/classes/class.ilRbacAdmin.php"
859  );
860 
861  self::initGlobal(
862  "ilAccess",
863  "ilAccess",
864  "./Services/AccessControl/classes/class.ilAccess.php"
865  );
866 
867  require_once "./Services/AccessControl/classes/class.ilConditionHandler.php";
868  }
+ Here is the call graph for this function:

◆ initAvatar()

static ilInitialisation::initAvatar ( \ILIAS\DI\Container  $c)
staticprotected
Parameters
\ILIAS\DI\Container$c

Definition at line 598 of file class.ilInitialisation.php.

599  {
600  $c["user.avatar.factory"] = function ($c) {
601  require_once 'Services/User/Avatar/classes/class.ilUserAvatarFactory.php';
602  return new ilUserAvatarFactory($c);
603  };
604  }
Class ilUserAvatarFactory.

◆ initBackgroundTasks()

static ilInitialisation::initBackgroundTasks ( \ILIAS\DI\Container  $c)
staticprivate

Definition at line 1740 of file class.ilInitialisation.php.

References $ilIliasIniFile, and $sync.

1741  {
1742  global $ilIliasIniFile;
1743 
1744  $n_of_tasks = $ilIliasIniFile->readVariable("background_tasks", "number_of_concurrent_tasks");
1745  $sync = $ilIliasIniFile->readVariable("background_tasks", "concurrency");
1746 
1747  $n_of_tasks = $n_of_tasks ? $n_of_tasks : 5;
1748  $sync = $sync ? $sync : 'sync'; // The default value is sync.
1749 
1750  $c["bt.task_factory"] = function ($c) {
1751  return new \ILIAS\BackgroundTasks\Implementation\Tasks\BasicTaskFactory($c["di.injector"]);
1752  };
1753 
1754  $c["bt.persistence"] = function ($c) {
1755  return new \ILIAS\BackgroundTasks\Implementation\Persistence\BasicPersistence();
1756  };
1757 
1758  $c["bt.injector"] = function ($c) {
1759  return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, new BaseDependencyMap());
1760  };
1761 
1762  $c["bt.task_manager"] = function ($c) use ($sync) {
1763  if ($sync == 'sync') {
1764  return new \ILIAS\BackgroundTasks\Implementation\TaskManager\BasicTaskManager($c["bt.persistence"]);
1765  } elseif ($sync == 'async') {
1766  return new \ILIAS\BackgroundTasks\Implementation\TaskManager\AsyncTaskManager($c["bt.persistence"]);
1767  } else {
1768  throw new ilException("The supported Background Task Managers are sync and async. $sync given.");
1769  }
1770  };
1771  }
$sync
$ilIliasIniFile

◆ initClient()

static ilInitialisation::initClient ( )
staticprotected

Init client-based objects (level 1)

Definition at line 1084 of file class.ilInitialisation.php.

References $DIC, $GLOBALS, $https, and ilContext\usesHTTP().

1085  {
1086  global $https, $ilias, $DIC;
1087 
1088  self::setCookieConstants();
1089 
1090  self::determineClient();
1091 
1092  self::bootstrapFilesystems();
1093 
1094  self::initClientIniFile();
1095 
1096 
1097  // --- needs client ini
1098 
1099  $ilias->client_id = CLIENT_ID;
1100 
1101  if (DEVMODE) {
1102  self::handleDevMode();
1103  }
1104 
1105 
1106  self::handleMaintenanceMode();
1107 
1108  self::initDatabase();
1109 
1110  // init dafault language
1111  self::initLanguage(false);
1112 
1113  // moved after databases
1114  self::initLog();
1115 
1116  self::initGlobal(
1117  "ilAppEventHandler",
1118  "ilAppEventHandler",
1119  "./Services/EventHandling/classes/class.ilAppEventHandler.php"
1120  );
1121 
1122  // there are rare cases where initILIAS is called twice for a request
1123  // example goto.php is called and includes ilias.php later
1124  // we must prevent that ilPluginAdmin is initialized twice in
1125  // this case, since this won't get the values out of plugin.php the
1126  // second time properly
1127  if (!isset($DIC["ilPluginAdmin"]) || !$DIC["ilPluginAdmin"] instanceof ilPluginAdmin) {
1128  self::initGlobal(
1129  "ilPluginAdmin",
1130  "ilPluginAdmin",
1131  "./Services/Component/classes/class.ilPluginAdmin.php"
1132  );
1133  }
1134 
1135  self::initSettings();
1136  self::setSessionHandler();
1137  self::initMail($GLOBALS['DIC']);
1138  self::initAvatar($GLOBALS['DIC']);
1139 
1140 
1141  // --- needs settings
1142 
1143  self::initLocale();
1144 
1145  if (ilContext::usesHTTP()) {
1146  // $https
1147  self::initGlobal("https", "ilHTTPS", "./Services/Http/classes/class.ilHTTPS.php");
1148  $https->enableSecureCookies();
1149  $https->checkPort();
1150  }
1151 
1152 
1153  // --- object handling
1154 
1155  self::initGlobal(
1156  "ilObjDataCache",
1157  "ilObjectDataCache",
1158  "./Services/Object/classes/class.ilObjectDataCache.php"
1159  );
1160 
1161  // needed in ilObjectDefinition
1162  require_once "./Services/Xml/classes/class.ilSaxParser.php";
1163 
1164  self::initGlobal(
1165  "objDefinition",
1166  "ilObjectDefinition",
1167  "./Services/Object/classes/class.ilObjectDefinition.php"
1168  );
1169 
1170  // $tree
1171  require_once "./Services/Tree/classes/class.ilTree.php";
1172  $tree = new ilTree(ROOT_FOLDER_ID);
1173  self::initGlobal("tree", $tree);
1174  unset($tree);
1175 
1176  self::initGlobal(
1177  "ilCtrl",
1178  "ilCtrl",
1179  "./Services/UICore/classes/class.ilCtrl.php"
1180  );
1181 
1182  self::setSessionCookieParams();
1183  }
static usesHTTP()
Uses HTTP aka browser.
global $DIC
Definition: saml.php:7
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Administration class for plugins.
$https
Definition: imgupload.php:19
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
+ Here is the call graph for this function:

◆ initClientIniFile()

static ilInitialisation::initClientIniFile ( )
staticprotected

This method provides a global instance of class ilIniFile for the client.ini.php file in variable $ilClientIniFile.

It initializes a lot of constants accordingly to the settings in the client.ini.php file.

Preconditions: ILIAS_WEB_DIR and CLIENT_ID must be set.

Returns
boolean true, if no error occured with client init file otherwise false

Definition at line 381 of file class.ilInitialisation.php.

References $_COOKIE, $ilIliasIniFile, array, ilUtil\setCookie(), and ilGlobalCache\setup().

382  {
383  global $ilIliasIniFile;
384 
385  // check whether ILIAS_WEB_DIR is set.
386  if (ILIAS_WEB_DIR == "") {
387  self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without ILIAS_WEB_DIR.");
388  }
389 
390  // check whether CLIENT_ID is set.
391  if (CLIENT_ID == "") {
392  self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without CLIENT_ID.");
393  }
394 
395  $ini_file = "./" . ILIAS_WEB_DIR . "/" . CLIENT_ID . "/client.ini.php";
396 
397  // get settings from ini file
398  $ilClientIniFile = new ilIniFile($ini_file);
399  $ilClientIniFile->read();
400 
401  // invalid client id / client ini
402  if ($ilClientIniFile->ERROR != "") {
403  $c = $_COOKIE["ilClientId"];
404  $default_client = $ilIliasIniFile->readVariable("clients", "default");
405  ilUtil::setCookie("ilClientId", $default_client);
406  if (CLIENT_ID != "" && CLIENT_ID != $default_client) {
407  $mess = array("en" => "Client does not exist.",
408  "de" => "Mandant ist ungültig.");
409  self::redirect("index.php?client_id=" . $default_client, null, $mess);
410  } else {
411  self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile initializing client ini file abborted with: " . $ilClientIniFile->ERROR);
412  }
413  }
414 
415  self::initGlobal("ilClientIniFile", $ilClientIniFile);
416 
417  // set constants
418  define("SESSION_REMINDER_LEADTIME", 30);
419  define("DEBUG", $ilClientIniFile->readVariable("system", "DEBUG"));
420  define("DEVMODE", $ilClientIniFile->readVariable("system", "DEVMODE"));
421  define("SHOWNOTICES", $ilClientIniFile->readVariable("system", "SHOWNOTICES"));
422  define("DEBUGTOOLS", $ilClientIniFile->readVariable("system", "DEBUGTOOLS"));
423  define("ROOT_FOLDER_ID", $ilClientIniFile->readVariable('system', 'ROOT_FOLDER_ID'));
424  define("SYSTEM_FOLDER_ID", $ilClientIniFile->readVariable('system', 'SYSTEM_FOLDER_ID'));
425  define("ROLE_FOLDER_ID", $ilClientIniFile->readVariable('system', 'ROLE_FOLDER_ID'));
426  define("MAIL_SETTINGS_ID", $ilClientIniFile->readVariable('system', 'MAIL_SETTINGS_ID'));
427  $error_handler = $ilClientIniFile->readVariable('system', 'ERROR_HANDLER');
428  define("ERROR_HANDLER", $error_handler ? $error_handler : "PRETTY_PAGE");
429 
430  // this is for the online help installation, which sets OH_REF_ID to the
431  // ref id of the online module
432  define("OH_REF_ID", $ilClientIniFile->readVariable("system", "OH_REF_ID"));
433 
434  define("SYSTEM_MAIL_ADDRESS", $ilClientIniFile->readVariable('system', 'MAIL_SENT_ADDRESS')); // Change SS
435  define("MAIL_REPLY_WARNING", $ilClientIniFile->readVariable('system', 'MAIL_REPLY_WARNING')); // Change SS
436 
437  // see ilObject::TITLE_LENGTH, ilObject::DESC_LENGTH
438  // define ("MAXLENGTH_OBJ_TITLE",125);#$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_TITLE'));
439  // define ("MAXLENGTH_OBJ_DESC",$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_DESC'));
440 
441  define("CLIENT_DATA_DIR", ILIAS_DATA_DIR . "/" . CLIENT_ID);
442  define("CLIENT_WEB_DIR", ILIAS_ABSOLUTE_PATH . "/" . ILIAS_WEB_DIR . "/" . CLIENT_ID);
443  define("CLIENT_NAME", $ilClientIniFile->readVariable('client', 'name')); // Change SS
444 
445  $val = $ilClientIniFile->readVariable("db", "type");
446  if ($val == "") {
447  define("IL_DB_TYPE", "mysql");
448  } else {
449  define("IL_DB_TYPE", $val);
450  }
451 
452  $ilGlobalCacheSettings = new ilGlobalCacheSettings();
453  $ilGlobalCacheSettings->readFromIniFile($ilClientIniFile);
454  ilGlobalCache::setup($ilGlobalCacheSettings);
455 
456  return true;
457  }
$_COOKIE['client_id']
Definition: server.php:9
Class ilGlobalCacheSettings.
static setup(ilGlobalCacheSettings $ilGlobalCacheSettings)
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)
Create styles array
The data for the language used.
$ilIliasIniFile
INIFile Parser.
+ Here is the call graph for this function:

◆ initCore()

static ilInitialisation::initCore ( )
staticprotected

Init core objects (level 0)

Definition at line 1042 of file class.ilInitialisation.php.

References $_POST, $ilErr, array, ilSession\get(), and PEAR_ERROR_CALLBACK.

1043  {
1044  global $ilErr;
1045 
1046  self::handleErrorReporting();
1047 
1048  // breaks CAS: must be included after CAS context isset in AuthUtils
1049  //self::includePhp5Compliance();
1050 
1051  self::requireCommonIncludes();
1052 
1053 
1054  // error handler
1055  self::initGlobal(
1056  "ilErr",
1057  "ilErrorHandling",
1058  "./Services/Init/classes/class.ilErrorHandling.php"
1059  );
1060  $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, 'errorHandler'));
1061 
1062  // :TODO: obsolete?
1063  // PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, "errorHandler"));
1064 
1065  // workaround: load old post variables if error handler 'message' was called
1066  include_once "Services/Authentication/classes/class.ilSession.php";
1067  if (ilSession::get("message")) {
1068  $_POST = ilSession::get("post_vars");
1069  }
1070 
1071  self::removeUnsafeCharacters();
1072 
1073  self::initIliasIniFile();
1074 
1075  define('IL_INITIAL_WD', getcwd());
1076 
1077  // deprecated
1078  self::initGlobal("ilias", "ILIAS", "./Services/Init/classes/class.ilias.php");
1079  }
global $ilErr
Definition: raiseError.php:16
const PEAR_ERROR_CALLBACK
Definition: PEAR.php:35
static get($a_var)
Get a value.
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:

◆ initDatabase()

static ilInitialisation::initDatabase ( )
staticprotected

initialise database object $ilDB

Definition at line 486 of file class.ilInitialisation.php.

References $ilDB.

487  {
488  // build dsn of database connection and connect
489  require_once("./Services/Database/classes/class.ilDBWrapperFactory.php");
490  $ilDB = ilDBWrapperFactory::getWrapper(IL_DB_TYPE);
491  $ilDB->initFromIniFile();
492  $ilDB->connect();
493 
494  self::initGlobal("ilDB", $ilDB);
495  }
global $ilDB

◆ initFileUploadService()

static ilInitialisation::initFileUploadService ( \ILIAS\DI\Container  $dic)
static

Initializes the file upload service.

This service requires the http and filesystem service.

Parameters
\ILIAS\DI\Container$dicThe dependency container which should be used to load the file upload service.
Returns
void

Definition at line 270 of file class.ilInitialisation.php.

References ilVirusScannerFactory\_getInstance().

271  {
272  $dic['upload.processor-manager'] = function ($c) {
273  return new \ILIAS\FileUpload\Processor\PreProcessorManagerImpl();
274  };
275 
276  $dic['upload'] = function ($c) {
277  $fileUploadImpl = new \ILIAS\FileUpload\FileUploadImpl($c['upload.processor-manager'], $c['filesystem'], $c['http']);
278  if (IL_VIRUS_SCANNER != "None") {
279  $fileUploadImpl->register(new \ILIAS\FileUpload\Processor\VirusScannerPreProcessor(ilVirusScannerFactory::_getInstance()));
280  }
281 
282  return $fileUploadImpl;
283  };
284  }
Class BaseForm.
+ Here is the call graph for this function:

◆ initGlobal()

static ilInitialisation::initGlobal (   $a_name,
  $a_class,
  $a_source_file = null 
)
staticprotected

Initialize global instance.

Parameters
string$a_name
string$a_class
string$a_source_file

Definition at line 890 of file class.ilInitialisation.php.

References $DIC, and $GLOBALS.

891  {
892  global $DIC;
893 
894  if ($a_source_file) {
895  include_once $a_source_file;
896  $GLOBALS[$a_name] = new $a_class;
897  } else {
898  $GLOBALS[$a_name] = $a_class;
899  }
900 
901  $DIC[$a_name] = function ($c) use ($a_name) {
902  return $GLOBALS[$a_name];
903  };
904  }
global $DIC
Definition: saml.php:7
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

◆ initHTML()

static ilInitialisation::initHTML ( )
staticprotected

init HTML output (level 3)

Definition at line 1392 of file class.ilInitialisation.php.

References $_GET, $GLOBALS, $ilUser, $tpl, ilUtil\getStyleSheetLocation(), ilContext\hasUser(), and ilSession\set().

1393  {
1394  global $ilUser;
1395  require_once "./Services/LTI/classes/class.ilLTIViewGUI.php";
1396  $lti = new ilLTIViewGUI($ilUser);
1397  $GLOBALS["DIC"]["lti"] = $lti;
1398 
1399  if (ilContext::hasUser()) {
1400  // load style definitions
1401  // use the init function with plugin hook here, too
1402  self::initStyle();
1403  }
1404 
1405  self::initUIFramework($GLOBALS["DIC"]);
1406 
1407  // LTI
1408  if ($lti->isActive()) {
1409  include_once "./Services/LTI/classes/class.ilTemplate.php";
1410  $tpl = new LTI\ilTemplate("tpl.main.html", true, true, "Services/LTI");
1411  } else {
1412  $tpl = new ilTemplate("tpl.main.html", true, true);
1413  }
1414 
1415  self::initGlobal("tpl", $tpl);
1416 
1417  if (ilContext::hasUser()) {
1418  require_once 'Services/User/classes/class.ilUserRequestTargetAdjustment.php';
1419  $request_adjuster = new ilUserRequestTargetAdjustment($ilUser, $GLOBALS['DIC']['ilCtrl']);
1420  $request_adjuster->adjust();
1421  }
1422 
1423 
1424  // load style sheet depending on user's settings
1425  $location_stylesheet = ilUtil::getStyleSheetLocation();
1426  $tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet);
1427 
1428  require_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
1429 
1430  self::initGlobal(
1431  "ilNavigationHistory",
1432  "ilNavigationHistory",
1433  "Services/Navigation/classes/class.ilNavigationHistory.php"
1434  );
1435 
1436  self::initGlobal(
1437  "ilBrowser",
1438  "ilBrowser",
1439  "./Services/Utilities/classes/class.ilBrowser.php"
1440  );
1441 
1442  self::initGlobal(
1443  "ilHelp",
1444  "ilHelpGUI",
1445  "Services/Help/classes/class.ilHelpGUI.php"
1446  );
1447 
1448  self::initGlobal(
1449  "ilToolbar",
1450  "ilToolbarGUI",
1451  "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php"
1452  );
1453 
1454  self::initGlobal(
1455  "ilLocator",
1456  "ilLocatorGUI",
1457  "./Services/Locator/classes/class.ilLocatorGUI.php"
1458  );
1459 
1460  self::initGlobal(
1461  "ilTabs",
1462  "ilTabsGUI",
1463  "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php"
1464  );
1465 
1466  if (ilContext::hasUser()) {
1467  // LTI
1468  if ($lti->isActive()) {
1469  include_once './Services/LTI/classes/class.ilMainMenuGUI.php';
1470  $ilMainMenu = new LTI\ilMainMenuGUI("_top");
1471  } else {
1472  include_once './Services/MainMenu/classes/class.ilMainMenuGUI.php';
1473  $ilMainMenu = new ilMainMenuGUI("_top");
1474  }
1475 
1476  self::initGlobal("ilMainMenu", $ilMainMenu);
1477  unset($ilMainMenu);
1478 
1479  // :TODO: tableGUI related
1480 
1481  // set hits per page for all lists using table module
1482  $_GET['limit'] = (int) $ilUser->getPref('hits_per_page');
1483  ilSession::set('tbl_limit', $_GET['limit']);
1484 
1485  // the next line makes it impossible to save the offset somehow in a session for
1486  // a specific table (I tried it for the user administration).
1487  // its not posssible to distinguish whether it has been set to page 1 (=offset = 0)
1488  // or not set at all (then we want the last offset, e.g. being used from a session var).
1489  // So I added the wrapping if statement. Seems to work (hopefully).
1490  // Alex April 14th 2006
1491  if (isset($_GET['offset']) && $_GET['offset'] != "") { // added April 14th 2006
1492  $_GET['offset'] = (int) $_GET['offset']; // old code
1493  }
1494  } else {
1495  // several code parts rely on ilObjUser being always included
1496  include_once "Services/User/classes/class.ilObjUser.php";
1497  }
1498  }
Handles display of the main menu.
static hasUser()
Based on user authentication?
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
$tpl
Definition: ilias.php:10
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static set($a_var, $a_val)
Set a value.
special template class to simplify handling of ITX/PEAR
$ilUser
Definition: imgupload.php:18
Class ilUserAccountMaintenanceEnforcement.
class for ILIAS ViewLTI
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:

◆ initHTTPServices()

static ilInitialisation::initHTTPServices ( \ILIAS\DI\Container  $container)
staticprotected
Parameters
\ILIAS\DI\Container$container

Definition at line 1320 of file class.ilInitialisation.php.

1321  {
1322  $container['http.request_factory'] = function ($c) {
1323  return new \ILIAS\HTTP\Request\RequestFactoryImpl();
1324  };
1325 
1326  $container['http.response_factory'] = function ($c) {
1327  return new \ILIAS\HTTP\Response\ResponseFactoryImpl();
1328  };
1329 
1330  $container['http.cookie_jar_factory'] = function ($c) {
1331  return new \ILIAS\HTTP\Cookies\CookieJarFactoryImpl();
1332  };
1333 
1334  $container['http.response_sender_strategy'] = function ($c) {
1335  return new \ILIAS\HTTP\Response\Sender\DefaultResponseSenderStrategy();
1336  };
1337 
1338  $container['http'] = function ($c) {
1339  return new \ILIAS\DI\HTTPServices(
1340  $c['http.response_sender_strategy'],
1341  $c['http.cookie_jar_factory'],
1342  $c['http.request_factory'],
1343  $c['http.response_factory']
1344  );
1345  };
1346  }
$container
Definition: wac.php:13

◆ initILIAS()

static ilInitialisation::initILIAS ( )
static

ilias initialisation

Definition at line 949 of file class.ilInitialisation.php.

References $GLOBALS, $tpl, ilLoggerFactory\getInstance(), ilUtil\getStyleSheetLocation(), ilContext\hasHTML(), ilContext\hasUser(), ilContext\initClient(), ilECSTaskScheduler\start(), and ilContext\supportsPersistentSessions().

Referenced by ilSoapFunctions\__call(), ilSoapAdministration\getClientInfoXML(), ilSoapAdministration\getInstallationInfoXML(), ilNusoapUserAdministrationAdapter\handleSoapPlugins(), ilCalendarRemoteAccessHandler\initIlias(), and ilWebAccessChecker\initILIAS().

950  {
951  if (self::$already_initialized) {
952  // workaround for bug #17990
953  // big mess. we prevent double initialisations with ILIAS 5.1, which is good, but...
954  // the style service uses $_GET["ref_id"] to determine
955  // the context styles. $_GET["ref_id"] is "corrected" by the "goto" procedure and which calls
956  // initILIAS again.
957  // we need a mechanism that detemines our repository context and stores that in an information object
958  // usable by the style component afterwars. This needs new concepts and a refactoring.
959  if (ilContext::initClient()) {
960  global $tpl;
961  if (is_object($tpl)) {
962  // load style sheet depending on user's settings
963  $location_stylesheet = ilUtil::getStyleSheetLocation();
964  $tpl->setVariable("LOCATION_STYLESHEET", $location_stylesheet);
965  }
966  }
967 
968  return;
969  }
970 
971  $GLOBALS["DIC"] = new \ILIAS\DI\Container();
972  $GLOBALS["DIC"]["ilLoggerFactory"] = function ($c) {
974  };
975 
976  self::$already_initialized = true;
977 
978  self::initCore();
979  self::initHTTPServices($GLOBALS["DIC"]);
980  if (ilContext::initClient()) {
981  self::initClient();
982  self::initFileUploadService($GLOBALS["DIC"]);
983  self::initSession();
984 
985  if (ilContext::hasUser()) {
986  self::initUser();
987 
989  self::resumeUserSession();
990  }
991  }
992 
993  // init after Auth otherwise breaks CAS
994  self::includePhp5Compliance();
995 
996  // language may depend on user setting
997  self::initLanguage(true);
998  $GLOBALS['DIC']['tree']->initLangCode();
999 
1000  self::initInjector($GLOBALS['DIC']);
1001  self::initBackgroundTasks($GLOBALS['DIC']);
1002 
1003  if (ilContext::hasHTML()) {
1004  include_once('./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
1006 
1007  self::initHTML();
1008  }
1009  }
1010  }
static hasUser()
Based on user authentication?
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$tpl
Definition: ilias.php:10
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static start()
Start task scheduler for each server instance.
static hasHTML()
Has HTML output.
static supportsPersistentSessions()
Check if context supports persistent session handling.
static initClient()
Init client.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initIliasIniFile()

static ilInitialisation::initIliasIniFile ( )
staticprotected

This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilIliasIniFile.

It initializes a lot of constants accordingly to the settings in the ilias.ini.php file.

Definition at line 110 of file class.ilInitialisation.php.

References $DIC, $ilIliasIniFile, $tz, and ilTimeZone\initDefaultTimeZone().

111  {
112  require_once("./Services/Init/classes/class.ilIniFile.php");
113  $ilIliasIniFile = new ilIniFile("./ilias.ini.php");
114  $ilIliasIniFile->read();
115  self::initGlobal('ilIliasIniFile', $ilIliasIniFile);
116 
117  // initialize constants
118  define("ILIAS_DATA_DIR", $ilIliasIniFile->readVariable("clients", "datadir"));
119  define("ILIAS_WEB_DIR", $ilIliasIniFile->readVariable("clients", "path"));
120  define("ILIAS_ABSOLUTE_PATH", $ilIliasIniFile->readVariable('server', 'absolute_path'));
121 
122  // logging
123  define("ILIAS_LOG_DIR", $ilIliasIniFile->readVariable("log", "path"));
124  define("ILIAS_LOG_FILE", $ilIliasIniFile->readVariable("log", "file"));
125  define("ILIAS_LOG_ENABLED", $ilIliasIniFile->readVariable("log", "enabled"));
126  define("ILIAS_LOG_LEVEL", $ilIliasIniFile->readVariable("log", "level"));
127  define("SLOW_REQUEST_TIME", $ilIliasIniFile->readVariable("log", "slow_request_time"));
128 
129  // read path + command for third party tools from ilias.ini
130  define("PATH_TO_CONVERT", $ilIliasIniFile->readVariable("tools", "convert"));
131  define("PATH_TO_FFMPEG", $ilIliasIniFile->readVariable("tools", "ffmpeg"));
132  define("PATH_TO_ZIP", $ilIliasIniFile->readVariable("tools", "zip"));
133  define("PATH_TO_MKISOFS", $ilIliasIniFile->readVariable("tools", "mkisofs"));
134  define("PATH_TO_UNZIP", $ilIliasIniFile->readVariable("tools", "unzip"));
135  define("PATH_TO_GHOSTSCRIPT", $ilIliasIniFile->readVariable("tools", "ghostscript"));
136  define("PATH_TO_JAVA", $ilIliasIniFile->readVariable("tools", "java"));
137  define("URL_TO_LATEX", $ilIliasIniFile->readVariable("tools", "latex"));
138  define("PATH_TO_FOP", $ilIliasIniFile->readVariable("tools", "fop"));
139  define("PATH_TO_LESSC", $ilIliasIniFile->readVariable("tools", "lessc"));
140  define("PATH_TO_PHANTOMJS", $ilIliasIniFile->readVariable("tools", "phantomjs"));
141 
142  // read virus scanner settings
143  switch ($ilIliasIniFile->readVariable("tools", "vscantype")) {
144  case "sophos":
145  define("IL_VIRUS_SCANNER", "Sophos");
146  define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
147  define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
148  break;
149 
150  case "antivir":
151  define("IL_VIRUS_SCANNER", "AntiVir");
152  define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
153  define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
154  break;
155 
156  case "clamav":
157  define("IL_VIRUS_SCANNER", "ClamAV");
158  define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
159  define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
160  break;
161 
162  default:
163  define("IL_VIRUS_SCANNER", "None");
164  break;
165  }
166 
167  include_once './Services/Calendar/classes/class.ilTimeZone.php';
169  define("IL_TIMEZONE", $tz);
170  }
static initDefaultTimeZone(ilIniFile $ini)
Initialize default timezone from system settings.
$ilIliasIniFile
INIFile Parser.
+ Here is the call graph for this function:

◆ initInjector()

static ilInitialisation::initInjector ( \ILIAS\DI\Container  $c)
staticprivate

Definition at line 1774 of file class.ilInitialisation.php.

1775  {
1776  $c["di.dependency_map"] = function ($c) {
1777  return new \ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap();
1778  };
1779 
1780  $c["di.injector"] = function ($c) {
1781  return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, $c["di.dependency_map"]);
1782  };
1783  }

◆ initLocale()

static ilInitialisation::initLocale ( )
staticprotected

Init Locale.

Definition at line 701 of file class.ilInitialisation.php.

References $GLOBALS, $ilSetting, $l, and array.

702  {
703  global $ilSetting;
704 
705  if (trim($ilSetting->get("locale") != "")) {
706  $larr = explode(",", trim($ilSetting->get("locale")));
707  $ls = array();
708  $first = $larr[0];
709  foreach ($larr as $l) {
710  if (trim($l) != "") {
711  $ls[] = $l;
712  }
713  }
714  if (count($ls) > 0) {
715  setlocale(LC_ALL, $ls);
716 
717  // #15347 - making sure that floats are not changed
718  setlocale(LC_NUMERIC, "C");
719 
720  if (class_exists("Collator")) {
721  $GLOBALS["ilCollator"] = new Collator($first);
722  $GLOBALS["DIC"]["ilCollator"] = function ($c) {
723  return $GLOBALS["ilCollator"];
724  };
725  }
726  }
727  }
728  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
global $l
Definition: afr.php:30
global $ilSetting
Definition: privfeed.php:17

◆ initLog()

static ilInitialisation::initLog ( )
staticprotected

Init log instance.

Definition at line 873 of file class.ilInitialisation.php.

References $log, and ilLoggerFactory\getRootLogger().

874  {
875  include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
877 
878  self::initGlobal("ilLog", $log);
879  // deprecated
880  self::initGlobal("log", $log);
881  }
static getRootLogger()
The unique root logger has a fixed error level.
+ Here is the call graph for this function:

◆ initMail()

static ilInitialisation::initMail ( \ILIAS\DI\Container  $c)
staticprotected
Parameters
\ILIAS\DI\Container$c

Definition at line 583 of file class.ilInitialisation.php.

584  {
585  $c["mail.mime.transport.factory"] = function ($c) {
586  require_once 'Services/Mail/classes/Mime/Transport/class.ilMailMimeTransportFactory.php';
587  return new ilMailMimeTransportFactory($c["ilSetting"]);
588  };
589  $c["mail.mime.sender.factory"] = function ($c) {
590  require_once 'Services/Mail/classes/Mime/Sender/class.ilMailMimeSenderFactory.php';
591  return new ilMailMimeSenderFactory($c["ilSetting"]);
592  };
593  }
Class ilMailMimeSenderFactory.

◆ initSession()

static ilInitialisation::initSession ( )
staticprotected

Init auth session.

Definition at line 1015 of file class.ilInitialisation.php.

References $GLOBALS, and ilAuthSession\getInstance().

1016  {
1017  $GLOBALS["DIC"]["ilAuthSession"] = function ($c) {
1018  $auth_session = ilAuthSession::getInstance(
1019  $c['ilLoggerFactory']->getLogger('auth')
1020  );
1021  $auth_session->init();
1022  return $auth_session;
1023  };
1024  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static getInstance(\ilLogger $logger)
Get instance.
+ Here is the call graph for this function:

◆ initSettings()

static ilInitialisation::initSettings ( )
staticprotected

initialise $ilSettings object and define constants

Used in Soap

Definition at line 611 of file class.ilInitialisation.php.

References $ilSetting, and ilContext\usesHTTP().

612  {
613  global $ilSetting;
614 
615  self::initGlobal(
616  "ilSetting",
617  "ilSetting",
618  "Services/Administration/classes/class.ilSetting.php"
619  );
620 
621  // check correct setup
622  if (!$ilSetting->get("setup_ok")) {
623  self::abortAndDie("Setup is not completed. Please run setup routine again.");
624  }
625 
626  // set anonymous user & role id and system role id
627  define("ANONYMOUS_USER_ID", $ilSetting->get("anonymous_user_id"));
628  define("ANONYMOUS_ROLE_ID", $ilSetting->get("anonymous_role_id"));
629  define("SYSTEM_USER_ID", $ilSetting->get("system_user_id"));
630  define("SYSTEM_ROLE_ID", $ilSetting->get("system_role_id"));
631  define("USER_FOLDER_ID", 7);
632 
633  // recovery folder
634  define("RECOVERY_FOLDER_ID", $ilSetting->get("recovery_folder_id"));
635 
636  // installation id
637  define("IL_INST_ID", $ilSetting->get("inst_id", 0));
638 
639  // define default suffix replacements
640  define("SUFFIX_REPL_DEFAULT", "php,php3,php4,inc,lang,phtml,htaccess");
641  define("SUFFIX_REPL_ADDITIONAL", $ilSetting->get("suffix_repl_additional"));
642 
643  if (ilContext::usesHTTP()) {
644  self::buildHTTPPath();
645  }
646  }
static usesHTTP()
Uses HTTP aka browser.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ initStyle()

static ilInitialisation::initStyle ( )
staticprotected

provide $styleDefinition object

Definition at line 651 of file class.ilInitialisation.php.

References $GLOBALS, $ilUser, array, ilLoggerFactory\getInstance(), ilPluginAdmin\getPluginObject(), and IL_COMP_SERVICE.

652  {
653  global $styleDefinition, $ilPluginAdmin;
654 
655  // load style definitions
656  self::initGlobal(
657  "styleDefinition",
658  "ilStyleDefinition",
659  "./Services/Style/System/classes/class.ilStyleDefinition.php"
660  );
661 
662  // add user interface hook for style initialisation
663  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
664  foreach ($pl_names as $pl) {
665  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
666  $gui_class = $ui_plugin->getUIClassInstance();
667  $gui_class->modifyGUI("Services/Init", "init_style", array("styleDefinition" => $styleDefinition));
668  }
669  }
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
Create styles array
The data for the language used.
const IL_COMP_SERVICE
+ Here is the call graph for this function:

◆ initUIFramework()

static ilInitialisation::initUIFramework ( \ILIAS\DI\Container  $c)
staticprotected

init the ILIAS UI framework.

Definition at line 1351 of file class.ilInitialisation.php.

1352  {
1353  $c["ui.factory"] = function ($c) {
1354  return new ILIAS\UI\Implementation\Factory();
1355  };
1356  $c["ui.renderer"] = function ($c) {
1358  $c["ui.component_renderer_loader"]
1359  );
1360  };
1361  $c["ui.component_renderer_loader"] = function ($c) {
1363  new ILIAS\UI\Implementation\Render\LoaderResourceRegistryWrapper(
1364  $c["ui.resource_registry"],
1365  new ILIAS\UI\Implementation\Render\FSLoader(
1366  new ILIAS\UI\Implementation\Render\DefaultRendererFactory(
1367  $c["ui.factory"],
1368  $c["ui.template_factory"],
1369  $c["lng"],
1370  $c["ui.javascript_binding"]
1371  )
1372  )
1373  )
1374  );
1375  };
1376  $c["ui.template_factory"] = function ($c) {
1378  $c["tpl"]
1379  );
1380  };
1381  $c["ui.resource_registry"] = function ($c) {
1383  };
1384  $c["ui.javascript_binding"] = function ($c) {
1386  };
1387  }
Class Factory.
Class BaseForm.
Wraps global ilTemplate to provide JavaScriptBinding.
Caches renderers loaded by another loader.

◆ initUser()

static ilInitialisation::initUser ( )
staticprotected

Init user / authentification (level 2)

Definition at line 1188 of file class.ilInitialisation.php.

References $ilUser.

1189  {
1190  global $ilias, $ilUser;
1191 
1192  // $ilUser
1193  self::initGlobal(
1194  "ilUser",
1195  "ilObjUser",
1196  "./Services/User/classes/class.ilObjUser.php"
1197  );
1198  $ilias->account = $ilUser;
1199 
1200  self::initAccessHandling();
1201  }
$ilUser
Definition: imgupload.php:18

◆ recursivelyRemoveUnsafeCharacters()

static ilInitialisation::recursivelyRemoveUnsafeCharacters (   $var)
staticprotected

Definition at line 50 of file class.ilInitialisation.php.

References array.

51  {
52  if (is_array($var)) {
53  $mod = [];
54  foreach ($var as $k => $v) {
55  $k = self::recursivelyRemoveUnsafeCharacters($k);
56  $mod[$k] = self::recursivelyRemoveUnsafeCharacters($v);
57  }
58  return $mod;
59  }
60  return strip_tags(
61  str_replace(
62  array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"),
63  "",
64  $var
65  )
66  );
67  }
Create styles array
The data for the language used.

◆ redirect()

static ilInitialisation::redirect (   $a_target,
  $a_message_id = '',
array  $a_message_static = null 
)
staticprotected

Redirects to target url if context supports it.

Parameters
string$a_target
string$a_message_id
array$a_message_details

Definition at line 1668 of file class.ilInitialisation.php.

References $_GET, $ilUser, $message, array, defined, ilLoggerFactory\getLogger(), ilUserUtil\getStartingPointAsUrl(), goToPublicSection(), ilContext\hasHTML(), ilUtil\redirect(), ilContext\supportsRedirects(), and ilContext\usesHTTP().

1669  {
1670  // #12739
1671  if (defined("ILIAS_HTTP_PATH") &&
1672  !stristr($a_target, ILIAS_HTTP_PATH)) {
1673  $a_target = ILIAS_HTTP_PATH . "/" . $a_target;
1674  }
1675 
1677  ilUtil::redirect($a_target);
1678  } else {
1679  $message = self::translateMessage($a_message_id, $a_message_static);
1680 
1681  // user-directed linked message
1683  $link = self::translateMessage(
1684  "init_error_redirect_click",
1685  array("en" => 'Please click to continue.',
1686  "de" => 'Bitte klicken um fortzufahren.')
1687  );
1688  $mess = $message .
1689  '<br /><a href="' . $a_target . '">' . $link . '</a>';
1690  }
1691  // plain text
1692  else {
1693  // not much we can do here
1694  $mess = $message;
1695 
1696  if (!trim($mess)) {
1697  $mess = self::translateMessage(
1698  "init_error_redirect_info",
1699  array("en" => 'Redirect not supported by context.',
1700  "de" => 'Weiterleitungen werden durch Kontext nicht unterstützt.')
1701  ) .
1702  ' (' . $a_target . ')';
1703  }
1704  }
1705 
1706  self::abortAndDie($mess);
1707  }
1708  }
static usesHTTP()
Uses HTTP aka browser.
catch(Exception $e) $message
static hasHTML()
Has HTML output.
Create styles array
The data for the language used.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
static redirect($a_script)
static supportsRedirects()
Are redirects supported?
+ Here is the call graph for this function:

◆ reinitILIAS()

static ilInitialisation::reinitILIAS ( )
static

Definition at line 940 of file class.ilInitialisation.php.

Referenced by ilWebAccessChecker\addAppliedCheckingMethod(), and ilSoapAdministration\initIlias().

941  {
942  self::$already_initialized = false;
943  self::initILIAS();
944  }
+ Here is the caller graph for this function:

◆ removeUnsafeCharacters()

static ilInitialisation::removeUnsafeCharacters ( )
staticprotected

Remove unsafe characters from GET.

Definition at line 41 of file class.ilInitialisation.php.

References $_GET.

42  {
43  // Remove unsafe characters from GET parameters.
44  // We do not need this characters in any case, so it is
45  // feasible to filter them everytime. POST parameters
46  // need attention through ilUtil::stripSlashes() and similar functions)
47  $_GET = self::recursivelyRemoveUnsafeCharacters($_GET);
48  }
$_GET["client_id"]

◆ requireCommonIncludes()

static ilInitialisation::requireCommonIncludes ( )
staticprotected

get common include code files

Definition at line 72 of file class.ilInitialisation.php.

References ilContext\usesTemplate().

73  {
74  // ilTemplate
76  require_once "./Services/UICore/classes/class.ilTemplate.php";
77  }
78 
79  // really always required?
80  require_once "./Services/Utilities/classes/class.ilUtil.php";
81  require_once "./Services/Calendar/classes/class.ilDatePresentation.php";
82  require_once "include/inc.ilias_version.php";
83 
84  include_once './Services/Authentication/classes/class.ilAuthUtils.php';
85 
86  self::initGlobal("ilBench", "ilBenchmark", "./Services/Utilities/classes/class.ilBenchmark.php");
87  }
static usesTemplate()
Uses template engine.
+ Here is the call graph for this function:

◆ resumeUserSession()

static ilInitialisation::resumeUserSession ( )
static

Resume an existing user session.

Definition at line 1206 of file class.ilInitialisation.php.

References $_SERVER, $GLOBALS, ilLoggerFactory\getLogger(), ilAuthUtils\handleForcedAuthentication(), and ilAuthUtils\isAuthenticationForced().

1207  {
1208  include_once './Services/Authentication/classes/class.ilAuthUtils.php';
1211  }
1212 
1213  if (
1214  !$GLOBALS['DIC']['ilAuthSession']->isAuthenticated() or
1215  $GLOBALS['DIC']['ilAuthSession']->isExpired()
1216  ) {
1217  ilLoggerFactory::getLogger('init')->debug('Current session is invalid: ' . $GLOBALS['DIC']['ilAuthSession']->getId());
1218  $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1219  if (self::blockedAuthentication($current_script)) {
1220  ilLoggerFactory::getLogger('init')->debug('Authentication is started in current script.');
1221  // nothing todo: authentication is done in current script
1222  return;
1223  }
1224  return self::handleAuthenticationFail();
1225  }
1226  // valid session
1227  return self::initUserAccount();
1228  }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static isAuthenticationForced()
Check if authentication is should be forced.
static handleForcedAuthentication()
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

◆ setCookieConstants()

static ilInitialisation::setCookieConstants ( )
staticprotected

Definition at line 526 of file class.ilInitialisation.php.

References $_SERVER, $cookie_path, $GLOBALS, ilAuthFactory\CONTEXT_HTTP, and ilAuthFactory\getContext().

527  {
528  include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
530  $cookie_path = '/';
531  } elseif ($GLOBALS['COOKIE_PATH']) {
532  // use a predefined cookie path from WebAccessChecker
533  $cookie_path = $GLOBALS['COOKIE_PATH'];
534  } else {
535  $cookie_path = dirname($_SERVER['PHP_SELF']);
536  }
537 
538  /* if ilias is called directly within the docroot $cookie_path
539  is set to '/' expecting on servers running under windows..
540  here it is set to '\'.
541  in both cases a further '/' won't be appended due to the following regex
542  */
543  $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
544 
545  if ($cookie_path == "\\") {
546  $cookie_path = '/';
547  }
548 
549  define('IL_COOKIE_HTTPONLY', true); // Default Value
550  define('IL_COOKIE_EXPIRE', 0);
551  define('IL_COOKIE_PATH', $cookie_path);
552  define('IL_COOKIE_DOMAIN', '');
553  }
$cookie_path
Definition: metadata.php:7
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ Here is the call graph for this function:

◆ setSessionCookieParams()

static ilInitialisation::setSessionCookieParams ( )
staticprotected

set session cookie params

Definition at line 558 of file class.ilInitialisation.php.

References $ilSetting, defined, ilHTTPS\getInstance(), and IL_COOKIE_PATH.

559  {
560  global $ilSetting;
561 
562  if (!defined('IL_COOKIE_SECURE')) {
563  // If this code is executed, we can assume that \ilHTTPS::enableSecureCookies was NOT called before
564  // \ilHTTPS::enableSecureCookies already executes session_set_cookie_params()
565 
566  include_once './Services/Http/classes/class.ilHTTPS.php';
567  $cookie_secure = !$ilSetting->get('https', 0) && ilHTTPS::getInstance()->isDetected();
568  define('IL_COOKIE_SECURE', $cookie_secure); // Default Value
569 
570  session_set_cookie_params(
571  IL_COOKIE_EXPIRE,
573  IL_COOKIE_DOMAIN,
574  IL_COOKIE_SECURE,
575  IL_COOKIE_HTTPONLY
576  );
577  }
578  }
const IL_COOKIE_PATH(isset($_GET["client_id"]))
Definition: metadata.php:36
static getInstance()
Get https instance.
global $ilSetting
Definition: privfeed.php:17
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
+ Here is the call graph for this function:

◆ setSessionHandler()

static ilInitialisation::setSessionHandler ( )
static

set session handler to db

Used in Soap/CAS

Definition at line 502 of file class.ilInitialisation.php.

References ilSession\_exists(), and defined.

503  {
504  if (ini_get('session.save_handler') != 'user' && version_compare(PHP_VERSION, '7.2.0', '<')) {
505  ini_set("session.save_handler", "user");
506  }
507 
508  require_once "Services/Authentication/classes/class.ilSessionDBHandler.php";
509  $db_session_handler = new ilSessionDBHandler();
510  if (!$db_session_handler->setSaveHandler()) {
511  self::abortAndDie("Please turn off Safe mode OR set session.save_handler to \"user\" in your php.ini");
512  }
513 
514  // Do not accept external session ids
515  if (!ilSession::_exists(session_id()) && !defined('IL_PHPUNIT_TEST')) {
516  // php7-todo, correct-with-php5-removal : alex, 1.3.2016: added if, please check
517  if (function_exists("session_status") && session_status() == PHP_SESSION_ACTIVE) {
518  session_regenerate_id();
519  }
520  }
521  }
Database Session Handling.
static _exists($a_session_id)
Check whether session exists.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27
+ Here is the call graph for this function:

◆ showingLoginForm()

static ilInitialisation::showingLoginForm (   $a_current_script)
staticprotected

Is current view the login form?

Returns
boolean

Definition at line 1601 of file class.ilInitialisation.php.

1602  {
1603  if ($a_current_script == "login.php") {
1604  return true;
1605  }
1606 
1607  if ($_REQUEST["baseClass"] == "ilStartUpGUI" &&
1608  self::getCurrentCmd() == "showLoginPage") {
1609  return true;
1610  }
1611 
1612  return false;
1613  }

◆ translateMessage()

static ilInitialisation::translateMessage (   $a_message_id,
array  $a_message_static = null 
)
staticprotected

Translate message if possible.

Parameters
string$a_message_id
array$a_message_static
Returns
string

Definition at line 1622 of file class.ilInitialisation.php.

References $ilDB, $ilSetting, $ilUser, $lang, $lng, $message, and string.

1623  {
1624  global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
1625 
1626  // current language
1627  if (!$lng) {
1628  $lang = "en";
1629  if ($ilUser) {
1630  $lang = $ilUser->getLanguage();
1631  } elseif ($_REQUEST["lang"]) {
1632  $lang = (string) $_REQUEST["lang"];
1633  } elseif ($ilSetting) {
1634  $lang = $ilSetting->get("language");
1635  } elseif ($ilClientIniFile) {
1636  $lang = $ilClientIniFile->readVariable("language", "default");
1637  }
1638  } else {
1639  $lang = $lng->getLangKey();
1640  }
1641 
1642  $message = "";
1643  if ($ilDB && $a_message_id) {
1644  if (!$lng) {
1645  require_once "./Services/Language/classes/class.ilLanguage.php";
1646  $lng = new ilLanguage($lang);
1647  }
1648 
1649  $lng->loadLanguageModule("init");
1650  $message = $lng->txt($a_message_id);
1651  } elseif (is_array($a_message_static)) {
1652  if (!isset($a_message_static[$lang])) {
1653  $lang = "en";
1654  }
1655  $message = $a_message_static[$lang];
1656  }
1657 
1658  return utf8_decode($message);
1659  }
Add rich text string
catch(Exception $e) $message
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
global $lng
Definition: privfeed.php:17
global $ilDB
language handling

Field Documentation

◆ $already_initialized

ilInitialisation::$already_initialized
staticprotected

Definition at line 937 of file class.ilInitialisation.php.


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