-function
-jirafeau_quoted ($str)
-{
- return QUOTE . str_replace (QUOTE, "\'", $str) . QUOTE;
-}
-
-function
-jirafeau_export_cfg ($cfg)
-{
- $handle = fopen (JIRAFEAU_CFG, 'w');
- fwrite ($handle, '<?php' . NL);
- fwrite ($handle,
- '/* ' .
- _ ('This file was generated by the install process. ' .
- 'You can edit it. Please see config.php to understand the ' .
- '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
- fwrite ($handle, 'null');
- fwrite ($handle, ';'.NL);
- }
- /* No newline at the end of the file to be able to send headers. */
- fwrite ($handle, '?>');
- fclose ($handle);
-}