ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilLTIConsumerDataService.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
14namespace LTI;
15
17{
18 // protected static function getIniHost() {
19 // // Create ini-handler (onces)
20 // ilInitialisation::initIliasIniFile();
21 // global $ilIliasIniFile;
22 // // Return [server] -> 'http_path' variable from 'ilias.init.php'
23 // $http_path = $ilIliasIniFile->readVariable('server', 'http_path');
24 // // Strip http:// & https://
25 // if (strpos($http_path, 'https://') !== false)
26 // $http_path = substr($http_path, 8);
27 // if (strpos($http_path, 'http://') !== false)
28 // $http_path = substr($http_path, 7);
29 // // Return clean host
30 // return $http_path;
31 // }
32
33 public static function initIlias($client_id)
34 {
35 // if (isset($_GET["client_id"]))
36 // {
37 // $cookie_domain = $_SERVER['SERVER_NAME'];
38 // $cookie_path = dirname( $_SERVER['PHP_SELF'] );
39
40 // /* if ilias is called directly within the docroot $cookie_path
41 // is set to '/' expecting on servers running under windows..
42 // here it is set to '\'.
43 // in both cases a further '/' won't be appended due to the following regex
44 // */
45 // $cookie_path .= (!preg_match("/[\/|\\\\]$/", $cookie_path)) ? "/" : "";
46
47 // if($cookie_path == "\\") $cookie_path = '/';
48
49 // $cookie_domain = ''; // Temporary Fix
50
51 // setcookie("ilClientId", $_GET["client_id"], 0, $cookie_path, $cookie_domain);
52
53 // $_COOKIE["ilClientId"] = $_GET["client_id"];
54 // }
55
56
57
58 define("CLIENT_ID", $client_id);
59 define('IL_COOKIE_HTTPONLY', true); // Default Value
60 define('IL_COOKIE_EXPIRE', 0);
61 define('IL_COOKIE_PATH', '/');
62 define('IL_COOKIE_DOMAIN', '');
63 require_once('Services/Context/classes/class.ilContext.php');
65 //UK
66 require_once("Services/Init/classes/class.ilInitialisation.php");
68 // Remember original values
69 // $_ORG_SERVER = array(
70 // 'HTTP_HOST' => $_SERVER['HTTP_HOST'],
71 // 'REQUEST_URI' => $_SERVER['REQUEST_URI'],
72 // 'PHP_SELF' => $_SERVER['PHP_SELF'],
73 // );
74 // // Overwrite $_SERVER entries which would confuse ILIAS during initialisation
75 // $_SERVER['REQUEST_URI'] = '';
76 // $_SERVER['PHP_SELF'] = '/index.php';
77 // $_SERVER['HTTP_HOST'] = self::getIniHost();
78 // require_once "./Services/Utilities/classes/class.ilUtil.php";
79 // //ilInitialisation::initIliasIniFile();
80 // ilInitialisation::initClientIniFile();
81 // ilInitialisation::initDatabase();
82
83 // // Restore original, since this could lead to bad side-effects otherwise
84 // $_SERVER['HTTP_HOST'] = $_ORG_SERVER['HTTP_HOST'];
85 // $_SERVER['REQUEST_URI'] = $_ORG_SERVER['REQUEST_URI'];
86 // $_SERVER['PHP_SELF'] = $_ORG_SERVER['PHP_SELF'];
87 // ilInitialisation::initLog();//UK
88 }
89}
90
91
99require_once('Services/Init/classes/class.ilInitialisation.php');
101{
108 public static function initGlobal($a_name, $a_class, $a_source_file = null)
109 {
110 return parent::initGlobal($a_name, $a_class, $a_source_file);
111 }
112
119 public static function initDatabase()
120 {
121 if (!isset($GLOBALS['ilDB'])) { //TODO DIC
122 parent::initGlobal("ilBench", "ilBenchmark", "./Services/Utilities/classes/class.ilBenchmark.php");
123 parent::initDatabase();
124 }
125 }
126
133 public static function initIliasIniFile()
134 {
135 if (!isset($GLOBALS['ilIliasIniFile'])) {
136 parent::initIliasIniFile();
137 }
138 }
139
146 public static function initClientIniFile()
147 {
148 if (!isset($GLOBALS['initClientIniFile'])) {
149 parent::initClientIniFile();
150 }
151 }
152
153 //UK
154 public static function initLog()
155 {
156 if (!isset($GLOBALS['ilLog'])) {
157 parent::initLog();
158 parent::initGlobal("ilAppEventHandler", "ilAppEventHandler", "./Services/EventHandling/classes/class.ilAppEventHandler.php");
159 }
160 }
161}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
An exception for terminatinating execution or to throw for unit testing.
Class: ilInitialisation_Public Helper class that derives from ilInitialisation in order to 'publish' ...
static initGlobal($a_name, $a_class, $a_source_file=null)
Function; initGlobal($a_name, $a_class, $a_source_file) Derive from protected to public....
static initLog()
Init log instance.
static initIliasIniFile()
Function: initIliasIniFile() Derive from protected to public...
static initClientIniFile()
Function: initClientIniFile() Derive from protected to public...
static initDatabase()
Function: initDatabase() Derive from protected to public...
static init($a_type)
Init context by type.
const CONTEXT_SCORM
ILIAS Initialisation Utility Class perform basic setup: init database handler, load configuration fil...
static initILIAS()
ilias initialisation
$client_id