ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilRpcIniFileWriter.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
30{
31 protected $ini = '';
32
33 protected $host;
34 protected $port;
35 protected $indexPath;
36 protected $logPath;
37 protected $logLevel;
38 protected $numThreads;
39 protected $max_file_size;
40
41
42 public function __construct()
43 {
44 }
45
46 public function write()
47 {
49
50 // Main section
51 $this->ini = "[Server]\n";
52 $this->ini .= "IpAddress = " . $this->getHost() . "\n";
53 $this->ini .= "Port = " . $this->getPort() . "\n";
54 $this->ini .= "IndexPath = " . $this->getIndexPath() . "\n";
55 $this->ini .= "LogFile = " . $this->getLogPath() . "\n";
56 $this->ini .= "LogLevel = " . $this->getLogLevel() . "\n";
57 $this->ini .= "NumThreads = " . $this->getNumThreads() . "\n";
58 $this->ini .= "RamBufferSize = 256\n";
59 $this->ini .= "IndexMaxFileSizeMB = " . $this->getMaxFileSize() . "\n";
60
61 $this->ini .= "\n";
62
63 $this->ini .= "[Client1]\n";
64 $this->ini .= "ClientId = " . CLIENT_ID . "\n";
65 $this->ini .= "NicId = " . $ilSetting->get('inst_id', 0) . "\n";
66 $this->ini .= "IliasIniPath = " . $ilIliasIniFile->readVariable('server', 'absolute_path') . DIRECTORY_SEPARATOR . "ilias.ini.php\n";
67
68 return true;
69 }
70
71 public function getIniString()
72 {
73 return $this->ini;
74 }
75
81 public function getHost()
82 {
83 return $this->host;
84 }
91 public function setHost($host)
92 {
93 $this->host=$host;
94 }
100 public function getIndexPath()
101 {
102 return $this->indexPath;
103 }
110 public function setIndexPath($indexPath)
111 {
112 $this->indexPath=$indexPath;
113 }
119 public function getLogLevel()
120 {
121 return $this->logLevel;
122 }
129 public function setLogLevel($logLevel)
130 {
131 $this->logLevel=$logLevel;
132 }
138 public function getLogPath()
139 {
140 return $this->logPath;
141 }
148 public function setLogPath($logPath)
149 {
150 $this->logPath=$logPath;
151 }
157 public function getNumThreads()
158 {
159 return $this->numThreads;
160 }
167 public function setNumThreads($numThreads)
168 {
169 $this->numThreads=$numThreads;
170 }
176 public function getPort()
177 {
178 return $this->port;
179 }
186 public function setPort($port)
187 {
188 $this->port=$port;
189 }
190
195 public function setMaxFileSize($a_fs)
196 {
197 $this->max_file_size = $a_fs;
198 }
199
204 public function getMaxFileSize()
205 {
207 }
208}
An exception for terminatinating execution or to throw for unit testing.
@classDescription Creates a java server ini file for the current client
setNumThreads($numThreads)
Sets $numThreads.
setIndexPath($indexPath)
Sets $indexPath.
setLogPath($logPath)
Sets $logPath.
getIndexPath()
Returns $indexPath.
setLogLevel($logLevel)
Sets $logLevel.
getLogPath()
Returns $logPath.
getLogLevel()
Returns $logLevel.
getNumThreads()
Returns $numThreads.
setMaxFileSize($a_fs)
Set max file size mb.
getMaxFileSize()
Get max file size mb.
global $ilSetting
Definition: privfeed.php:17
$ilIliasIniFile