Browse Source

Make robuster and simpler cration of config file

Now SQL password can contains any character it will work and we can put html code inside the info message without breaking the conf.php file.
pull/16/head
Adrien Dorsaz 12 years ago
parent
commit
3c3e9082c6
  1. 8
      system/Conf.php

8
system/Conf.php

@ -75,11 +75,9 @@ class Conf
}
static function saveConfFile($conf = array()) {
$out = '<?php $conf = array(';
foreach($conf as $key => $value)
$out .= "'".$key."' => '". $value . "',"."\n";
$out .= ');';
$out = "<?php\n"
.'$conf = '.var_export($conf, true).";\n"
."?>\n";
$fp = fopen(DOCUMENT_ROOT.self::$conf_path.'/conf.php', 'w');
fwrite($fp, $out);

Loading…
Cancel
Save