ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSoapInstallationInfoXMLWriter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Member Function Documentation

◆ addClient()

ilSoapInstallationInfoXMLWriter::addClient ( string  $client_directory)

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

References buildClient().

35  : bool
36  {
37  return $this->buildClient($client_directory);
38  }
+ Here is the call graph for this function:

◆ buildClient()

ilSoapInstallationInfoXMLWriter::buildClient ( string  $client_directory)
private

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

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

Referenced by addClient().

72  : bool
73  {
74  global $DIC;
75 
76  $ini_file = "./" . $client_directory . "/client.ini.php";
77 
78  // get settings from ini file
79 
80  $ilClientIniFile = new ilIniFile($ini_file);
81  $ilClientIniFile->read();
82  if ($ilClientIniFile->ERROR !== "") {
83  return false;
84  }
85  $client_id = $ilClientIniFile->readVariable('client', 'name');
86  if ($ilClientIniFile->variableExists('client', 'expose')) {
87  $client_expose = $ilClientIniFile->readVariable('client', 'expose');
88  if ($client_expose === "0") {
89  return false;
90  }
91  }
92 
93  // build dsn of database connection and connect
95  $ilClientIniFile->readVariable("db", "type")
96  );
97  $ilDB->initFromIniFile($ilClientIniFile);
98  if ($ilDB->connect(true)) {
99  unset($DIC['ilDB']);
100  $DIC['ilDB'] = $ilDB;
101 
102 
103  $settings = new ilSetting();
104  unset($DIC["ilSetting"]);
105  $DIC["ilSetting"] = $settings;
106 
107  // workaround to determine http path of client
108  define("IL_INST_ID", (int) $settings->get("inst_id", '0'));
109 
110  $this->xmlStartTag(
111  "Client",
112  [
113  "inst_id" => $settings->get("inst_id"),
114  "id" => basename($client_directory),
115  'enabled' => $ilClientIniFile->readVariable("client", "access") ? "TRUE" : "FALSE",
116  "default_lang" => $ilClientIniFile->readVariable("language", "default")
117  ]
118  );
119  $this->xmlEndTag("Client");
120  }
121  return true;
122  }
static getWrapper(string $a_type)
xmlEndTag(string $tag)
Writes an endtag.
global $DIC
Definition: shib_login.php:22
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
$client_id
Definition: ltiauth.php:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildFooter()

ilSoapInstallationInfoXMLWriter::buildFooter ( )
private

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

References ilXmlWriter\xmlEndTag().

Referenced by end().

67  : void
68  {
69  $this->xmlEndTag('Installation');
70  }
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 51 of file class.ilSoapInstallationInfoXMLWriter.php.

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

Referenced by start().

51  : void
52  {
53  // we have to build the http path here since this request is client independent!
54  $httpPath = ilSoapFunctions::buildHTTPPath();
55  $this->xmlSetDtdDef("<!DOCTYPE Installation PUBLIC \"-//ILIAS//DTD InstallationInfo//EN\" \"" . $httpPath . "/components/ILIAS/Export/xml/ilias_installation_info_5_3.dtd\">");
56  $this->xmlSetGenCmt("Export of ILIAS clients.");
57  $this->xmlHeader();
58  $this->xmlStartTag(
59  "Installation",
60  array(
61  "version" => ILIAS_VERSION,
62  "path" => $httpPath,
63  )
64  );
65  }
xmlSetGenCmt(string $genCmt)
Sets generated comment.
const ILIAS_VERSION
xmlSetDtdDef(string $dtdDef)
Sets dtd definition.
xmlHeader()
Writes xml header.
static buildHTTPPath(bool $use_module_depending_path=true)
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 124 of file class.ilSoapInstallationInfoXMLWriter.php.

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

Referenced by start().

124  : void
125  {
126  $this->xmlStartTag("Settings");
127  $this->xmlElement(
128  "Setting",
129  array("key" => "default_client"),
130  $GLOBALS['DIC']['ilIliasIniFile']->readVariable("clients", "default")
131  );
132  $this->xmlEndTag("Settings");
133  }
xmlEndTag(string $tag)
Writes an endtag.
$GLOBALS["DIC"]
Definition: wac.php:53
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 40 of file class.ilSoapInstallationInfoXMLWriter.php.

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

40  : void
41  {
42  $this->xmlEndTag("Clients");
43  $this->buildFooter();
44  }
xmlEndTag(string $tag)
Writes an endtag.
+ Here is the call graph for this function:

◆ getXML()

ilSoapInstallationInfoXMLWriter::getXML ( )

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

References ilXmlWriter\xmlDumpMem().

46  : string
47  {
48  return $this->xmlDumpMem(false);
49  }
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 23 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 28 of file class.ilSoapInstallationInfoXMLWriter.php.

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

28  : void
29  {
30  $this->buildHeader();
31  $this->buildInstallationInfo();
32  $this->xmlStartTag("Clients");
33  }
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 21 of file class.ilSoapInstallationInfoXMLWriter.php.

Referenced by buildClient(), and setSettings().


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