- 'configuration items.') . ' */' . NL);
- foreach ($cfg as $key => $item)
- {
- fwrite ($handle, '$cfg[' . jirafeau_quoted ($key) . '] = ');
- if (is_bool ($item))
- fwrite ($handle, ($item ? 'true' : 'false'));
- else if (is_string ($item))
- fwrite ($handle, jirafeau_quoted ($item));
- else if (is_int ($item))
- fwrite ($handle, $item);
- else if (is_array ($item))
- fwrite ($handle, str_replace(array("\n", "\r"), "",
- var_export ($item, true)));
- else
- fwrite ($handle, 'null');
- fwrite ($handle, ';'.NL);
+ 'configuration items.') . ' */' . NL;
+ $content .= '$cfg = ' . var_export($cfg, true) . ';';
+
+ $fileWrite = file_put_contents(JIRAFEAU_CFG, $content);
+
+ if (false === $fileWrite) {
+ jirafeau_fatal_error(t('Can not write local configuration file'));