ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSoapInstallationInfoXMLWriter Class Reference
+ Inheritance diagram for ilSoapInstallationInfoXMLWriter:
+ Collaboration diagram for ilSoapInstallationInfoXMLWriter:

Public Member Functions

 setSettings (array $settings)
 
 start ()
 
 addClient (string $client_directory)
 
 end ()
 
 getXML ()
 
- Public Member Functions inherited from ilXmlWriter
 __construct (string $version="1.0", string $outEnc="utf-8", string $inEnc="utf-8")
 
 xmlSetDtdDef (string $dtdDef)
 Sets dtd definition. More...
 
 xmlSetGenCmt (string $genCmt)
 Sets generated comment. More...
 
 xmlFormatData (string $data)
 Indents text for better reading. More...
 
 xmlHeader ()
 Writes xml header. More...
 
 xmlStartTag (string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
 Writes a starttag. More...
 
 xmlEndTag (string $tag)
 Writes an endtag. More...
 
 xmlData (string $data, bool $encode=true, bool $escape=true)
 Writes data. More...
 
 xmlElement (string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
 Writes a basic element (no children, just textual content) More...
 
 xmlDumpFile (string $file, bool $format=true)
 Dumps xml document from memory into a file. More...
 
 xmlDumpMem (bool $format=true)
 Returns xml document from memory. More...
 
 appendXML (string $a_str)
 append xml string to document More...
 
 xmlClear ()
 clears xmlStr More...
 

Protected Attributes

array $settings = []
 

Private Member Functions

 buildHeader ()
 
 buildFooter ()
 
 buildClient (string $client_directory)
 
 buildInstallationInfo ()
 

Detailed Description

Definition at line 7 of file class.ilSoapInstallationInfoXMLWriter.php.

Member Function Documentation

◆ addClient()

ilSoapInstallationInfoXMLWriter::addClient ( string  $client_directory)

Definition at line 23 of file class.ilSoapInstallationInfoXMLWriter.php.

References buildClient().

23  : bool
24  {
25  return $this->buildClient($client_directory);
26  }
+ Here is the call graph for this function:

◆ buildClient()

ilSoapInstallationInfoXMLWriter::buildClient ( string  $client_directory)
private

Definition at line 60 of file class.ilSoapInstallationInfoXMLWriter.php.

References $client_id, $DIC, $ilDB, $settings, ilDBWrapperFactory\getWrapper(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by addClient().

60  : bool
61  {
62  global $DIC;
63 
64  $ini_file = "./" . $client_directory . "/client.ini.php";
65 
66  // get settings from ini file
67  require_once("./Services/Init/classes/class.ilIniFile.php");
68 
69  $ilClientIniFile = new ilIniFile($ini_file);
70  $ilClientIniFile->read();
71  if ($ilClientIniFile->ERROR !== "") {
72  return false;
73  }
74  $client_id = $ilClientIniFile->readVariable('client', 'name');
75  if ($ilClientIniFile->variableExists('client', 'expose')) {
76  $client_expose = $ilClientIniFile->readVariable('client', 'expose');
77  if ($client_expose === "0") {
78  return false;
79  }
80  }
81 
82  // build dsn of database connection and connect
84  $ilClientIniFile->readVariable("db", "type")
85  );
86  $ilDB->initFromIniFile($ilClientIniFile);
87  if ($ilDB->connect(true)) {
88  unset($DIC['ilDB']);
89  $DIC['ilDB'] = $ilDB;
90 
91  require_once("Services/Administration/classes/class.ilSetting.php");
92 
93  $settings = new ilSetting();
94  unset($DIC["ilSetting"]);
95  $DIC["ilSetting"] = $settings;
96 
97  // workaround to determine http path of client
98  if (!defined("IL_INST_ID")) {
99  define("IL_INST_ID", (int)$settings->get("inst_id", '0'));
100  }
101 
102  $this->xmlStartTag(
103  "Client",
104  [
105  "inst_id" => $settings->get("inst_id"),
106  "id" => basename($client_directory),
107  'enabled' => $ilClientIniFile->readVariable("client", "access") ? "TRUE" : "FALSE",
108  "default_lang" => $ilClientIniFile->readVariable("language", "default")
109  ]
110  );
111  $this->xmlEndTag("Client");
112  }
113  return true;
114 
115  }
static getWrapper(string $a_type)
xmlEndTag(string $tag)
Writes an endtag.
global $DIC
Definition: feed.php:28
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
$client_id
Definition: ltiauth.php:68
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFooter()

ilSoapInstallationInfoXMLWriter::buildFooter ( )
private

Definition at line 55 of file class.ilSoapInstallationInfoXMLWriter.php.

References ilXmlWriter\xmlEndTag().

Referenced by end().

55  : void
56  {
57  $this->xmlEndTag('Installation');
58  }
xmlEndTag(string $tag)
Writes an endtag.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildHeader()

ilSoapInstallationInfoXMLWriter::buildHeader ( )
private

Definition at line 39 of file class.ilSoapInstallationInfoXMLWriter.php.

References ilSoapFunctions\buildHTTPPath(), ILIAS_VERSION, ilXmlWriter\xmlHeader(), ilXmlWriter\xmlSetDtdDef(), ilXmlWriter\xmlSetGenCmt(), and ilXmlWriter\xmlStartTag().

Referenced by start().

39  : void
40  {
41  // we have to build the http path here since this request is client independent!
42  $httpPath = ilSoapFunctions::buildHTTPPath();
43  $this->xmlSetDtdDef("<!DOCTYPE Installation PUBLIC \"-//ILIAS//DTD InstallationInfo//EN\" \"" . $httpPath . "/xml/ilias_installation_info_5_3.dtd\">");
44  $this->xmlSetGenCmt("Export of ILIAS clients.");
45  $this->xmlHeader();
46  $this->xmlStartTag(
47  "Installation",
48  array(
49  "version" => ILIAS_VERSION,
50  "path" => $httpPath,
51  )
52  );
53  }
const ILIAS_VERSION
xmlSetGenCmt(string $genCmt)
Sets generated comment.
xmlSetDtdDef(string $dtdDef)
Sets dtd definition.
xmlHeader()
Writes xml header.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildInstallationInfo()

ilSoapInstallationInfoXMLWriter::buildInstallationInfo ( )
private

Definition at line 117 of file class.ilSoapInstallationInfoXMLWriter.php.

References $GLOBALS, ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

Referenced by start().

117  : void
118  {
119  $this->xmlStartTag("Settings");
120  $this->xmlElement(
121  "Setting",
122  array("key" => "default_client"),
123  $GLOBALS['DIC']['ilIliasIniFile']->readVariable("clients", "default")
124  );
125  $this->xmlEndTag("Settings");
126  }
xmlEndTag(string $tag)
Writes an endtag.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ end()

ilSoapInstallationInfoXMLWriter::end ( )

Definition at line 28 of file class.ilSoapInstallationInfoXMLWriter.php.

References buildFooter(), and ilXmlWriter\xmlEndTag().

28  : void
29  {
30  $this->xmlEndTag("Clients");
31  $this->buildFooter();
32  }
xmlEndTag(string $tag)
Writes an endtag.
+ Here is the call graph for this function:

◆ getXML()

ilSoapInstallationInfoXMLWriter::getXML ( )

Definition at line 34 of file class.ilSoapInstallationInfoXMLWriter.php.

References ilXmlWriter\xmlDumpMem().

34  : string
35  {
36  return $this->xmlDumpMem(false);
37  }
xmlDumpMem(bool $format=true)
Returns xml document from memory.
+ Here is the call graph for this function:

◆ setSettings()

ilSoapInstallationInfoXMLWriter::setSettings ( array  $settings)

Definition at line 11 of file class.ilSoapInstallationInfoXMLWriter.php.

References $settings, and ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ start()

ilSoapInstallationInfoXMLWriter::start ( )

Definition at line 16 of file class.ilSoapInstallationInfoXMLWriter.php.

References buildHeader(), buildInstallationInfo(), and ilXmlWriter\xmlStartTag().

16  : void
17  {
18  $this->buildHeader();
19  $this->buildInstallationInfo();
20  $this->xmlStartTag("Clients");
21  }
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
+ Here is the call graph for this function:

Field Documentation

◆ $settings

array ilSoapInstallationInfoXMLWriter::$settings = []
protected

Definition at line 9 of file class.ilSoapInstallationInfoXMLWriter.php.

Referenced by buildClient(), and setSettings().


The documentation for this class was generated from the following file: