// fix upgrade script missing tab images (and all img located in /install/data/img/ immediates subdir) #PSCFV-2749, #PSCFV-2506
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15973 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -25,4 +25,4 @@
|
|||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('_PS_INSTALL_VERSION_', '1.5.0.13');
|
define('_PS_INSTALL_VERSION_', '1.5.0.14');
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
/*
|
||||||
|
* 2007-2012 PrestaShop
|
||||||
|
*
|
||||||
|
* NOTICE OF LICENSE
|
||||||
|
*
|
||||||
|
* This source file is subject to the Open Software License (OSL 3.0)
|
||||||
|
* that is bundled with this package in the file LICENSE.txt.
|
||||||
|
* It is also available through the world-wide-web at this URL:
|
||||||
|
* http://opensource.org/licenses/osl-3.0.php
|
||||||
|
* If you did not receive a copy of the license and are unable to
|
||||||
|
* obtain it through the world-wide-web, please send an email
|
||||||
|
* to license@prestashop.com so we can send you a copy immediately.
|
||||||
|
*
|
||||||
|
* DISCLAIMER
|
||||||
|
*
|
||||||
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||||
|
* versions in the future. If you wish to customize PrestaShop for your
|
||||||
|
* needs please refer to http://www.prestashop.com for more information.
|
||||||
|
*
|
||||||
|
* @author PrestaShop SA <contact@prestashop.com>
|
||||||
|
* @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;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
SET NAMES 'utf8';
|
||||||
|
|
||||||
|
/* PHP:p15014_copy_missing_images_tab_from_installer(); */;
|
||||||
Reference in New Issue
Block a user