25 $this->
writeDataToFile($content, self::CHATROOM_CLIENT_CONFIG_FILENAME);
40 $type =
$a_type = $DIC[
'ilClientIniFile']->readVariable(
'db',
'type');
41 if (in_array(
$type, array(
51 $settings[
'database'] = array(
53 'host' => $DIC[
'ilClientIniFile']->readVariable(
'db',
'host'),
54 'port' => (
int) $DIC[
'ilClientIniFile']->readVariable(
'db',
'port'),
55 'name' => $DIC[
'ilClientIniFile']->readVariable(
'db',
'name'),
56 'user' => $DIC[
'ilClientIniFile']->readVariable(
'db',
'user'),
57 'pass' => $DIC[
'ilClientIniFile']->readVariable(
'db',
'pass')
60 return json_encode($settings, JSON_PRETTY_PRINT);
74 if (!fwrite($handle, $content)) {
75 throw new Exception(
'Cannot write to file');
90 if (!file_exists(
$path)) {
92 throw new Exception(
'Directory cannot be created');
107 $this->
writeDataToFile($content, self::CHATROOM_SERVER_CONFIG_FILENAME);
117 unset($settings[
'ilias_proxy']);
118 unset($settings[
'client_proxy']);
119 unset($settings[
'ilias_url']);
120 unset($settings[
'client_url']);
122 return json_encode($settings, JSON_PRETTY_PRINT);
getServerFileContent(array $settings)
Get the server config file contetn as json encoded string.
const TYPE_PDO_MYSQL_INNODB
const TYPE_PDO_MYSQL_MYISAM
writeDataToFile($content, $filename)
Writes $content to file named by $filename.
createDataDirIfNotExists()
Creates a data directory for configuration files, if the directory does not already exists...
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
const CHATROOM_SERVER_CONFIG_FILENAME
static getDataDir()
get data directory (outside webspace)
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