ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
40 
41  public function __construct()
42  {
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 
60  $this->ini .= "\n";
61 
62  $this->ini .= "[Client1]\n";
63  $this->ini .= "ClientId = ".CLIENT_ID."\n";
64  $this->ini .= "NicId = ".$ilSetting->get('inst_id',0)."\n";
65  $this->ini .= "IliasIniPath = ".$ilIliasIniFile->readVariable('server','absolute_path').DIRECTORY_SEPARATOR."ilias.ini.php\n";
66 
67  return true;
68  }
69 
70  public function getIniString()
71  {
72  return $this->ini;
73  }
74 
80  public function getHost()
81  {
82  return $this->host;
83  }
90  public function setHost($host)
91  {
92  $this->host=$host;
93  }
99  public function getIndexPath()
100  {
101  return $this->indexPath;
102  }
109  public function setIndexPath($indexPath)
110  {
111  $this->indexPath=$indexPath;
112  }
118  public function getLogLevel()
119  {
120  return $this->logLevel;
121  }
128  public function setLogLevel($logLevel)
129  {
130  $this->logLevel=$logLevel;
131  }
137  public function getLogPath()
138  {
139  return $this->logPath;
140  }
147  public function setLogPath($logPath)
148  {
149  $this->logPath=$logPath;
150  }
156  public function getNumThreads()
157  {
158  return $this->numThreads;
159  }
166  public function setNumThreads($numThreads)
167  {
168  $this->numThreads=$numThreads;
169  }
175  public function getPort()
176  {
177  return $this->port;
178  }
185  public function setPort($port)
186  {
187  $this->port=$port;
188  }
189 
190 
191 }
192 ?>