ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
server.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24const ILIAS_MODULE = 'components/ILIAS/soap';
25
26chdir('../..');
27
28require_once 'vendor/composer/vendor/autoload.php';
29require_once __DIR__ . '/../../artifacts/bootstrap_default.php';
30
32
33entry_point('ILIAS Legacy Initialisation Adapter');
34
35// Initialize the error_reporting level, until it will be overwritte when ILIAS gets initialized
36error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
37
38
39$ilIliasIniFile = new ilIniFile('./ilias.ini.php');
40$ilIliasIniFile->read();
41
42if ($ilIliasIniFile->readVariable('https', 'auto_https_detect_enabled')) {
43 $headerName = $ilIliasIniFile->readVariable('https', 'auto_https_detect_header_name');
44 $headerValue = $ilIliasIniFile->readVariable('https', 'auto_https_detect_header_value');
45
46 $headerName = 'HTTP_' . str_replace('-', '_', strtoupper($headerName));
47 if (strcasecmp($_SERVER[$headerName] ?? '', $headerValue) === 0) {
48 $_SERVER['HTTPS'] = 'on';
49 }
50}
51
52if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') === 0) {
53 // This is a SOAP request
54 require_once './components/ILIAS/soap/include/inc.soap_functions.php';
55 $uri = ilSoapFunctions::buildHTTPPath(false) . '/server.php';
56 if (isset($_GET['client_id'])) {
57 $uri .= '?client_id=' . $_GET['client_id'];
58 $wsdl = $uri . '&wsdl';
59 } else {
60 $wsdl = $uri . '?wsdl';
61 }
62
63 $soapServer = new SoapServer($wsdl, ['uri' => $uri]);
64 $soapServer->setObject(new ilSoapFunctions());
65 $soapServer->handle();
66} else {
67 // This is a request to display the available SOAP methods or WSDL...
69 require './components/ILIAS/soap/nusoapserver.php';
70}
static init(string $a_type)
Init context by type.
Definition: ilContext.php:52
const CONTEXT_SOAP
Definition: ilContext.php:34
INIFile Parser Early access in init proceess! Avoid further dependencies like logging or other servic...
static initILIAS()
ilias initialisation
static buildHTTPPath(bool $use_module_depending_path=true)
$_GET['cmd']
Definition: lti.php:26
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26
entry_point(string $name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: result1.php:21
const ILIAS_MODULE
Definition: server.php:24
const IL_SOAPMODE
Definition: server.php:23
$ilIliasIniFile
Definition: server.php:39
const IL_SOAPMODE_INTERNAL
Definition: server.php:22
const IL_SOAPMODE_NUSOAP
Definition: server.php:21