ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
13 chdir("../..");
14 define("ILIAS_MODULE", "webservice/soap");
15 define("IL_SOAPMODE_NUSOAP", 0);
16 define("IL_SOAPMODE_INTERNAL", 1);
17 
18 // php7 only SOAPMODE_INTERNAL
19 define('IL_SOAPMODE', IL_SOAPMODE_INTERNAL);
20 include_once "Services/Context/classes/class.ilContext.php";
22 
23 require_once("./Services/Init/classes/class.ilIniFile.php");
24 $ilIliasIniFile = new ilIniFile("./ilias.ini.php");
25 $ilIliasIniFile->read();
26 
27 if ((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 
37 if (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 }
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']
$_GET["client_id"]
static buildHTTPPath()
builds http path if no client is available
$ilIliasIniFile
Definition: server.php:24
const IL_SOAPMODE_INTERNAL
Definition: server.php:16
Create styles array
The data for the language used.
static init($a_type)
Init context by type.
const CONTEXT_SOAP
INIFile Parser.
const IL_SOAPMODE
Definition: server.php:19