[*] BO : added backup of the settings file whenever there is a modification #PSCFV-5676

This commit is contained in:
DamienMetzger
2012-11-23 10:16:48 +01:00
parent ff55d6e6bb
commit fc7d62eddf
2 changed files with 25 additions and 15 deletions
+2 -2
View File
@@ -104,8 +104,8 @@ function rewriteSettingsFile($baseUrls = NULL, $theme = NULL, $arrayDB = NULL)
$content = "<?php\n\n";
foreach ($defines as $k => $value)
$content .= 'define(\''.$k.'\', \''.addslashes($value).'\');'."\n";
$content .= "\n?>";
if ($fd = @fopen(_PS_ADMIN_DIR_.'/../config/settings.inc.php', 'w'))
copy(_PS_ADMIN_DIR_.'/../config/settings.inc.php', _PS_ADMIN_DIR_.'/../config/settings.old.php');
if ($fd = fopen(_PS_ADMIN_DIR_.'/../config/settings.inc.php', 'w'))
{
fwrite($fd, $content);
fclose($fd);