ILIAS  release_7 Revision v7.30-3-g800a261c036
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...

+ Inheritance diagram for ilInitialisation:
+ 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 initUserAccount ()
 Init user with current account id. 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 initUIFramework (\ILIAS\DI\Container $c)
 init the ILIAS UI framework. 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 initResourceStorage ()
 
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 initCustomObjectIcons (\ILIAS\DI\Container $c)
 
static initAvatar (\ILIAS\DI\Container $c)
 
static initTermsOfService (\ILIAS\DI\Container $c)
 
static initAccessibilityControlConcept (\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... initialisation 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 initRefinery (\ILIAS\DI\Container $container)
 
static initHTML ()
 init HTML output (level 3) More...
 
static getCurrentCmd ()
 
static blockedAuthentication ($a_current_script)
 Block authentication based on current request. 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 setClientIdCookie ()
 
static initGlobalScreen (\ILIAS\DI\Container $c)
 
static initBackgroundTasks (\ILIAS\DI\Container $c)
 
static initInjector (\ILIAS\DI\Container $c)
 
static initKioskMode (\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 72 of file class.ilInitialisation.php.

Member Function Documentation

◆ abortAndDie()

static ilInitialisation::abortAndDie (   $a_message)
staticprotected

Exit.

Parameters
string$a_message

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

1118 {
1119 if (is_object($GLOBALS['ilLog'])) {
1120 $GLOBALS['ilLog']->write("Fatal Error: ilInitialisation - " . $a_message);
1121 $GLOBALS['ilLog']->logStack();
1122 }
1123 die($a_message);
1124 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

References $GLOBALS.

Referenced by determineClient(), goToPublicSection(), handleMaintenanceMode(), initClientIniFile(), initSettings(), initUserAccount(), redirect(), and setSessionHandler().

+ Here is the caller graph for this function:

◆ blockedAuthentication()

static ilInitialisation::blockedAuthentication (   $a_current_script)
staticprotected

Block authentication based on current request.

Returns
boolean

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

1897 {
1899 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for WAC request.');
1900 return true;
1901 }
1903 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for sso request.');
1904 return true;
1905 }
1907 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for webdav request');
1908 return true;
1909 }
1911 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for shibboleth request.');
1912 return true;
1913 }
1915 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for lti provider requests.');
1916 return true;
1917 }
1919 ilLoggerFactory::getLogger('init')->debug('Blocked authentication for SAML request.');
1920 return true;
1921 }
1922 if (
1923 $a_current_script == "register.php" ||
1924 $a_current_script == "pwassist.php" ||
1925 $a_current_script == "confirmReg.php" ||
1926 $a_current_script == "il_securimage_play.php" ||
1927 $a_current_script == "il_securimage_show.php" ||
1928 $a_current_script == 'login.php'
1929 ) {
1930 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for script: ' . $a_current_script);
1931 return true;
1932 }
1933
1934 $requestBaseClass = strtolower((string) ($_GET['baseClass'] ?? ''));
1935 if ($requestBaseClass == strtolower(ilStartUpGUI::class)) {
1936 $requestCmdClass = strtolower((string) ($_GET['cmdClass'] ?? ''));
1937 if (
1938 $requestCmdClass == strtolower(ilAccountRegistrationGUI::class) ||
1939 $requestCmdClass == strtolower(ilPasswordAssistanceGUI::class)
1940 ) {
1941 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmdClass: ' . $requestCmdClass);
1942 return true;
1943 }
1944 $cmd = self::getCurrentCmd();
1945 if (
1946 $cmd == "showTermsOfService" ||
1947 $cmd == 'showAccountMigration' || $cmd == 'migrateAccount' ||
1948 $cmd == 'processCode' || $cmd == 'showLoginPage' || $cmd == 'showLogout' ||
1949 $cmd == 'doStandardAuthentication' || $cmd == 'doCasAuthentication'
1950 ) {
1951 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for cmd: ' . $cmd);
1952 return true;
1953 }
1954 }
1955
1956 // #12884
1957 if (($a_current_script == "goto.php" && $_GET["target"] == "impr_0") ||
1958 strtolower((string) $_GET["baseClass"]) == strtolower(ilImprintGUI::class)) {
1959 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for baseClass: ' . $_GET['baseClass']);
1960 return true;
1961 }
1962
1963 if ($a_current_script == 'goto.php' && in_array($_GET['target'], array(
1964 'usr_registration', 'usr_nameassist', 'usr_pwassist', 'usr_agreement'
1965 ))) {
1966 ilLoggerFactory::getLogger('auth')->debug('Blocked authentication for goto target: ' . $_GET['target']);
1967 return true;
1968 }
1969 ilLoggerFactory::getLogger('auth')->debug('Authentication required');
1970 return false;
1971 }
$_GET["client_id"]
const CONTEXT_WEBDAV
const CONTEXT_SHIBBOLETH
const CONTEXT_APACHE_SSO
const CONTEXT_SAML
static getType()
Get context type.
const CONTEXT_LTI_PROVIDER
const CONTEXT_WAC
static getLogger($a_component_id)
Get component logger.

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

+ Here is the call graph for this function:

◆ buildHTTPPath()

static ilInitialisation::buildHTTPPath ( )
staticprotected

builds http path

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

393 {
394 include_once './Services/Http/classes/class.ilHTTPS.php';
395 $https = new ilHTTPS();
396
397 if ($https->isDetected()) {
398 $protocol = 'https://';
399 } else {
400 $protocol = 'http://';
401 }
402 $host = $_SERVER['HTTP_HOST'];
403
404 $rq_uri = strip_tags($_SERVER['REQUEST_URI']);
405
406 // security fix: this failed, if the URI contained "?" and following "/"
407 // -> we remove everything after "?"
408 if (is_int($pos = strpos($rq_uri, "?"))) {
409 $rq_uri = substr($rq_uri, 0, $pos);
410 }
411
412 if (!defined('ILIAS_MODULE')) {
413 $path = pathinfo($rq_uri);
414 if (!$path['extension']) {
415 $uri = $rq_uri;
416 } else {
417 $uri = dirname($rq_uri);
418 }
419 } else {
420 // if in module remove module name from HTTP_PATH
421 $path = dirname($rq_uri);
422
423 // dirname cuts the last directory from a directory path e.g content/classes return content
425
426 $dirs = explode('/', $module);
427 $uri = $path;
428 foreach ($dirs as $dir) {
429 $uri = dirname($uri);
430 }
431 }
432
433 $ilias_http_path = ilContext::modifyHttpPath(implode('', [$protocol, $host, $uri]));
434
435 // remove everything after the first .php in the path
436 $ilias_http_path = preg_replace('/(http|https)(:\/\/)(.*?\/.*?\.php).*/', '$1$2$3', $ilias_http_path);
437
438 $f = new \ILIAS\Data\Factory();
439 $uri = $f->uri(ilUtil::removeTrailingPathSeparators($ilias_http_path));
440
441 $base_URI = $uri->getBaseURI();
442
443 return define('ILIAS_HTTP_PATH', $base_URI);
444 }
static modifyHttpPath(string $httpPath)
HTTPS.
static removeTrailingPathSeparators($path)
$https
Definition: imgupload.php:19
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
const ILIAS_MODULE
Definition: server.php:14

References $_SERVER, Vendor\Package\$f, $https, ILIAS_MODULE, ilContext\modifyHttpPath(), and ilUtil\removeTrailingPathSeparators().

Referenced by initSettings().

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

◆ determineClient()

static ilInitialisation::determineClient ( )
staticprotected

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

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

450 : void
451 {
452 global $ilIliasIniFile;
453
454 if (defined('CLIENT_ID')) {
455 return;
456 }
457
458 // check whether ini file object exists
459 if (!is_object($ilIliasIniFile)) {
460 self::abortAndDie('Fatal Error: ilInitialisation::determineClient called without initialisation of ILIAS ini file object.');
461 }
462
463 $default_client_id = $ilIliasIniFile->readVariable('clients', 'default');
464
465 $client_id_to_use = '';
466 if (isset($_GET['client_id']) && is_string($_GET['client_id'])) {
467 $client_id_to_use = $_GET['client_id'];
468 }
469
470 if ($client_id_to_use === '' && isset($_COOKIE['ilClientId']) && is_string($_COOKIE['ilClientId'])) {
471 $client_id_to_use = $_COOKIE['ilClientId'];
472 }
473
474 $client_id_to_use = $client_id_to_use ?: $default_client_id;
475
476 define('CLIENT_ID', ilUtil::getClientIdByString($client_id_to_use)->toString());
477 }
static abortAndDie($a_message)
Exit.
static getClientIdByString(string $clientId)
$ilIliasIniFile
Definition: imgupload.php:16
$_COOKIE[session_name()]
Definition: xapitoken.php:37

References $_COOKIE, $_GET, $ilIliasIniFile, abortAndDie(), and ilUtil\getClientIdByString().

Referenced by initClient().

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

◆ getCurrentCmd()

static ilInitialisation::getCurrentCmd ( )
staticprotected

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

1879 : string
1880 {
1881 $cmd = $_POST['cmd'] ?? ($_GET['cmd'] ?? '');
1882
1883 if (is_array($cmd)) {
1884 $cmd_keys = array_keys($cmd);
1885 $cmd = array_shift($cmd_keys) ?? '';
1886 }
1887
1888 return $cmd;
1889 }
$_POST["username"]

References $_GET, and $_POST.

Referenced by blockedAuthentication().

+ Here is the caller graph for this function:

◆ goToLogin()

static ilInitialisation::goToLogin ( )
staticprotected

go to login

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

996 {
997 ilLoggerFactory::getLogger('init')->debug('Redirecting to login page.');
998
999 $script = "login.php?target=" . $_GET["target"] . "&client_id=" . CLIENT_ID;
1000
1001 if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
1003
1004 $script .= "&session_expired=1";
1005 }
1006 if (!$GLOBALS['DIC']['ilAuthSession']->isAuthenticated()) {
1008 }
1009
1011 $script,
1012 "init_error_authentication_fail",
1013 array(
1014 "en" => "Authentication failed.",
1015 "de" => "Authentifizierung fehlgeschlagen.")
1016 );
1017 }
static redirect($a_target, $a_message_id='', array $a_message_static=null)
Redirects to target url if context supports it.
static setClosingContext($a_context)
set closing context (for statistics)
const SESSION_CLOSE_LOGIN
const SESSION_CLOSE_EXPIRE
const CLIENT_ID
Definition: constants.php:39

References $_GET, $GLOBALS, CLIENT_ID, ilLoggerFactory\getLogger(), redirect(), ilSession\SESSION_CLOSE_EXPIRE, ilSession\SESSION_CLOSE_LOGIN, and ilSession\setClosingContext().

+ 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 942 of file class.ilInitialisation.php.

943 {
944 global $ilAuth;
945
946 if (ANONYMOUS_USER_ID == "") {
947 self::abortAndDie("Public Section enabled, but no Anonymous user found.");
948 }
949
950 $session_destroyed = false;
951 if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
952 $session_destroyed = true;
954 }
955 if (!$GLOBALS['DIC']['ilAuthSession']->isAuthenticated()) {
956 $session_destroyed = true;
958 }
959
960 if ($session_destroyed) {
961 $GLOBALS['DIC']['ilAuthSession']->setAuthenticated(true, ANONYMOUS_USER_ID);
962 }
963
965
966 // if target given, try to go there
967 if (strlen($_GET["target"])) {
968 // when we are already "inside" goto.php no redirect is needed
969 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
970 if ($current_script == "goto.php") {
971 return;
972 }
973 // goto will check if target is accessible or redirect to login
974 self::redirect("goto.php?target=" . $_GET["target"]);
975 }
976
977 // check access of root folder otherwise redirect to login
978 #if(!$GLOBALS['DIC']->rbac()->system()->checkAccess('read', ROOT_FOLDER_ID))
979 #{
980 # return self::goToLogin();
981 #}
982
983 // we do not know if ref_id of request is accesible, so redirecting to root
984 $_GET["ref_id"] = ROOT_FOLDER_ID;
985 $_GET["cmd"] = "frameset";
987 "ilias.php?baseClass=ilrepositorygui&reloadpublic=1&cmd=" .
988 $_GET["cmd"] . "&ref_id=" . $_GET["ref_id"]
989 );
990 }
static initUserAccount()
Init user with current account id.
const SESSION_CLOSE_PUBLIC
const ANONYMOUS_USER_ID
Definition: constants.php:25
const ROOT_FOLDER_ID
Definition: constants.php:30

References $_GET, $_SERVER, $GLOBALS, abortAndDie(), ANONYMOUS_USER_ID, initUserAccount(), redirect(), ROOT_FOLDER_ID, ilSession\SESSION_CLOSE_EXPIRE, ilSession\SESSION_CLOSE_PUBLIC, and ilSession\setClosingContext().

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

+ 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 1129 of file class.ilInitialisation.php.

1130 {
1131 if (defined(SHOWNOTICES) && SHOWNOTICES) {
1132 // no further differentiating of php version regarding to 5.4 neccessary
1133 // when the error reporting is set to E_ALL anyway
1134
1135 // add notices to error reporting
1136 error_reporting(E_ALL);
1137 } else {
1138 error_reporting(E_ALL & ~E_NOTICE);
1139 }
1140
1141 if (defined('DEBUGTOOLS') && DEBUGTOOLS) {
1142 include_once "include/inc.debug.php";
1143 }
1144 }

Referenced by initClient().

+ Here is the caller graph for this function:

◆ handleErrorReporting()

static ilInitialisation::handleErrorReporting ( )
static

Set error reporting level.

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

1223 {
1224 // push the error level as high as possible / sane
1225 error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
1226
1227 // see handleDevMode() - error reporting might be overwritten again
1228 // but we need the client ini first
1229 }

Referenced by ilWebAccessCheckerDelivery\handleRequest(), and initCore().

+ Here is the caller graph for this function:

◆ handleMaintenanceMode()

static ilInitialisation::handleMaintenanceMode ( )
staticprotected

handle maintenance mode

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

571 {
572 global $ilClientIniFile;
573
574 if (!$ilClientIniFile->readVariable("client", "access")) {
575 $mess = array(
576 "en" => "The server is not available due to maintenance." .
577 " We apologise for any inconvenience.",
578 "de" => "Der Server ist aufgrund von Wartungsarbeiten aktuell nicht verfügbar." .
579 " Wir bitten um Verständnis. Versuchen Sie es später noch einmal."
580 );
581 $mess_id = "init_error_maintenance";
582
583 if (ilContext::hasHTML() && is_file("./maintenance.html")) {
584 self::redirect("./maintenance.html", $mess_id, $mess);
585 } else {
586 $mess = self::translateMessage($mess_id, $mess);
587 self::abortAndDie($mess);
588 }
589 }
590 }
static hasHTML()
Has HTML output.
static translateMessage($a_message_id, array $a_message_static=null)
Translate message if possible.

References abortAndDie(), ilContext\hasHTML(), redirect(), and translateMessage().

Referenced by initClient().

+ Here is the call graph for this function:
+ Here is the caller 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 130 of file class.ilInitialisation.php.

131 {
132 include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
134 require_once("include/inc.xml5compliance.php");
135 }
136 require_once("include/inc.xsl5compliance.php");
137 }

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

Referenced by initILIAS().

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

◆ initAccessHandling()

static ilInitialisation::initAccessHandling ( )
staticprotected

$ilAccess and $rbac... initialisation

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

1050 {
1052 "rbacreview",
1053 "ilRbacReview",
1054 "./Services/AccessControl/classes/class.ilRbacReview.php"
1055 );
1056
1057 require_once "./Services/AccessControl/classes/class.ilRbacSystem.php";
1058 $rbacsystem = ilRbacSystem::getInstance();
1059 self::initGlobal("rbacsystem", $rbacsystem);
1060
1062 "rbacadmin",
1063 "ilRbacAdmin",
1064 "./Services/AccessControl/classes/class.ilRbacAdmin.php"
1065 );
1066
1068 "ilAccess",
1069 "ilAccess",
1070 "./Services/AccessControl/classes/class.ilAccess.php"
1071 );
1072
1073 require_once "./Services/Conditions/classes/class.ilConditionHandler.php";
1074 }
static initGlobal($a_name, $a_class, $a_source_file=null)
Initialize global instance.

References ilRbacSystem\getInstance(), and initGlobal().

Referenced by initUser().

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

◆ initAccessibilityControlConcept()

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

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

789 {
790 $c['acc.criteria.type.factory'] = function (\ILIAS\DI\Container $c) {
791 return new ilAccessibilityCriterionTypeFactory($c->rbac()->review(), $c['ilObjDataCache']);
792 };
793
794 $c['acc.document.evaluator'] = function (\ILIAS\DI\Container $c) {
797 $c['acc.criteria.type.factory'],
798 $c->user(),
799 $c->logger()->acc()
800 ),
801 $c->user(),
802 $c->logger()->acc(),
803 \ilAccessibilityDocument::orderBy('sorting')->get()
804 );
805 };
806 }
static orderBy($orderBy, $orderDirection='ASC')
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:19
Interface ilAccessibilitySequentialDocumentEvaluation.
$c
Definition: cli.php:37

References $c, and ActiveRecord\orderBy().

Referenced by initClient().

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

◆ initAvatar()

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

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

742 {
743 $c["user.avatar.factory"] = function ($c) {
744 return new \ilUserAvatarFactory($c);
745 };
746 }

References $c.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initBackgroundTasks()

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

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

2106 {
2107 global $ilIliasIniFile;
2108
2109 $n_of_tasks = $ilIliasIniFile->readVariable("background_tasks", "number_of_concurrent_tasks");
2110 $sync = $ilIliasIniFile->readVariable("background_tasks", "concurrency");
2111
2112 $n_of_tasks = $n_of_tasks ? $n_of_tasks : 5;
2113 $sync = $sync ? $sync : 'sync'; // The default value is sync.
2114
2115 $c["bt.task_factory"] = function ($c) {
2116 return new \ILIAS\BackgroundTasks\Implementation\Tasks\BasicTaskFactory($c["di.injector"]);
2117 };
2118
2119 $c["bt.persistence"] = function ($c) {
2120 return \ILIAS\BackgroundTasks\Implementation\Persistence\BasicPersistence::instance($c->database());
2121 };
2122
2123 $c["bt.injector"] = function ($c) {
2124 return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, new BaseDependencyMap());
2125 };
2126
2127 $c["bt.task_manager"] = function ($c) use ($sync) {
2128 if ($sync == 'sync') {
2129 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\SyncTaskManager($c["bt.persistence"]);
2130 } elseif ($sync == 'async') {
2131 return new \ILIAS\BackgroundTasks\Implementation\TaskManager\AsyncTaskManager($c["bt.persistence"]);
2132 } else {
2133 throw new ilException("The supported Background Task Managers are sync and async. $sync given.");
2134 }
2135 };
2136 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $c, and $ilIliasIniFile.

Referenced by initILIAS().

+ Here is the caller graph for this function:

◆ initClient()

static ilInitialisation::initClient ( )
staticprotected

Init client-based objects (level 1)

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

1268 {
1269 global $https, $ilias, $DIC;
1270
1272
1274
1275 self::bootstrapFilesystems();
1276
1278
1280
1281
1282 // --- needs client ini
1283
1284 $ilias->client_id = CLIENT_ID;
1285
1286 if (DEVMODE) {
1288 }
1289
1290
1292
1294
1295 // init dafault language
1296 self::initLanguage(false);
1297
1298 // moved after databases
1299 self::initLog();
1300
1302 "ilAppEventHandler",
1303 "ilAppEventHandler",
1304 "./Services/EventHandling/classes/class.ilAppEventHandler.php"
1305 );
1306
1307 // there are rare cases where initILIAS is called twice for a request
1308 // example goto.php is called and includes ilias.php later
1309 // we must prevent that ilPluginAdmin is initialized twice in
1310 // this case, since this won't get the values out of plugin.php the
1311 // second time properly
1312 if (!isset($DIC["ilPluginAdmin"]) || !$DIC["ilPluginAdmin"] instanceof ilPluginAdmin) {
1314 "ilPluginAdmin",
1315 "ilPluginAdmin",
1316 "./Services/Component/classes/class.ilPluginAdmin.php"
1317 );
1318 }
1319
1322 self::initMail($GLOBALS['DIC']);
1323 self::initAvatar($GLOBALS['DIC']);
1327
1328
1329 // --- needs settings
1330
1332
1333 if (ilContext::usesHTTP()) {
1334 // $https
1335 self::initGlobal("https", "ilHTTPS", "./Services/Http/classes/class.ilHTTPS.php");
1336 $https->enableSecureCookies();
1337 $https->checkPort();
1338 }
1339
1340
1341 // --- object handling
1342
1344 "ilObjDataCache",
1345 "ilObjectDataCache",
1346 "./Services/Object/classes/class.ilObjectDataCache.php"
1347 );
1348
1349 // needed in ilObjectDefinition
1350 require_once "./Services/Xml/classes/class.ilSaxParser.php";
1351
1353 "objDefinition",
1354 "ilObjectDefinition",
1355 "./Services/Object/classes/class.ilObjectDefinition.php"
1356 );
1357
1358 // $tree
1359 require_once "./Services/Tree/classes/class.ilTree.php";
1360 $tree = new ilTree(ROOT_FOLDER_ID);
1361 self::initGlobal("tree", $tree);
1362 unset($tree);
1363
1365 "ilCtrl",
1366 "ilCtrl",
1367 "./Services/UICore/classes/class.ilCtrl.php"
1368 );
1369
1372
1373 // Init GlobalScreen
1375 }
if(!isset($GLOBALS['ilGlobalStartTime'])||! $GLOBALS['ilGlobalStartTime']) global $DIC
static usesHTTP()
Uses HTTP aka browser.
static initDatabase()
initialise database object $ilDB
static initLocale()
Init Locale.
static initClientIniFile()
This method provides a global instance of class ilIniFile for the client.ini.php file in variable $il...
static determineClient()
This method determines the current client and sets the constant CLIENT_ID.
static initLog()
Init log instance.
static initAvatar(\ILIAS\DI\Container $c)
static setSessionHandler()
set session handler to db
static handleDevMode()
Prepare developer tools.
static setSessionCookieParams()
set session cookie params
static initSettings()
initialise $ilSettings object and define constants
static initGlobalScreen(\ILIAS\DI\Container $c)
static initMail(\ILIAS\DI\Container $c)
static initTermsOfService(\ILIAS\DI\Container $c)
static initAccessibilityControlConcept(\ILIAS\DI\Container $c)
static handleMaintenanceMode()
handle maintenance mode
static initCustomObjectIcons(\ILIAS\DI\Container $c)
Administration class for plugins.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...

References $DIC, $GLOBALS, $https, CLIENT_ID, determineClient(), handleDevMode(), handleMaintenanceMode(), initAccessibilityControlConcept(), initAvatar(), initClientIniFile(), initCustomObjectIcons(), initDatabase(), initGlobal(), initGlobalScreen(), initLocale(), initLog(), initMail(), initResourceStorage(), initSettings(), initTermsOfService(), ROOT_FOLDER_ID, setClientIdCookie(), setCookieConstants(), setSessionCookieParams(), setSessionHandler(), and ilContext\usesHTTP().

Referenced by initILIAS().

+ Here is the call graph for this function:
+ Here is the caller 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

Reimplemented in XapiProxy\ilInitialisation, and LTI\ilInitialisation.

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

492 {
493 global $ilIliasIniFile;
494
495 // check whether ILIAS_WEB_DIR is set.
496 if (ILIAS_WEB_DIR == "") {
497 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without ILIAS_WEB_DIR.");
498 }
499
500 // check whether CLIENT_ID is set.
501 if (CLIENT_ID == "") {
502 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile called without CLIENT_ID.");
503 }
504
505 $ini_file = "./" . ILIAS_WEB_DIR . "/" . CLIENT_ID . "/client.ini.php";
506
507 // get settings from ini file
508 $ilClientIniFile = new ilIniFile($ini_file);
509 $ilClientIniFile->read();
510
511 // invalid client id / client ini
512 if ($ilClientIniFile->ERROR != "") {
513 $default_client = $ilIliasIniFile->readVariable("clients", "default");
514 if (CLIENT_ID !== $default_client) {
515 $mess = array("en" => "Client does not exist.",
516 "de" => "Mandant ist ungültig.");
517 self::redirect("index.php?client_id=" . $default_client, null, $mess);
518 } else {
519 self::abortAndDie("Fatal Error: ilInitialisation::initClientIniFile initializing client ini file abborted with: " . $ilClientIniFile->ERROR);
520 }
521 }
522
523 self::initGlobal("ilClientIniFile", $ilClientIniFile);
524
525 // set constants
526 define("SESSION_REMINDER_LEADTIME", 30);
527 define("DEBUG", $ilClientIniFile->readVariable("system", "DEBUG"));
528 define("DEVMODE", $ilClientIniFile->readVariable("system", "DEVMODE"));
529 define("SHOWNOTICES", $ilClientIniFile->readVariable("system", "SHOWNOTICES"));
530 define("DEBUGTOOLS", $ilClientIniFile->readVariable("system", "DEBUGTOOLS"));
531 define("ROOT_FOLDER_ID", $ilClientIniFile->readVariable('system', 'ROOT_FOLDER_ID'));
532 define("SYSTEM_FOLDER_ID", $ilClientIniFile->readVariable('system', 'SYSTEM_FOLDER_ID'));
533 define("ROLE_FOLDER_ID", $ilClientIniFile->readVariable('system', 'ROLE_FOLDER_ID'));
534 define("MAIL_SETTINGS_ID", $ilClientIniFile->readVariable('system', 'MAIL_SETTINGS_ID'));
535 $error_handler = $ilClientIniFile->readVariable('system', 'ERROR_HANDLER');
536 define("ERROR_HANDLER", $error_handler ? $error_handler : "PRETTY_PAGE");
537
538 // this is for the online help installation, which sets OH_REF_ID to the
539 // ref id of the online module
540 define("OH_REF_ID", $ilClientIniFile->readVariable("system", "OH_REF_ID"));
541
542 define("SYSTEM_MAIL_ADDRESS", $ilClientIniFile->readVariable('system', 'MAIL_SENT_ADDRESS')); // Change SS
543 define("MAIL_REPLY_WARNING", $ilClientIniFile->readVariable('system', 'MAIL_REPLY_WARNING')); // Change SS
544
545 // see ilObject::TITLE_LENGTH, ilObject::DESC_LENGTH
546 // define ("MAXLENGTH_OBJ_TITLE",125);#$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_TITLE'));
547 // define ("MAXLENGTH_OBJ_DESC",$ilClientIniFile->readVariable('system','MAXLENGTH_OBJ_DESC'));
548
549 define("CLIENT_DATA_DIR", ILIAS_DATA_DIR . "/" . CLIENT_ID);
550 define("CLIENT_WEB_DIR", ILIAS_ABSOLUTE_PATH . "/" . ILIAS_WEB_DIR . "/" . CLIENT_ID);
551 define("CLIENT_NAME", $ilClientIniFile->readVariable('client', 'name')); // Change SS
552
553 $val = $ilClientIniFile->readVariable("db", "type");
554 if ($val == "") {
555 define("IL_DB_TYPE", "mysql");
556 } else {
557 define("IL_DB_TYPE", $val);
558 }
559
560 $ilGlobalCacheSettings = new ilGlobalCacheSettings();
561 $ilGlobalCacheSettings->readFromIniFile($ilClientIniFile);
562 ilGlobalCache::setup($ilGlobalCacheSettings);
563
564 return true;
565 }
Class ilGlobalCacheSettings.
static setup(ilGlobalCacheSettings $ilGlobalCacheSettings)
INIFile Parser.
const ILIAS_DATA_DIR
Definition: constants.php:42
const ILIAS_WEB_DIR
Definition: constants.php:43

References $ilIliasIniFile, abortAndDie(), CLIENT_ID, ILIAS_DATA_DIR, ILIAS_WEB_DIR, initGlobal(), redirect(), and ilGlobalCache\setup().

Referenced by initClient().

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

◆ initCore()

static ilInitialisation::initCore ( )
staticprotected

Init core objects (level 0)

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

1235 {
1236 global $ilErr;
1237
1239
1240 // breaks CAS: must be included after CAS context isset in AuthUtils
1241 //self::includePhp5Compliance();
1242
1244
1245
1246 // error handler
1248 "ilErr",
1249 "ilErrorHandling",
1250 "./Services/Init/classes/class.ilErrorHandling.php"
1251 );
1252 $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK, array($ilErr, 'errorHandler'));
1253
1255
1257
1258 define('IL_INITIAL_WD', getcwd());
1259
1260 // deprecated
1261 self::initGlobal("ilias", "ILIAS", "./Services/Init/classes/class.ilias.php");
1262 }
const PEAR_ERROR_CALLBACK
Definition: PEAR.php:35
static removeUnsafeCharacters()
Remove unsafe characters from GET.
static requireCommonIncludes()
get common include code files
static handleErrorReporting()
Set error reporting level.
static initIliasIniFile()
This method provides a global instance of class ilIniFile for the ilias.ini.php file in variable $ilI...
$ilErr
Definition: raiseError.php:18

References $ilErr, handleErrorReporting(), initGlobal(), initIliasIniFile(), PEAR_ERROR_CALLBACK, removeUnsafeCharacters(), and requireCommonIncludes().

Referenced by initILIAS().

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

◆ initCustomObjectIcons()

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

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

727 {
728 $c["object.customicons.factory"] = function ($c) {
729 require_once 'Services/Object/Icon/classes/class.ilObjectCustomIconFactory.php';
730 return new ilObjectCustomIconFactory(
731 $c->filesystem()->web(),
732 $c->upload(),
733 $c['ilObjDataCache']
734 );
735 };
736 }
Class ilObjectCustomIconFactory.

References $c.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initDatabase()

static ilInitialisation::initDatabase ( )
staticprotected

initialise database object $ilDB

Reimplemented in XapiProxy\ilInitialisation, and LTI\ilInitialisation.

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

597 {
598 // build dsn of database connection and connect
600 $ilDB->initFromIniFile();
601 $ilDB->connect();
602
603 self::initGlobal("ilDB", $ilDB);
604 }
global $ilDB

References $ilDB, ilDBWrapperFactory\getWrapper(), and initGlobal().

Referenced by initClient().

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

◆ 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 368 of file class.ilInitialisation.php.

369 {
370 $dic['upload.processor-manager'] = function ($c) {
371 return new PreProcessorManagerImpl();
372 };
373
374 $dic['upload'] = function (\ILIAS\DI\Container $c) {
375 $fileUploadImpl = new \ILIAS\FileUpload\FileUploadImpl($c['upload.processor-manager'], $c['filesystem'], $c['http']);
376 if ((defined('IL_VIRUS_SCANNER') && IL_VIRUS_SCANNER != "None") || (defined('IL_SCANNER_TYPE') && IL_SCANNER_TYPE == "1")) {
377 $fileUploadImpl->register(new VirusScannerPreProcessor(ilVirusScannerFactory::_getInstance()));
378 }
379
380 $fileUploadImpl->register(new FilenameSanitizerPreProcessor());
381 $fileUploadImpl->register(new InsecureFilenameSanitizerPreProcessor());
382 $fileUploadImpl->register(new BlacklistExtensionPreProcessor(ilFileUtils::getExplicitlyBlockedFiles(), $c->language()->txt("msg_info_blacklisted")));
383 $fileUploadImpl->register(new SVGBlacklistPreProcessor());
384
385 return $fileUploadImpl;
386 };
387 }
Class BlacklistExtensionPreProcessor PreProcessor which denies all blacklisted file extensions.
static getExplicitlyBlockedFiles()
$dic
Definition: result.php:13

References $c, $dic, ilVirusScannerFactory\_getInstance(), and ilFileUtils\getExplicitlyBlockedFiles().

Referenced by initILIAS().

+ Here is the call graph for this function:
+ Here is the caller 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

Reimplemented in XapiProxy\ilInitialisation, and LTI\ilInitialisation.

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

1097 {
1098 global $DIC;
1099
1100 if ($a_source_file) {
1101 include_once $a_source_file;
1102 $GLOBALS[$a_name] = new $a_class;
1103 } else {
1104 $GLOBALS[$a_name] = $a_class;
1105 }
1106
1107 $DIC[$a_name] = function ($c) use ($a_name) {
1108 return $GLOBALS[$a_name];
1109 };
1110 }

References $c, $DIC, and $GLOBALS.

Referenced by initAccessHandling(), initClient(), initClientIniFile(), initCore(), initDatabase(), initHTML(), initIliasIniFile(), initLog(), initSettings(), initStyle(), initUser(), and requireCommonIncludes().

+ Here is the caller graph for this function:

◆ initGlobalScreen()

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

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

1513 {
1514 $c['global_screen'] = function () use ($c) {
1515 return new Services(new ilGSProviderFactory($c), htmlentities(str_replace([" ", ".", "-"], "_", ILIAS_VERSION_NUMERIC)));
1516 };
1517 $c->globalScreen()->tool()->context()->stack()->clear();
1518 $c->globalScreen()->tool()->context()->claim()->main();
1519// $c->globalScreen()->tool()->context()->current()->addAdditionalData('DEVMODE', (bool) DEVMODE);
1520 }
Class ilGSProviderFactory.
const ILIAS_VERSION_NUMERIC
Class ilAsqQuestionAuthoringFactory.

References $c, and ILIAS_VERSION_NUMERIC.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initHTML()

static ilInitialisation::initHTML ( )
staticprotected

init HTML output (level 3)

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

1791 {
1792 global $ilUser, $DIC;
1793
1794 if (ilContext::hasUser()) {
1795 // load style definitions
1796 // use the init function with plugin hook here, too
1798 }
1799
1801 $tpl = new ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
1802 self::initGlobal("tpl", $tpl);
1803
1804 if (ilContext::hasUser()) {
1805 $dispatcher = new \ILIAS\Init\StartupSequence\StartUpSequenceDispatcher($DIC);
1806 $dispatcher->dispatch();
1807 }
1808
1809 require_once "./Services/UICore/classes/class.ilFrameTargetInfo.php";
1810
1812 "ilNavigationHistory",
1813 "ilNavigationHistory",
1814 "Services/Navigation/classes/class.ilNavigationHistory.php"
1815 );
1816
1818 "ilBrowser",
1819 "ilBrowser",
1820 "./Services/Utilities/classes/class.ilBrowser.php"
1821 );
1822
1824 "ilHelp",
1825 "ilHelpGUI",
1826 "Services/Help/classes/class.ilHelpGUI.php"
1827 );
1828
1830 "ilToolbar",
1831 "ilToolbarGUI",
1832 "./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php"
1833 );
1834
1836 "ilLocator",
1837 "ilLocatorGUI",
1838 "./Services/Locator/classes/class.ilLocatorGUI.php"
1839 );
1840
1842 "ilTabs",
1843 "ilTabsGUI",
1844 "./Services/UIComponent/Tabs/classes/class.ilTabsGUI.php"
1845 );
1846
1847 if (ilContext::hasUser()) {
1848 include_once './Services/MainMenu/classes/class.ilMainMenuGUI.php';
1849 $ilMainMenu = new ilMainMenuGUI("_top");
1850
1851 self::initGlobal("ilMainMenu", $ilMainMenu);
1852 unset($ilMainMenu);
1853
1854 // :TODO: tableGUI related
1855
1856 // set hits per page for all lists using table module
1857 $_GET['limit'] = (int) $ilUser->getPref('hits_per_page');
1858 ilSession::set('tbl_limit', $_GET['limit']);
1859
1860 // the next line makes it impossible to save the offset somehow in a session for
1861 // a specific table (I tried it for the user administration).
1862 // its not posssible to distinguish whether it has been set to page 1 (=offset = 0)
1863 // or not set at all (then we want the last offset, e.g. being used from a session var).
1864 // So I added the wrapping if statement. Seems to work (hopefully).
1865 // Alex April 14th 2006
1866 if (isset($_GET['offset']) && $_GET['offset'] != "") { // added April 14th 2006
1867 $_GET['offset'] = (int) $_GET['offset']; // old code
1868 }
1869
1870 self::initGlobal("lti", "ilLTIViewGUI", "./Services/LTI/classes/class.ilLTIViewGUI.php");
1871 $GLOBALS["DIC"]["lti"]->init();
1873 } else {
1874 // several code parts rely on ilObjUser being always included
1875 include_once "Services/User/classes/class.ilObjUser.php";
1876 }
1877 }
static hasUser()
Based on user authentication?
Class ilGlobalPageTemplate.
static initUIFramework(\ILIAS\DI\Container $c)
init the ILIAS UI framework.
static initKioskMode(\ILIAS\DI\Container $c)
static initStyle()
provide $styleDefinition object
Handles display of the main menu.
static set($a_var, $a_val)
Set a value.
$ilUser
Definition: imgupload.php:18
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

References $_GET, $DIC, $GLOBALS, $ilUser, $tpl, ilContext\hasUser(), initGlobal(), initKioskMode(), initStyle(), initUIFramework(), and ilSession\set().

Referenced by initILIAS().

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

◆ initHTTPServices()

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

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

1481 {
1482 $container['http.request_factory'] = function ($c) {
1483 return new \ILIAS\HTTP\Request\RequestFactoryImpl();
1484 };
1485
1486 $container['http.response_factory'] = function ($c) {
1487 return new \ILIAS\HTTP\Response\ResponseFactoryImpl();
1488 };
1489
1490 $container['http.cookie_jar_factory'] = function ($c) {
1491 return new \ILIAS\HTTP\Cookies\CookieJarFactoryImpl();
1492 };
1493
1494 $container['http.response_sender_strategy'] = function ($c) {
1495 return new \ILIAS\HTTP\Response\Sender\DefaultResponseSenderStrategy();
1496 };
1497
1498 $container['http'] = function ($c) {
1499 return new \ILIAS\DI\HTTPServices(
1500 $c['http.response_sender_strategy'],
1501 $c['http.cookie_jar_factory'],
1502 $c['http.request_factory'],
1503 $c['http.response_factory']
1504 );
1505 };
1506 }
$container
Definition: wac.php:13

References $c, and $container.

Referenced by initILIAS().

+ Here is the caller graph for this function:

◆ initILIAS()

static ilInitialisation::initILIAS ( )
static

ilias initialisation

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

1159 {
1160 if (self::$already_initialized) {
1161 return;
1162 }
1163
1164 $GLOBALS["DIC"] = new Container();
1165 $GLOBALS["DIC"]["ilLoggerFactory"] = function ($c) {
1167 };
1168
1169 self::$already_initialized = true;
1170
1173 if (ilContext::initClient()) {
1177
1178 if (ilContext::hasUser()) {
1180
1183 }
1184 }
1185
1186 // init after Auth otherwise breaks CAS
1188
1189 // language may depend on user setting
1190 self::initLanguage(true);
1191 $GLOBALS['DIC']['tree']->initLangCode();
1192
1196
1197 if (ilContext::hasHTML()) {
1199 }
1201 }
1202 }
static supportsPersistentSessions()
Check if context supports persistent session handling.
static initClient()
Init client.
static initHTTPServices(\ILIAS\DI\Container $container)
static initSession()
Init auth session.
static initClient()
Init client-based objects (level 1)
static initCore()
Init core objects (level 0)
static includePhp5Compliance()
This is a hack for authentication.
static initFileUploadService(\ILIAS\DI\Container $dic)
Initializes the file upload service.
static initHTML()
init HTML output (level 3)
static resumeUserSession()
Resume an existing user session.
static initUser()
Init user / authentification (level 2)
static initBackgroundTasks(\ILIAS\DI\Container $c)
static initInjector(\ILIAS\DI\Container $c)
static initRefinery(\ILIAS\DI\Container $container)

References $c, $GLOBALS, ilLoggerFactory\getInstance(), ilContext\hasHTML(), ilContext\hasUser(), includePhp5Compliance(), initBackgroundTasks(), ilContext\initClient(), initClient(), initCore(), initFileUploadService(), initHTML(), initHTTPServices(), initInjector(), initKioskMode(), initRefinery(), initSession(), initUser(), resumeUserSession(), and ilContext\supportsPersistentSessions().

Referenced by ilSoapFunctions\__call(), ILIAS\GlobalScreen\Client\CallbackHandler\__construct(), ILIAS\GlobalScreen\Client\ModeToggle\__construct(), ILIAS\GlobalScreen\Client\ItemState\__construct(), _initIliasForPreview(), ilSoapAdministration\getClientInfoXML(), ilSoapAdministration\getInstallationInfoXML(), ilNusoapUserAdministrationAdapter\handleSoapPlugins(), XapiProxy\DataService\initIlias(), LTI\ilLTIConsumerDataService\initIlias(), ilCalendarRemoteAccessHandler\initIlias(), ilWebAccessChecker\initILIAS(), reinitILIAS(), and ILIAS\GlobalScreen\Client\ContentRenderer\run().

+ 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.

Reimplemented in XapiProxy\ilInitialisation, and LTI\ilInitialisation.

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

147 {
148 require_once("./Services/Init/classes/class.ilIniFile.php");
149 $ilIliasIniFile = new ilIniFile("./ilias.ini.php");
150 $ilIliasIniFile->read();
151 self::initGlobal('ilIliasIniFile', $ilIliasIniFile);
152
153 // initialize constants
154 define("ILIAS_DATA_DIR", $ilIliasIniFile->readVariable("clients", "datadir"));
155 define("ILIAS_WEB_DIR", $ilIliasIniFile->readVariable("clients", "path"));
156 define("ILIAS_ABSOLUTE_PATH", $ilIliasIniFile->readVariable('server', 'absolute_path'));
157
158 // logging
159 define("ILIAS_LOG_DIR", $ilIliasIniFile->readVariable("log", "path"));
160 define("ILIAS_LOG_FILE", $ilIliasIniFile->readVariable("log", "file"));
161 define("ILIAS_LOG_ENABLED", $ilIliasIniFile->readVariable("log", "enabled"));
162 define("ILIAS_LOG_LEVEL", $ilIliasIniFile->readVariable("log", "level"));
163 define("SLOW_REQUEST_TIME", $ilIliasIniFile->readVariable("log", "slow_request_time"));
164
165 // read path + command for third party tools from ilias.ini
166 define("PATH_TO_CONVERT", $ilIliasIniFile->readVariable("tools", "convert"));
167 define("PATH_TO_FFMPEG", $ilIliasIniFile->readVariable("tools", "ffmpeg"));
168 define("PATH_TO_ZIP", $ilIliasIniFile->readVariable("tools", "zip"));
169 define("PATH_TO_MKISOFS", $ilIliasIniFile->readVariable("tools", "mkisofs"));
170 define("PATH_TO_UNZIP", $ilIliasIniFile->readVariable("tools", "unzip"));
171 define("PATH_TO_GHOSTSCRIPT", $ilIliasIniFile->readVariable("tools", "ghostscript"));
172 define("PATH_TO_JAVA", $ilIliasIniFile->readVariable("tools", "java"));
173 define("URL_TO_LATEX", $ilIliasIniFile->readVariable("tools", "latex"));
174 define("PATH_TO_FOP", $ilIliasIniFile->readVariable("tools", "fop"));
175 define("PATH_TO_LESSC", $ilIliasIniFile->readVariable("tools", "lessc"));
176 define("PATH_TO_PHANTOMJS", $ilIliasIniFile->readVariable("tools", "phantomjs"));
177
178 if ($ilIliasIniFile->groupExists('error')) {
179 if ($ilIliasIniFile->variableExists('error', 'editor_url')) {
180 define("ERROR_EDITOR_URL", $ilIliasIniFile->readVariable('error', 'editor_url'));
181 }
182
183 if ($ilIliasIniFile->variableExists('error', 'editor_path_translations')) {
184 define("ERROR_EDITOR_PATH_TRANSLATIONS", $ilIliasIniFile->readVariable('error', 'editor_path_translations'));
185 }
186 }
187
188 // read virus scanner settings
189 switch ($ilIliasIniFile->readVariable("tools", "vscantype")) {
190 case "sophos":
191 define("IL_VIRUS_SCANNER", "Sophos");
192 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
193 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
194 break;
195
196 case "antivir":
197 define("IL_VIRUS_SCANNER", "AntiVir");
198 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
199 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
200 break;
201
202 case "clamav":
203 define("IL_VIRUS_SCANNER", "ClamAV");
204 define("IL_VIRUS_SCAN_COMMAND", $ilIliasIniFile->readVariable("tools", "scancommand"));
205 define("IL_VIRUS_CLEAN_COMMAND", $ilIliasIniFile->readVariable("tools", "cleancommand"));
206 break;
207 case "icap":
208 define("IL_VIRUS_SCANNER", "icap");
209 define("IL_ICAP_HOST", $ilIliasIniFile->readVariable("tools", "icap_host"));
210 define("IL_ICAP_PORT", $ilIliasIniFile->readVariable("tools", "icap_port"));
211 define("IL_ICAP_AV_COMMAND", $ilIliasIniFile->readVariable("tools", "icap_service_name"));
212 define("IL_ICAP_CLIENT", $ilIliasIniFile->readVariable("tools", "icap_client_path"));
213 break;
214
215 default:
216 define("IL_VIRUS_SCANNER", "None");
217 break;
218 }
219 define("IL_VIRUS_CLEAN_COMMAND", '');
220
221 include_once './Services/Calendar/classes/class.ilTimeZone.php';
223 define("IL_TIMEZONE", $tz);
224 }
static initDefaultTimeZone(ilIniFile $ini)
Initialize default timezone from system settings.

References $ilIliasIniFile, ilTimeZone\initDefaultTimeZone(), and initGlobal().

Referenced by initCore().

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

◆ initInjector()

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

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

2140 {
2141 $c["di.dependency_map"] = function ($c) {
2142 return new \ILIAS\BackgroundTasks\Dependencies\DependencyMap\BaseDependencyMap();
2143 };
2144
2145 $c["di.injector"] = function ($c) {
2146 return new \ILIAS\BackgroundTasks\Dependencies\Injector($c, $c["di.dependency_map"]);
2147 };
2148 }

References $c.

Referenced by initILIAS().

+ Here is the caller graph for this function:

◆ initKioskMode()

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

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

2151 {
2152 $c["service.kiosk_mode"] = function ($c) {
2153 return new ilKioskModeService(
2154 $c['ilCtrl'],
2155 $c['lng'],
2156 $c['ilAccess'],
2157 $c['objDefinition']
2158 );
2159 };
2160 }
Central entry point for users of the service.

References $c.

Referenced by initHTML(), and initILIAS().

+ Here is the caller graph for this function:

◆ initLocale()

static ilInitialisation::initLocale ( )
staticprotected

Init Locale.

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

909 {
910 global $ilSetting;
911
912 if (trim($ilSetting->get("locale") != "")) {
913 $larr = explode(",", trim($ilSetting->get("locale")));
914 $ls = array();
915 $first = $larr[0];
916 foreach ($larr as $l) {
917 if (trim($l) != "") {
918 $ls[] = $l;
919 }
920 }
921 if (count($ls) > 0) {
922 setlocale(LC_ALL, $ls);
923
924 // #15347 - making sure that floats are not changed
925 setlocale(LC_NUMERIC, "C");
926
927 if (class_exists("Collator")) {
928 $GLOBALS["ilCollator"] = new Collator($first);
929 $GLOBALS["DIC"]["ilCollator"] = function ($c) {
930 return $GLOBALS["ilCollator"];
931 };
932 }
933 }
934 }
935 }
global $ilSetting
Definition: privfeed.php:17

References $c, $GLOBALS, and $ilSetting.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initLog()

static ilInitialisation::initLog ( )
staticprotected

Init log instance.

Reimplemented in XapiProxy\ilInitialisation, and LTI\ilInitialisation.

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

1080 {
1081 include_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
1083
1084 self::initGlobal("ilLog", $log);
1085 // deprecated
1086 self::initGlobal("log", $log);
1087 }
static getRootLogger()
The unique root logger has a fixed error level.
$log
Definition: result.php:15

References $log, ilLoggerFactory\getRootLogger(), and initGlobal().

Referenced by initClient().

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

◆ initMail()

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

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

711 {
712 $c["mail.mime.transport.factory"] = function (\ILIAS\DI\Container $c) {
713 return new \ilMailMimeTransportFactory($c->settings(), $c->event());
714 };
715 $c["mail.mime.sender.factory"] = function (\ILIAS\DI\Container $c) {
716 return new \ilMailMimeSenderFactory($c->settings());
717 };
718 $c["mail.texttemplates.service"] = function (\ILIAS\DI\Container $c) {
719 return new \ilMailTemplateService(new \ilMailTemplateRepository($c->database()));
720 };
721 }
Class ilMailTemplateRepository.

References $c.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initRefinery()

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

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

1778 {
1779 $container['refinery'] = function ($container) {
1780 $dataFactory = new \ILIAS\Data\Factory();
1781 $language = $container['lng'];
1782
1783 return new \ILIAS\Refinery\Factory($dataFactory, $language);
1784 };
1785 }

References $container.

Referenced by initILIAS().

+ Here is the caller graph for this function:

◆ initResourceStorage()

static ilInitialisation::initResourceStorage ( )
staticprotected

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

226 : void
227 {
228 global $DIC;
229
230 $DIC['resource_storage'] = static function (Container $c) : \ILIAS\ResourceStorage\Services {
231 $revision_repository = new RevisionDBRepository($c->database());
232 $resource_repository = new ResourceDBRepository($c->database());
233 $information_repository = new InformationDBRepository($c->database());
234 $stakeholder_repository = new StakeholderDBRepository($c->database());
235 return new \ILIAS\ResourceStorage\Services(
237 new MaxNestingFileSystemStorageHandler($c['filesystem.storage'], Location::STORAGE),
238 new FileSystemStorageHandler($c['filesystem.storage'], Location::STORAGE)
239 ]),
240 $revision_repository,
241 $resource_repository,
242 $information_repository,
243 $stakeholder_repository,
244 new LockHandlerilDB($c->database()),
247 $c->database(),
248 $resource_repository,
249 $revision_repository,
250 $information_repository,
251 $stakeholder_repository
252 )
253 );
254 };
255 }
Class ChatMainBarProvider \MainMenu\Provider.

References $c, and $DIC.

Referenced by initClient().

+ Here is the caller graph for this function:

◆ initSession()

static ilInitialisation::initSession ( )
staticprotected

Init auth session.

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

1208 {
1209 $GLOBALS["DIC"]["ilAuthSession"] = function ($c) {
1210 $auth_session = ilAuthSession::getInstance(
1211 $c['ilLoggerFactory']->getLogger('auth')
1212 );
1213 $auth_session->init();
1214 return $auth_session;
1215 };
1216 }
static getInstance(\ilLogger $logger)
Get instance.

References $c, $GLOBALS, and ilAuthSession\getInstance().

Referenced by initILIAS().

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

◆ initSettings()

static ilInitialisation::initSettings ( )
staticprotected

initialise $ilSettings object and define constants

Used in Soap

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

814 {
815 global $ilSetting;
816
818 "ilSetting",
819 "ilSetting",
820 "Services/Administration/classes/class.ilSetting.php"
821 );
822
823 // check correct setup
824 if (!$ilSetting->get("setup_ok")) {
825 self::abortAndDie("Setup is not completed. Please run setup routine again.");
826 }
827
828 // set anonymous user & role id and system role id
829 define("ANONYMOUS_USER_ID", $ilSetting->get("anonymous_user_id"));
830 define("ANONYMOUS_ROLE_ID", $ilSetting->get("anonymous_role_id"));
831 define("SYSTEM_USER_ID", $ilSetting->get("system_user_id"));
832 define("SYSTEM_ROLE_ID", $ilSetting->get("system_role_id"));
833 define("USER_FOLDER_ID", 7);
834
835 // recovery folder
836 define("RECOVERY_FOLDER_ID", $ilSetting->get("recovery_folder_id"));
837
838 // installation id
839 define("IL_INST_ID", $ilSetting->get("inst_id", 0));
840
841 // define default suffix replacements
842 define("SUFFIX_REPL_DEFAULT", "php,php3,php4,inc,lang,phtml,htaccess");
843 define("SUFFIX_REPL_ADDITIONAL", $ilSetting->get("suffix_repl_additional"));
844
845 if (ilContext::usesHTTP()) {
847 }
848 }
static buildHTTPPath()
builds http path

References $ilSetting, abortAndDie(), buildHTTPPath(), initGlobal(), and ilContext\usesHTTP().

Referenced by initClient().

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

◆ initStyle()

static ilInitialisation::initStyle ( )
staticprotected

provide $styleDefinition object

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

854 {
855 global $DIC, $ilPluginAdmin;
856
857 // load style definitions
859 "styleDefinition",
860 "ilStyleDefinition",
861 "./Services/Style/System/classes/class.ilStyleDefinition.php"
862 );
863
864 // add user interface hook for style initialisation
865 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
866 foreach ($pl_names as $pl) {
867 $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
868 $gui_class = $ui_plugin->getUIClassInstance();
869 $gui_class->modifyGUI("Services/Init", "init_style", array("styleDefinition" => $DIC->systemStyle()));
870 }
871 }
const IL_COMP_SERVICE
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.

References $DIC, ilPluginAdmin\getPluginObject(), IL_COMP_SERVICE, and initGlobal().

Referenced by initHTML().

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

◆ initTermsOfService()

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

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

752 {
753 $c['tos.criteria.type.factory'] = function (
757 $c->rbac()->review(),
758 $c['ilObjDataCache'],
760 );
761 };
762
763 $c['tos.service'] = function (\ILIAS\DI\Container $c) : ilTermsOfServiceHelper {
764 $persistence = new ilTermsOfServiceDataGatewayFactory();
765 $persistence->setDatabaseAdapter($c->database());
766 return new ilTermsOfServiceHelper(
767 $persistence,
768 $c['tos.document.evaluator'],
769 $c['tos.criteria.type.factory'],
771 );
772 };
773
774 $c['tos.document.evaluator'] = function (\ILIAS\DI\Container $c) : ilTermsOfServiceDocumentEvaluation {
777 $c['tos.criteria.type.factory'],
778 $c->user(),
779 $c->logger()->tos()
780 ),
781 $c->user(),
782 $c->logger()->tos(),
783 ilTermsOfServiceDocument::orderBy('sorting')->get()
784 );
785 };
786 }
static getCountryCodes()
Get country codes (DIN EN 3166-1)
Class ilObjTermsOfService.
Class ilTermsOfServiceHelper.
Interface ilTermsOfServiceSequentialDocumentEvaluation.
Interface ilTermsOfServiceDocumentEvaluation.

References $c, ilCountry\getCountryCodes(), and ActiveRecord\orderBy().

Referenced by initClient().

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

◆ initUIFramework()

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

init the ILIAS UI framework.

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

1526 {
1527 $c["ui.factory"] = function ($c) {
1528 $c["lng"]->loadLanguageModule("ui");
1530 $c["ui.factory.counter"],
1531 $c["ui.factory.button"],
1532 $c["ui.factory.listing"],
1533 $c["ui.factory.image"],
1534 $c["ui.factory.panel"],
1535 $c["ui.factory.modal"],
1536 $c["ui.factory.dropzone"],
1537 $c["ui.factory.popover"],
1538 $c["ui.factory.divider"],
1539 $c["ui.factory.link"],
1540 $c["ui.factory.dropdown"],
1541 $c["ui.factory.item"],
1542 $c["ui.factory.viewcontrol"],
1543 $c["ui.factory.chart"],
1544 $c["ui.factory.input"],
1545 $c["ui.factory.table"],
1546 $c["ui.factory.messagebox"],
1547 $c["ui.factory.card"],
1548 $c["ui.factory.layout"],
1549 $c["ui.factory.maincontrols"],
1550 $c["ui.factory.tree"],
1551 $c["ui.factory.menu"],
1552 $c["ui.factory.symbol"],
1553 $c["ui.factory.legacy"]
1554 );
1555 };
1556 $c["ui.signal_generator"] = function ($c) {
1558 };
1559 $c["ui.factory.counter"] = function ($c) {
1561 };
1562 $c["ui.factory.button"] = function ($c) {
1564 };
1565 $c["ui.factory.listing"] = function ($c) {
1567 };
1568 $c["ui.factory.image"] = function ($c) {
1570 };
1571 $c["ui.factory.panel"] = function ($c) {
1572 return new ILIAS\UI\Implementation\Component\Panel\Factory($c["ui.factory.panel.listing"]);
1573 };
1574 $c["ui.factory.modal"] = function ($c) {
1575 return new ILIAS\UI\Implementation\Component\Modal\Factory($c["ui.signal_generator"]);
1576 };
1577 $c["ui.factory.dropzone"] = function ($c) {
1578 return new ILIAS\UI\Implementation\Component\Dropzone\Factory($c["ui.factory.dropzone.file"]);
1579 };
1580 $c["ui.factory.popover"] = function ($c) {
1581 return new ILIAS\UI\Implementation\Component\Popover\Factory($c["ui.signal_generator"]);
1582 };
1583 $c["ui.factory.divider"] = function ($c) {
1585 };
1586 $c["ui.factory.link"] = function ($c) {
1588 };
1589 $c["ui.factory.dropdown"] = function ($c) {
1591 };
1592 $c["ui.factory.item"] = function ($c) {
1594 };
1595 $c["ui.factory.viewcontrol"] = function ($c) {
1597 $c["ui.signal_generator"],
1598 $c["ui.factory.input"]
1599 );
1600 };
1601 $c["ui.factory.chart"] = function ($c) {
1602 return new ILIAS\UI\Implementation\Component\Chart\Factory($c["ui.factory.progressmeter"]);
1603 };
1604 $c["ui.factory.input"] = function ($c) {
1606 $c["ui.signal_generator"],
1607 $c["ui.factory.input.field"],
1608 $c["ui.factory.input.container"],
1609 $c["ui.factory.input.viewcontrol"]
1610 );
1611 };
1612 $c["ui.factory.table"] = function ($c) {
1613 return new ILIAS\UI\Implementation\Component\Table\Factory($c["ui.signal_generator"]);
1614 };
1615 $c["ui.factory.messagebox"] = function ($c) {
1617 };
1618 $c["ui.factory.card"] = function ($c) {
1620 };
1621 $c["ui.factory.layout"] = function ($c) {
1623 };
1624 $c["ui.factory.maincontrols.slate"] = function ($c) {
1626 $c['ui.signal_generator'],
1627 $c['ui.factory.counter'],
1628 $c["ui.factory.symbol"]
1629 );
1630 };
1631 $c["ui.factory.maincontrols"] = function ($c) {
1633 $c['ui.signal_generator'],
1634 $c['ui.factory.maincontrols.slate']
1635 );
1636 };
1637 $c["ui.factory.menu"] = function ($c) {
1639 };
1640 $c["ui.factory.symbol.glyph"] = function ($c) {
1642 };
1643 $c["ui.factory.symbol.icon"] = function ($c) {
1645 };
1646 $c["ui.factory.symbol.avatar"] = function ($c) {
1648 };
1649 $c["ui.factory.symbol"] = function ($c) {
1651 $c["ui.factory.symbol.icon"],
1652 $c["ui.factory.symbol.glyph"],
1653 $c["ui.factory.symbol.avatar"]
1654 );
1655 };
1656 $c["ui.factory.progressmeter"] = function ($c) {
1658 };
1659 $c["ui.factory.dropzone.file"] = function ($c) {
1661 };
1662 $c["ui.factory.input.field"] = function ($c) {
1663 $data_factory = new ILIAS\Data\Factory();
1664 $refinery = new ILIAS\Refinery\Factory($data_factory, $c["lng"]);
1665
1667 $c["ui.signal_generator"],
1668 $data_factory,
1669 $refinery,
1670 $c["lng"]
1671 );
1672 };
1673 $c["ui.factory.input.container"] = function ($c) {
1675 $c["ui.factory.input.container.form"],
1676 $c["ui.factory.input.container.filter"],
1677 $c["ui.factory.input.container.viewcontrol"]
1678 );
1679 };
1680 $c["ui.factory.input.container.form"] = function ($c) {
1682 $c["ui.factory.input.field"]
1683 );
1684 };
1685 $c["ui.factory.input.container.filter"] = function ($c) {
1687 $c["ui.signal_generator"],
1688 $c["ui.factory.input.field"]
1689 );
1690 };
1691 $c["ui.factory.input.container.viewcontrol"] = function ($c) {
1693 };
1694 $c["ui.factory.input.viewcontrol"] = function ($c) {
1696 };
1697 $c["ui.factory.panel.listing"] = function ($c) {
1699 };
1700 $c["ui.renderer"] = function ($c) {
1702 $c["ui.component_renderer_loader"]
1703 );
1704 };
1705 $c["ui.component_renderer_loader"] = function ($c) {
1707 new ILIAS\UI\Implementation\Render\LoaderResourceRegistryWrapper(
1708 $c["ui.resource_registry"],
1709 new ILIAS\UI\Implementation\Render\FSLoader(
1710 new ILIAS\UI\Implementation\Render\DefaultRendererFactory(
1711 $c["ui.factory"],
1712 $c["ui.template_factory"],
1713 $c["lng"],
1714 $c["ui.javascript_binding"],
1715 $c["refinery"],
1716 $c["ui.pathresolver"]
1717 ),
1718 new ILIAS\UI\Implementation\Component\Symbol\Glyph\GlyphRendererFactory(
1719 $c["ui.factory"],
1720 $c["ui.template_factory"],
1721 $c["lng"],
1722 $c["ui.javascript_binding"],
1723 $c["refinery"],
1724 $c["ui.pathresolver"]
1725 ),
1726 new ILIAS\UI\Implementation\Component\Input\Field\FieldRendererFactory(
1727 $c["ui.factory"],
1728 $c["ui.template_factory"],
1729 $c["lng"],
1730 $c["ui.javascript_binding"],
1731 $c["refinery"],
1732 $c["ui.pathresolver"]
1733 )
1734 )
1735 )
1736 );
1737 };
1738 $c["ui.template_factory"] = function ($c) {
1740 };
1741 $c["ui.resource_registry"] = function ($c) {
1743 };
1744 $c["ui.javascript_binding"] = function ($c) {
1746 };
1747
1748 $c["ui.factory.tree"] = function ($c) {
1749 return new ILIAS\UI\Implementation\Component\Tree\Factory($c["ui.signal_generator"]);
1750 };
1751
1752 $c["ui.factory.legacy"] = function ($c) {
1753 return new ILIAS\UI\Implementation\Component\Legacy\Factory($c["ui.signal_generator"]);
1754 };
1755
1757 foreach ($plugins as $plugin_data) {
1758 $plugin = ilPluginAdmin::getPluginObject($plugin_data["component_type"], $plugin_data["component_name"], $plugin_data["slot_id"], $plugin_data["name"]);
1759
1760 $c['ui.renderer'] = $plugin->exchangeUIRendererAfterInitialization($c);
1761
1762 foreach ($c->keys() as $key) {
1763 if (strpos($key, "ui.factory") === 0) {
1764 $c[$key] = $plugin->exchangeUIFactoryAfterInitialization($key, $c);
1765 }
1766 }
1767 }
1768
1769 $c["ui.pathresolver"] = function ($c) : ILIAS\UI\Implementation\Render\ImagePathResolver {
1770 return new ilImagePathResolver();
1771 };
1772 }
Builds a Color from either hex- or rgb values.
Definition: Factory.php:14
Builds data types.
Definition: Factory.php:20
Implementation of factory for cards.
Definition: Factory.php:13
Implementation of factory for tables.
Definition: Factory.php:14
Renderer that dispatches rendering of UI components to a Renderer found in the same namespace as the ...
Caches renderers loaded by another loader.
Wraps global ilTemplate to provide JavaScriptBinding.
static getActivePlugins()
Get info for all active plugins.
This is what a factory for input fields looks like.
Definition: Factory.php:11
This is what a factory for layouts looks like.
Definition: Factory.php:9
This is how the factory for UI elements looks.
Definition: Factory.php:18
Class Factory.

References $c, XapiProxy\$plugin, ilPluginAdmin\getActivePlugins(), and ilPluginAdmin\getPluginObject().

Referenced by initHTML().

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

◆ initUser()

static ilInitialisation::initUser ( )
staticprotected

Init user / authentification (level 2)

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

1381 {
1382 global $ilias, $ilUser;
1383
1384 // $ilUser
1386 "ilUser",
1387 "ilObjUser",
1388 "./Services/User/classes/class.ilObjUser.php"
1389 );
1390 $ilias->account = $ilUser;
1391
1393 }
static initAccessHandling()
$ilAccess and $rbac... initialisation

References $ilUser, initAccessHandling(), and initGlobal().

Referenced by initILIAS().

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

◆ initUserAccount()

static ilInitialisation::initUserAccount ( )
static

Init user with current account id.

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

877 {
878 global $DIC;
879
880 static $context_init;
881
882 $uid = $GLOBALS['DIC']['ilAuthSession']->getUserId();
883 if ($uid) {
884 $DIC->user()->setId($uid);
885 $DIC->user()->read();
886 if (!isset($context_init)) {
887 if ($DIC->user()->isAnonymous()) {
888 $DIC->globalScreen()->tool()->context()->claim()->external();
889 } else {
890 $DIC->globalScreen()->tool()->context()->claim()->internal();
891 }
892 $context_init = true;
893 }
894 // init console log handler
895 ilLoggerFactory::getInstance()->initUser($DIC->user()->getLogin());
896 \ilOnlineTracking::updateAccess($DIC->user());
897 } else {
898 if (is_object($GLOBALS['ilLog'])) {
899 $GLOBALS['ilLog']->logStack();
900 }
901 self::abortAndDie("Init user account failed");
902 }
903 }

References $DIC, $GLOBALS, abortAndDie(), and ilLoggerFactory\getInstance().

Referenced by goToPublicSection(), ilAuthFrontend\handleAuthenticationSuccess(), ilCalendarRemoteAccessHandler\initUser(), and resumeUserSession().

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

◆ recursivelyRemoveUnsafeCharacters()

static ilInitialisation::recursivelyRemoveUnsafeCharacters (   $var)
staticprotected

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

87 {
88 if (is_array($var)) {
89 $mod = [];
90 foreach ($var as $k => $v) {
93 }
94 return $mod;
95 }
96 return strip_tags(
97 str_replace(
98 array("\x00", "\n", "\r", "\\", "'", '"', "\x1a"),
99 "",
100 $var
101 )
102 );
103 }
static recursivelyRemoveUnsafeCharacters($var)

References recursivelyRemoveUnsafeCharacters().

Referenced by recursivelyRemoveUnsafeCharacters(), and removeUnsafeCharacters().

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

◆ 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 2025 of file class.ilInitialisation.php.

2026 {
2027 // #12739
2028 if (defined("ILIAS_HTTP_PATH") &&
2029 !stristr($a_target, ILIAS_HTTP_PATH)) {
2030 $a_target = ILIAS_HTTP_PATH . "/" . $a_target;
2031 }
2032
2033 foreach (['ext_uid', 'soap_pw'] as $param) {
2034 if (false === strpos($a_target, $param . '=') && isset($GLOBALS['DIC']->http()->request()->getQueryParams()[$param])) {
2035 $a_target = \ilUtil::appendUrlParameterString($a_target, $param . '=' . \ilUtil::stripSlashes(
2036 $GLOBALS['DIC']->http()->request()->getQueryParams()[$param]
2037 ));
2038 }
2039 }
2040
2042 ilUtil::redirect($a_target);
2043 } else {
2044 $message = self::translateMessage($a_message_id, $a_message_static);
2045
2046 // user-directed linked message
2048 $link = self::translateMessage(
2049 "init_error_redirect_click",
2050 array("en" => 'Please click to continue.',
2051 "de" => 'Bitte klicken um fortzufahren.')
2052 );
2053 $mess = $message .
2054 '<br /><a href="' . $a_target . '">' . $link . '</a>';
2055 }
2056 // plain text
2057 else {
2058 // not much we can do here
2059 $mess = $message;
2060
2061 if (!trim($mess)) {
2062 $mess = self::translateMessage(
2063 "init_error_redirect_info",
2064 array("en" => 'Redirect not supported by context.',
2065 "de" => 'Weiterleitungen werden durch Kontext nicht unterstützt.')
2066 ) .
2067 ' (' . $a_target . ')';
2068 }
2069 }
2070
2071 self::abortAndDie($mess);
2072 }
2073 }
static supportsRedirects()
Are redirects supported?
static appendUrlParameterString($a_url, $a_par, $xml_style=false)
append URL parameter string ("par1=value1&par2=value2...") to given URL string
static redirect($a_script)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static http()
Fetches the global http state from ILIAS.
$message
Definition: xapiexit.php:14
$param
Definition: xapitoken.php:29

References $GLOBALS, $message, $param, abortAndDie(), ilUtil\appendUrlParameterString(), ilContext\hasHTML(), ILIAS\FileDelivery\http(), ilUtil\redirect(), ilUtil\stripSlashes(), ilContext\supportsRedirects(), translateMessage(), and ilContext\usesHTTP().

Referenced by goToLogin(), goToPublicSection(), handleMaintenanceMode(), and initClientIniFile().

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

◆ reinitILIAS()

static ilInitialisation::reinitILIAS ( )
static

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

1150 {
1151 self::$already_initialized = false;
1153 }
static initILIAS()
ilias initialisation

References initILIAS().

Referenced by ilSoapAdministration\initIlias().

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

◆ removeUnsafeCharacters()

static ilInitialisation::removeUnsafeCharacters ( )
staticprotected

Remove unsafe characters from GET.

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

78 {
79 // Remove unsafe characters from GET parameters.
80 // We do not need this characters in any case, so it is
81 // feasible to filter them everytime. POST parameters
82 // need attention through ilUtil::stripSlashes() and similar functions)
84 }

References $_GET, and recursivelyRemoveUnsafeCharacters().

Referenced by initCore().

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

◆ requireCommonIncludes()

static ilInitialisation::requireCommonIncludes ( )
staticprotected

get common include code files

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

109 {
110 // ilTemplate
112 require_once "./Services/UICore/classes/class.ilTemplate.php";
113 }
114
115 // really always required?
116 require_once "./Services/Utilities/classes/class.ilUtil.php";
117 require_once "./Services/Calendar/classes/class.ilDatePresentation.php";
118 require_once "include/inc.ilias_version.php";
119
120 include_once './Services/Authentication/classes/class.ilAuthUtils.php';
121
122 self::initGlobal("ilBench", "ilBenchmark", "./Services/Utilities/classes/class.ilBenchmark.php");
123 }
static usesTemplate()
Uses template engine.

References initGlobal(), and ilContext\usesTemplate().

Referenced by initCore().

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

◆ resumeUserSession()

static ilInitialisation::resumeUserSession ( )
static

Resume an existing user session.

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

1399 {
1400 global $DIC;
1403 }
1404
1405 if (
1406 !$GLOBALS['DIC']['ilAuthSession']->isAuthenticated() or
1407 $GLOBALS['DIC']['ilAuthSession']->isExpired()
1408 ) {
1409 if ($GLOBALS['DIC']['ilAuthSession']->isExpired()) {
1411 }
1412
1413 ilLoggerFactory::getLogger('init')->debug('Current session is invalid: ' . $GLOBALS['DIC']['ilAuthSession']->getId());
1414 $current_script = substr(strrchr($_SERVER["PHP_SELF"], "/"), 1);
1415 if (self::blockedAuthentication($current_script)) {
1416 ilLoggerFactory::getLogger('init')->debug('Authentication is started in current script.');
1417 // nothing todo: authentication is done in current script
1418 return;
1419 }
1420
1421 return self::handleAuthenticationFail();
1422 }
1423 // valid session
1424
1425 return self::initUserAccount();
1426 }
static isAuthenticationForced()
Check if authentication is should be forced.
static handleForcedAuthentication()
static _destroy($a_session_id, $a_closing_context=null, $a_expired_at=null)
Destroy session.

References $_COOKIE, $_SERVER, $DIC, $GLOBALS, ilSession\_destroy(), ilLoggerFactory\getLogger(), ilAuthUtils\handleForcedAuthentication(), initUserAccount(), ilAuthUtils\isAuthenticationForced(), and ilSession\SESSION_CLOSE_EXPIRE.

Referenced by initILIAS().

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

◆ setClientIdCookie()

static ilInitialisation::setClientIdCookie ( )
staticprivate

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

664 : void
665 {
666 if (defined('CLIENT_ID') &&
667 !defined('IL_PHPUNIT_TEST') &&
669 ilUtil::setCookie('ilClientId', CLIENT_ID);
670 }
671 }
static setCookie($a_cookie_name, $a_cookie_value='', $a_also_set_super_global=true, $a_set_cookie_invalid=false)

References CLIENT_ID, ilUtil\setCookie(), and ilContext\supportsPersistentSessions().

Referenced by initClient().

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

◆ setCookieConstants()

static ilInitialisation::setCookieConstants ( )
staticprotected

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

636 {
637 include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
639 $cookie_path = '/';
640 } elseif ($GLOBALS['COOKIE_PATH']) {
641 // use a predefined cookie path from WebAccessChecker
642 $cookie_path = $GLOBALS['COOKIE_PATH'];
643 } else {
644 $cookie_path = dirname($_SERVER['PHP_SELF']);
645 }
646
647 /* if ilias is called directly within the docroot $cookie_path
648 is set to '/' expecting on servers running under windows..
649 here it is set to '\'.
650 in both cases a further '/' won't be appended due to the following regex
651 */
652 $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
653
654 if ($cookie_path == "\\") {
655 $cookie_path = '/';
656 }
657
658 define('IL_COOKIE_HTTPONLY', true); // Default Value
659 define('IL_COOKIE_EXPIRE', 0);
660 define('IL_COOKIE_PATH', $cookie_path);
661 define('IL_COOKIE_DOMAIN', '');
662 }
$cookie_path
Definition: metadata.php:22

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

Referenced by initClient().

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

◆ setSessionCookieParams()

static ilInitialisation::setSessionCookieParams ( )
staticprotected

set session cookie params

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

677 {
678 global $ilSetting;
679
680 if (!defined('IL_COOKIE_SECURE')) {
681 // If this code is executed, we can assume that \ilHTTPS::enableSecureCookies was NOT called before
682 // \ilHTTPS::enableSecureCookies already executes session_set_cookie_params()
683
684 include_once './Services/Http/classes/class.ilHTTPS.php';
685 $cookie_secure = !$ilSetting->get('https', 0) && ilHTTPS::getInstance()->isDetected();
686 define('IL_COOKIE_SECURE', $cookie_secure); // Default Value
687
688 $cookie_parameters = [
689 'lifetime' => IL_COOKIE_EXPIRE,
690 'path' => IL_COOKIE_PATH,
691 'domain' => IL_COOKIE_DOMAIN,
692 'secure' => IL_COOKIE_SECURE,
693 'httponly' => IL_COOKIE_HTTPONLY,
694 ];
695
696 if (
697 $cookie_secure &&
698 (!isset(session_get_cookie_params()['samesite']) || strtolower(session_get_cookie_params()['samesite']) !== 'strict')
699 ) {
700 $cookie_parameters['samesite'] = 'Lax';
701 }
702
703 session_set_cookie_params($cookie_parameters);
704 }
705 }
static getInstance()
Get https instance.
const IL_COOKIE_PATH(isset($_GET["client_id"]))
Definition: metadata.php:47

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

Referenced by initClient().

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

◆ setSessionHandler()

static ilInitialisation::setSessionHandler ( )
static

set session handler to db

Used in Soap/CAS

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

612 {
613 if (ini_get('session.save_handler') != 'user' && version_compare(PHP_VERSION, '7.2.0', '<')) {
614 ini_set("session.save_handler", "user");
615 }
616
617 require_once "Services/Authentication/classes/class.ilSessionDBHandler.php";
618 $db_session_handler = new ilSessionDBHandler();
619 if (!$db_session_handler->setSaveHandler()) {
620 self::abortAndDie("Please turn off Safe mode OR set session.save_handler to \"user\" in your php.ini");
621 }
622
623 // Do not accept external session ids
624 if (!ilSession::_exists(session_id()) && !defined('IL_PHPUNIT_TEST')) {
625 // php7-todo, correct-with-php5-removal : alex, 1.3.2016: added if, please check
626 if (function_exists("session_status") && session_status() == PHP_SESSION_ACTIVE) {
627 session_regenerate_id();
628 }
629 }
630 }
Database Session Handling.
static _exists($a_session_id)
Check whether session exists.

References ilSession\_exists(), and abortAndDie().

Referenced by initClient().

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

◆ 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 1980 of file class.ilInitialisation.php.

1981 {
1982 global $ilDB, $lng, $ilSetting, $ilClientIniFile, $ilUser;
1983
1984 // current language
1985 if (!$lng) {
1986 $lang = "en";
1987 if ($ilUser) {
1988 $lang = $ilUser->getLanguage();
1989 } elseif ($_REQUEST["lang"]) {
1990 $lang = (string) $_REQUEST["lang"];
1991 } elseif ($ilSetting) {
1992 $lang = $ilSetting->get("language");
1993 } elseif ($ilClientIniFile) {
1994 $lang = $ilClientIniFile->readVariable("language", "default");
1995 }
1996 } else {
1997 $lang = $lng->getLangKey();
1998 }
1999
2000 $message = "";
2001 if ($ilDB && $a_message_id) {
2002 if (!$lng) {
2003 require_once "./Services/Language/classes/class.ilLanguage.php";
2004 $lng = new ilLanguage($lang);
2005 }
2006
2007 $lng->loadLanguageModule("init");
2008 $message = $lng->txt($a_message_id);
2009 } elseif (is_array($a_message_static)) {
2010 if (!isset($a_message_static[$lang])) {
2011 $lang = "en";
2012 }
2013 $message = $a_message_static[$lang];
2014 }
2015 return $message;
2016 }
language handling
$lng
$lang
Definition: xapiexit.php:8

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

Referenced by handleMaintenanceMode(), and redirect().

+ Here is the caller graph for this function:

Field Documentation

◆ $already_initialized

ilInitialisation::$already_initialized
staticprotected

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


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