◆ 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.
References getClientFileContent(), and writeDataToFile().
42 $this->
writeDataToFile($content, self::CHATROOM_CLIENT_CONFIG_FILENAME);
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.
◆ 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.
References $path, ilFileUtils\getDataDir(), and ilFileUtils\makeDir().
Referenced by writeDataToFile().
static getDataDir()
get data directory (outside webspace)
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
◆ createServerConfigFile()
ilChatroomConfigFileHandler::createServerConfigFile |
( |
array |
$settings | ) |
|
Creates a server config file and saves it to the chatroom data directory.
- Parameters
-
- Exceptions
-
Definition at line 117 of file class.ilChatroomConfigFileHandler.php.
References getServerFileContent(), and writeDataToFile().
120 $this->
writeDataToFile($content, self::CHATROOM_SERVER_CONFIG_FILENAME);
getServerFileContent(array $settings)
Get the server config file contetn as json encoded string.
writeDataToFile(string $content, string $filename)
Writes $content to file named by $filename.
◆ 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.
References $DIC, $type, ILIAS\Repository\int(), ilDBConstants\TYPE_INNODB, and ilDBConstants\TYPE_MYSQL.
Referenced by createClientConfigFile().
57 $type = $DIC[
'ilClientIniFile']->readVariable(
'db',
'type');
68 'host' => $DIC[
'ilClientIniFile']->readVariable(
'db',
'host'),
69 'port' => (
int) $DIC[
'ilClientIniFile']->readVariable(
'db',
'port'),
70 'name' => $DIC[
'ilClientIniFile']->readVariable(
'db',
'name'),
71 'user' => $DIC[
'ilClientIniFile']->readVariable(
'db',
'user'),
72 'pass' => $DIC[
'ilClientIniFile']->readVariable(
'db',
'pass')
75 return json_encode(
$settings, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT);
◆ 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: