// #PSCFV-4530

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17643 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-10-01 13:03:38 +00:00
parent 395054d5f9
commit 05654f808c
@@ -82,23 +82,8 @@ function p15018_change_image_types()
);
}
foreach (scandir(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.'p') as $file)
{
if (!preg_match('/^[a-z]{2}\-[a-z_-]+\.jpg$/i', $file))
continue;
foreach ($replace_types['products'] as $old_type => $new_type)
if (preg_match('/^([a-z]{2})\-'.$old_type.'\.jpg$/i', $file, $matches))
{
p15018_copy_or_rename(
_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.$directory.DIRECTORY_SEPARATOR.$matches[1].'-'.$old_type.'.jpg',
_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.$directory.DIRECTORY_SEPARATOR.$matches[1].'-'.$new_type.'.jpg',
$option
);
}
}
// Then the other entities (if there is less than 500 products, that should not be a problem)
$directories = array('c', 'm', 's', 'scenes', 'scenes'.DIRECTORY_SEPARATOR.'thumbs', 'st');
$directories = array('p', 'c', 'm', 's', 'scenes', 'scenes'.DIRECTORY_SEPARATOR.'thumbs', 'st');
foreach ($directories as $directory)
foreach (scandir(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.$directory) as $file)
{