◆ createClientConfigFile()
| ilChatroomConfigFileHandler::createClientConfigFile |
( |
array |
$settings | ) |
|
Creates a client config file and saves it to the chatroom data directory.
- Parameters
-
- Exceptions
-
Definition at line 39 of file class.ilChatroomConfigFileHandler.php.
39 : void
40 {
42 $this->
writeDataToFile($content, self::CHATROOM_CLIENT_CONFIG_FILENAME);
43 }
writeDataToFile(string $content, string $filename)
Writes $content to file named by $filename.
getClientFileContent(array $settings)
Get the client config file content as json encoded string.
References getClientFileContent(), and writeDataToFile().
◆ createDataDirIfNotExists()
| ilChatroomConfigFileHandler::createDataDirIfNotExists |
( |
| ) |
|
|
protected |
Creates a data directory for configuration files, if the directory does not already exists.
- Returns
- string
- Exceptions
-
| RuntimeException | Throws Exception if data dir creation failed |
Definition at line 101 of file class.ilChatroomConfigFileHandler.php.
101 : string
102 {
104
106 throw new RuntimeException('Directory cannot be created');
107 }
108
110 }
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static getDataDir()
get data directory (outside webspace)
References $path, CHATROOM_DATA_DIR, ilFileUtils\getDataDir(), and ilFileUtils\makeDir().
Referenced by writeDataToFile().
◆ createServerConfigFile()
| ilChatroomConfigFileHandler::createServerConfigFile |
( |
array |
$settings | ) |
|
◆ getClientFileContent()
| ilChatroomConfigFileHandler::getClientFileContent |
( |
array |
$settings | ) |
|
|
protected |
Get the client config file content as json encoded string.
- Parameters
-
- Returns
- string
Definition at line 50 of file class.ilChatroomConfigFileHandler.php.
50 : string
51 {
53
54
55
56
57 $type =
$DIC[
'ilClientIniFile']->readVariable(
'db',
'type');
61 ''
62 ], true)) {
64 }
65
68 'host' =>
$DIC[
'ilClientIniFile']->readVariable(
'db',
'host'),
70 'name' =>
$DIC[
'ilClientIniFile']->readVariable(
'db',
'name'),
71 'user' =>
$DIC[
'ilClientIniFile']->readVariable(
'db',
'user'),
72 'pass' =>
$DIC[
'ilClientIniFile']->readVariable(
'db',
'pass')
73 ];
74
75 return json_encode(
$settings, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT);
76 }
readVariable(string $a_group, string $a_var_name)
reads a single variable from a group
References $DIC, ILIAS\LTI\ToolProvider\$settings, $type, ILIAS\Repository\int(), readVariable(), ilDBConstants\TYPE_INNODB, and ilDBConstants\TYPE_MYSQL.
Referenced by createClientConfigFile().
◆ getServerFileContent()
| ilChatroomConfigFileHandler::getServerFileContent |
( |
array |
$settings | ) |
|
|
protected |
◆ writeDataToFile()
| ilChatroomConfigFileHandler::writeDataToFile |
( |
string |
$content, |
|
|
string |
$filename |
|
) |
| |
|
protected |
◆ CHATROOM_CLIENT_CONFIG_FILENAME
| const ilChatroomConfigFileHandler::CHATROOM_CLIENT_CONFIG_FILENAME = 'client.cfg' |
|
private |
◆ CHATROOM_DATA_DIR
| const ilChatroomConfigFileHandler::CHATROOM_DATA_DIR = '/chatroom/' |
|
private |
◆ CHATROOM_SERVER_CONFIG_FILENAME
| const ilChatroomConfigFileHandler::CHATROOM_SERVER_CONFIG_FILENAME = 'server.cfg' |
|
private |
The documentation for this class was generated from the following file: