X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/18b6e57c0091dfdd14427c940346da59298b29eb..bf0a496a102b28c08906879f18120b194793a922:/install.php?ds=sidebyside diff --git a/install.php b/install.php index b96593e..fbd3667 100644 --- a/install.php +++ b/install.php @@ -18,13 +18,10 @@ * along with this program. If not, see . */ define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/'); -define ('NL', "\n"); -define ('QUOTE', "'"); -define ('JIRAFEAU_CFG', JIRAFEAU_ROOT.'lib/config.local.php'); +define ('JIRAFEAU_CFG', JIRAFEAU_ROOT . 'lib/config.local.php'); define ('JIRAFEAU_VAR_RAND_LENGTH', 15); -require (JIRAFEAU_ROOT . 'lib/config.original.php'); require (JIRAFEAU_ROOT . 'lib/settings.php'); require (JIRAFEAU_ROOT . 'lib/functions.php'); require (JIRAFEAU_ROOT . 'lib/lang.php'); @@ -42,32 +39,17 @@ jirafeau_quoted ($str) function jirafeau_export_cfg ($cfg) { - $handle = fopen (JIRAFEAU_CFG, 'w'); - fwrite ($handle, ' $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')); } - /* No newline at the end of the file to be able to send headers. */ - fwrite ($handle, '?>'); - fclose ($handle); } function @@ -224,8 +206,7 @@ case 1: default: ?>

" method = "post">

" method = "post">

" method = "post">

" method = "post">

'.$err['why'].'
'.NL; - ?>