19declare(strict_types=1);
42 $this->
writeDataToFile($content, self::CHATROOM_CLIENT_CONFIG_FILENAME);
57 $type =
$DIC[
'ilClientIniFile']->readVariable(
'db',
'type');
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')
75 return json_encode(
$settings, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT);
89 if (!fwrite($handle, $content)) {
90 throw new RuntimeException(
'Cannot write to file');
106 throw new RuntimeException(
'Directory cannot be created');
120 $this->
writeDataToFile($content, self::CHATROOM_SERVER_CONFIG_FILENAME);
132 return json_encode(
$settings, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT);
readVariable(string $a_group, string $a_var_name)
reads a single variable from a group
writeDataToFile(string $content, string $filename)
Writes $content to file named by $filename.
createDataDirIfNotExists()
Creates a data directory for configuration files, if the directory does not already exists.
const CHATROOM_SERVER_CONFIG_FILENAME
getServerFileContent(array $settings)
Get the server config file contetn as json encoded string.
createClientConfigFile(array $settings)
Creates a client config file and saves it to the chatroom data directory.
getClientFileContent(array $settings)
Get the client config file content as json encoded string.
const CHATROOM_CLIENT_CONFIG_FILENAME
createServerConfigFile(array $settings)
Creates a server config file and saves it to the chatroom data directory.
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)