ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilRpcIniFileWriter.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
25{
26 protected string $ini = '';
27
28 protected string $host = '';
29 protected int $port = 0;
30 protected string $indexPath = '';
31 protected string $logPath = '';
32 protected string $logLevel = '';
33 protected int $numThreads = 0;
34 protected string $max_file_size = '';
35
38
39 public function __construct()
40 {
41 global $DIC;
42 $this->settings = $DIC->settings();
43 $this->inifile = $DIC['ilIliasIniFile'];
44 }
45
46 public function write(): bool
47 {
48 // Main section
49 $this->ini = "[Server]\n";
50 $this->ini .= "IpAddress = " . $this->getHost() . "\n";
51 $this->ini .= "Port = " . $this->getPort() . "\n";
52 $this->ini .= "IndexPath = " . $this->getIndexPath() . "\n";
53 $this->ini .= "LogFile = " . $this->getLogPath() . "\n";
54 $this->ini .= "LogLevel = " . $this->getLogLevel() . "\n";
55 $this->ini .= "NumThreads = " . $this->getNumThreads() . "\n";
56 $this->ini .= "RamBufferSize = 256\n";
57 $this->ini .= "IndexMaxFileSizeMB = " . $this->getMaxFileSize() . "\n";
58
59 $this->ini .= "\n";
60
61 $this->ini .= "[Client1]\n";
62 $this->ini .= "ClientId = " . CLIENT_ID . "\n";
63 $this->ini .= "NicId = " . $this->settings->get('inst_id', '0') . "\n";
64 $this->ini .= "IliasIniPath = " . $this->inifile->readVariable(
65 'server',
66 'absolute_path'
67 ) . DIRECTORY_SEPARATOR . "ilias.ini.php\n";
68
69 return true;
70 }
71
72 public function getIniString(): string
73 {
74 return $this->ini;
75 }
76
77 public function getHost(): string
78 {
79 return $this->host;
80 }
81
82 public function setHost(string $host): void
83 {
84 $this->host = $host;
85 }
86
87 public function getIndexPath(): string
88 {
89 return $this->indexPath;
90 }
91
92 public function setIndexPath(string $indexPath): void
93 {
94 $this->indexPath = $indexPath;
95 }
96
97 public function getLogLevel(): string
98 {
99 return $this->logLevel;
100 }
101
102 public function setLogLevel(string $logLevel): void
103 {
104 $this->logLevel = $logLevel;
105 }
106
107 public function getLogPath(): string
108 {
109 return $this->logPath;
110 }
111
112 public function setLogPath(string $logPath): void
113 {
114 $this->logPath = $logPath;
115 }
116
117 public function getNumThreads(): int
118 {
119 return $this->numThreads;
120 }
121
122 public function setNumThreads(int $numThreads): void
123 {
124 $this->numThreads = $numThreads;
125 }
126
127 public function getPort(): int
128 {
129 return $this->port;
130 }
131
132 public function setPort(int $port): void
133 {
134 $this->port = $port;
135 }
136
137 public function setMaxFileSize(string $a_fs): void
138 {
139 $this->max_file_size = $a_fs;
140 }
141
142 public function getMaxFileSize(): string
143 {
145 }
146}
INIFile Parser Early access in init proceess! Avoid further dependencies like logging or other servic...
@classDescription Creates a java server ini file for the current client
setIndexPath(string $indexPath)
ILIAS Setting Class.
const CLIENT_ID
Definition: constants.php:41
global $DIC
Definition: shib_login.php:26