[-] BO : Rename genders images when upgrading from 1.5.0.1 to 1.5.3.1

This commit is contained in:
gRoussac
2013-03-07 11:24:53 +01:00
parent d758801752
commit 101ded7090
4 changed files with 45 additions and 3 deletions
@@ -39,7 +39,9 @@ function update_customer_default_group()
$str_old = 'define(\'_PS_DEFAULT_CUSTOMER_GROUP_\', '.(int)_PS_DEFAULT_CUSTOMER_GROUP_.');';
$str_new = 'define(\'_PS_DEFAULT_CUSTOMER_GROUP_\', '.(int)$ps_customer_group.');';
$content = str_replace($str_old, $str_new, $content);
$result = (bool)file_put_contents($filename, $content);
$result = false;
if(file_exists($filename) && is_writable($filename))
$result = (bool)@file_put_contents($filename, $content);
if($result === true && file_exists($filename) && file_exists($filename_old))
{
@unlink($filename_old);