ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
server.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
14 chdir("../..");
15 const ILIAS_MODULE = "webservice/soap";
18 
19 // php7 only SOAPMODE_INTERNAL
21 
22 require_once 'libs/composer/vendor/autoload.php';
23 
25 
26 $ilIliasIniFile = new ilIniFile("./ilias.ini.php");
27 $ilIliasIniFile->read();
28 
29 if ($ilIliasIniFile->readVariable('https', 'auto_https_detect_enabled')) {
30  $headerName = $ilIliasIniFile->readVariable('https', 'auto_https_detect_header_name');
31  $headerValue = $ilIliasIniFile->readVariable('https', 'auto_https_detect_header_value');
32 
33  $headerName = "HTTP_" . str_replace("-", "_", strtoupper($headerName));
34  if (strcasecmp($_SERVER[$headerName], $headerValue) === 0) {
35  $_SERVER['HTTPS'] = 'on';
36  }
37 }
38 
39 if (IL_SOAPMODE === IL_SOAPMODE_INTERNAL && strcasecmp($_SERVER["REQUEST_METHOD"], "post") === 0) {
40  // This is a SOAP request
41  $uri = ilSoapFunctions::buildHTTPPath() . '/webservice/soap/server.php';
42  if (isset($_GET['client_id'])) {
43  $uri .= '?client_id=' . $_GET['client_id'];
44  $wsdl = $uri . '&wsdl';
45  } else {
46  $wsdl = $uri . '?wsdl';
47  }
48  $soapServer = new SoapServer($wsdl, array('uri' => $uri));
49  $soapServer->setObject(new ilSoapFunctions());
50  $soapServer->handle();
51 } else {
52  // This is a request to display the available SOAP methods or WSDL...
53  include('webservice/soap/nusoapserver.php');
54 }
const IL_SOAPMODE_NUSOAP
Definition: server.php:16
$_GET["client_id"]
Definition: webdav.php:30
$ilIliasIniFile
Definition: server.php:26
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
const IL_SOAPMODE_INTERNAL
Definition: server.php:17
static init(string $a_type)
Init context by type.
const ILIAS_MODULE
Definition: server.php:15
const CONTEXT_SOAP
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_SOAPMODE
Definition: server.php:20