19 declare(strict_types=1);
42 $this->
writeDataToFile($content, self::CHATROOM_CLIENT_CONFIG_FILENAME);
57 $type = $DIC[
'ilClientIniFile']->readVariable(
'db',
'type');
66 $settings[
'database'] = [
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);
87 $handle = fopen(
$path . $filename,
'wb');
89 if (!fwrite($handle, $content)) {
120 $this->
writeDataToFile($content, self::CHATROOM_SERVER_CONFIG_FILENAME);
130 unset($settings[
'ilias_proxy'], $settings[
'client_proxy'], $settings[
'ilias_url'], $settings[
'client_url']);
132 return json_encode($settings, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT);
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.
createDataDirIfNotExists()
Creates a data directory for configuration files, if the directory does not already exists...
static getDataDir()
get data directory (outside webspace)
const CHATROOM_SERVER_CONFIG_FILENAME
getClientFileContent(array $settings)
Get the client config file content as json encoded string.
createClientConfigFile(array $settings)
Creates a client config file and saves it to the chatroom data directory.
createServerConfigFile(array $settings)
Creates a server config file and saves it to the chatroom data directory.
const CHATROOM_CLIENT_CONFIG_FILENAME
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...