diff --git a/install-dev/install_version.php b/install-dev/install_version.php index a2b3cef4e..68fe7b0f4 100644 --- a/install-dev/install_version.php +++ b/install-dev/install_version.php @@ -25,4 +25,4 @@ * International Registered Trademark & Property of PrestaShop SA */ -define('_PS_INSTALL_VERSION_', '1.5.0.13'); +define('_PS_INSTALL_VERSION_', '1.5.0.14'); diff --git a/install-dev/upgrade/php/p15014_copy_missing_images_tab_from_installer.php b/install-dev/upgrade/php/p15014_copy_missing_images_tab_from_installer.php new file mode 100644 index 000000000..4841b1828 --- /dev/null +++ b/install-dev/upgrade/php/p15014_copy_missing_images_tab_from_installer.php @@ -0,0 +1,59 @@ + +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision$ +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +/** + * This function copy all images located in /install/data/img/* that are missing in previous upgrade + * in the matching img dir. This does not modify images that are already present. + * + */ +function p15014_copy_missing_images_tab_from_installer() +{ + $res = true; + $DIR_SEP = DIRECTORY_SEPARATOR; + if (!defined('_PS_ROOT_DIR_')) + define('_PS_ROOT_DIR_', realpath(INSTALL_PATH.'/../')); + + $install_dir_path = INSTALL_PATH.$DIR_SEP.'data'.$DIR_SEP.'img'; + $img_dir = scandir($install_dir_path); + foreach($img_dir as $dir) + { + if ($dir[0] == '.') + continue; + + $img_subdir = scandir($install_dir_path.$DIR_SEP.$dir); + foreach($img_subdir as $img) + { + if ($img[0] == '.') + continue; + if (!file_exists(_PS_ROOT_DIR_.$DIR_SEP.'img'.$DIR_SEP.$dir.$DIR_SEP.$img)) + $res &= copy($install_dir_path.$DIR_SEP.$dir.$DIR_SEP.$img, _PS_ROOT_DIR_.$DIR_SEP.'img'.$DIR_SEP.$dir.$DIR_SEP.$img); + } + } + + return $res; +} + diff --git a/install-dev/upgrade/sql/1.5.0.14.sql b/install-dev/upgrade/sql/1.5.0.14.sql new file mode 100644 index 000000000..45da752ac --- /dev/null +++ b/install-dev/upgrade/sql/1.5.0.14.sql @@ -0,0 +1,3 @@ +SET NAMES 'utf8'; + +/* PHP:p15014_copy_missing_images_tab_from_installer(); */;