ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
server.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
13chdir("../..");
14define("ILIAS_MODULE", "webservice/soap");
15define("IL_SOAPMODE_NUSOAP", 0);
16define("IL_SOAPMODE_INTERNAL", 1);
17
18// php7 only SOAPMODE_INTERNAL
19define('IL_SOAPMODE', IL_SOAPMODE_INTERNAL);
20include_once "Services/Context/classes/class.ilContext.php";
22
23require_once("./Services/Init/classes/class.ilIniFile.php");
24$ilIliasIniFile = new ilIniFile("./ilias.ini.php");
25$ilIliasIniFile->read();
26
27if ((bool) $ilIliasIniFile->readVariable('https', 'auto_https_detect_enabled')) {
28 $headerName = $ilIliasIniFile->readVariable('https', 'auto_https_detect_header_name');
29 $headerValue = $ilIliasIniFile->readVariable('https', 'auto_https_detect_header_value');
30
31 $headerName = "HTTP_" . str_replace("-", "_", strtoupper($headerName));
32 if (strcasecmp($_SERVER[$headerName], $headerValue) == 0) {
33 $_SERVER['HTTPS'] = 'on';
34 }
35}
36
37if (IL_SOAPMODE == IL_SOAPMODE_INTERNAL && strcasecmp($_SERVER["REQUEST_METHOD"], "post") == 0) {
38 // This is a SOAP request
39 include_once('webservice/soap/include/inc.soap_functions.php');
40 $uri = ilSoapFunctions::buildHTTPPath() . '/webservice/soap/server.php';
41 if (isset($_GET['client_id'])) {
42 $uri .= '?client_id=' . $_GET['client_id'];
43 $wsdl = $uri . '&wsdl';
44 } else {
45 $wsdl = $uri . '?wsdl';
46 }
47 $soapServer = new SoapServer($wsdl, array('uri' => $uri));
48 $soapServer->setObject(new ilSoapFunctions());
49 $soapServer->handle();
50} else {
51 // This is a request to display the available SOAP methods or WSDL...
52 include('webservice/soap/nusoapserver.php');
53}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
static init($a_type)
Init context by type.
const CONTEXT_SOAP
INIFile Parser.
static buildHTTPPath()
builds http path if no client is available
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
const IL_SOAPMODE
Definition: server.php:19
$ilIliasIniFile
Definition: server.php:24
const IL_SOAPMODE_INTERNAL
Definition: server.php:16