24 $content = $this->getClientFileContent($settings);
25 $this->
writeDataToFile($content, self::CHATROOM_CLIENT_CONFIG_FILENAME);
33 protected function getClientFileContent(
array $settings)
36 global $ilClientIniFile;
41 $type =
$a_type = $ilClientIniFile->readVariable(
'db',
'type');
42 if(in_array($type,
array(
53 $settings[
'database'] =
array(
55 'host' => $ilClientIniFile->readVariable(
'db',
'host'),
56 'port' => (int)$ilClientIniFile->readVariable(
'db',
'port'),
57 'name' => $ilClientIniFile->readVariable(
'db',
'name'),
58 'user' => $ilClientIniFile->readVariable(
'db',
'user'),
59 'pass' => $ilClientIniFile->readVariable(
'db',
'pass')
62 return json_encode($settings, JSON_PRETTY_PRINT);
76 if(!fwrite($handle, $content))
78 throw new Exception(
'Cannot write to file');
93 if(!file_exists(
$path))
97 throw new Exception(
'Directory cannot be created');
112 $this->
writeDataToFile($content, self::CHATROOM_SERVER_CONFIG_FILENAME);
122 unset($settings[
'ilias_proxy']);
123 unset($settings[
'client_proxy']);
124 unset($settings[
'ilias_url']);
125 unset($settings[
'client_url']);
127 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...
Create styles array
The data for the language used.
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)
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