ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
server.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
24 const ILIAS_MODULE = 'components/ILIAS/soap';
25 
26 chdir('../..');
27 
28 require_once 'vendor/composer/vendor/autoload.php';
29 
30 // Initialize the error_reporting level, until it will be overwritte when ILIAS gets initialized
31 error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
32 
34 
35 $ilIliasIniFile = new ilIniFile('./ilias.ini.php');
36 $ilIliasIniFile->read();
37 
38 if ($ilIliasIniFile->readVariable('https', 'auto_https_detect_enabled')) {
39  $headerName = $ilIliasIniFile->readVariable('https', 'auto_https_detect_header_name');
40  $headerValue = $ilIliasIniFile->readVariable('https', 'auto_https_detect_header_value');
41 
42  $headerName = 'HTTP_' . str_replace('-', '_', strtoupper($headerName));
43  if (strcasecmp($_SERVER[$headerName], $headerValue) === 0) {
44  $_SERVER['HTTPS'] = 'on';
45  }
46 }
47 
48 if (strcasecmp($_SERVER['REQUEST_METHOD'], 'post') === 0) {
49  // This is a SOAP request
50  require_once './components/ILIAS/soap/include/inc.soap_functions.php';
51  $uri = ilSoapFunctions::buildHTTPPath(false) . '/server.php';
52  if (isset($_GET['client_id'])) {
53  $uri .= '?client_id=' . $_GET['client_id'];
54  $wsdl = $uri . '&wsdl';
55  } else {
56  $wsdl = $uri . '?wsdl';
57  }
58 
59  $soapServer = new SoapServer($wsdl, ['uri' => $uri]);
60  $soapServer->setObject(new ilSoapFunctions());
61  $soapServer->handle();
62 } else {
63  // This is a request to display the available SOAP methods or WSDL...
65  require './components/ILIAS/soap/nusoapserver.php';
66 }
$_GET["client_id"]
Definition: webdav.php:30
const IL_SOAPMODE
Definition: server.php:23
static initILIAS()
ilias initialisation
$ilIliasIniFile
Definition: server.php:35
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26
const ILIAS_MODULE
Definition: server.php:24
const IL_SOAPMODE_NUSOAP
Definition: server.php:21
const IL_SOAPMODE_INTERNAL
Definition: server.php:22
static buildHTTPPath(bool $use_module_depending_path=true)
static init(string $a_type)
Init context by type.
const CONTEXT_SOAP