ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilLoggingErrorSettings.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 2016 Stefan Hecken, Extended GPL, see docs/LICENSE */
3
10 protected $folder;
11 protected $mail;
12
13 protected function __construct() {
14 global $ilIliasIniFile, $ini, $ilClientIniFile;
15
16 //realy not nice but necessary to initalize logger at setup
17 //ilias_ini is named only as $ini in inc.setup_header.php
18 if(!$ilIliasIniFile) {
19 if(!$ini) {
20 throw new Exception("No ILIAS ini");
21 } else {
22 $this->ilias_ini = $ini;
23 }
24 } else {
25 $this->ilias_ini = $ilIliasIniFile;
26 }
27
28 if($ilClientIniFile !== null) {
29 $this->gClientIniFile = $ilClientIniFile;
30 }
31
32 $this->folder = null;
33 $this->mail = null;
34
35 $this->read();
36 }
37
38 public static function getInstance() {
39 return new ilLoggingErrorSettings();
40 }
41
42 protected function setFolder($folder) {
43 $this->folder = $folder;
44 }
45
46 public function setMail($mail) {
47 $this->mail = $mail;
48 }
49
50 public function folder() {
51 return $this->folder;
52 }
53
54 public function mail() {
55 return $this->mail;
56 }
57
61 protected function read() {
62 $this->setFolder($this->ilias_ini->readVariable("log","error_path"));
63
64 if($this->gClientIniFile) {
65 $this->setMail($this->gClientIniFile->readVariable("log","error_recipient"));
66 }
67 }
68
72 public function update() {
73 $this->gClientIniFile->addGroup("log");
74 $this->gClientIniFile->setVariable("log", "error_recipient", trim($this->mail()));
75 $this->gClientIniFile->write();
76 }
77}
An exception for terminatinating execution or to throw for unit testing.
Settings for the error protcoll system.
read()
reads the values from ilias.ini.php
update()
writes mail recipient into client.ini.php
$ini
Definition: raiseError.php:4
$ilIliasIniFile