// MERGE with 1.4 r7770

This commit is contained in:
rMalie
2011-07-28 09:20:57 +00:00
parent 60b07cacb9
commit c17e7c236d
968 changed files with 26082 additions and 3937 deletions
+2 -1
View File
@@ -26,7 +26,7 @@
*/
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date dans le passé
include_once(INSTALL_PATH.'/classes/ConfigurationTest.php');
include_once(INSTALL_PATH.'/../classes/ConfigurationTest.php');
// Functions list to test with 'test_system'
$funcs = array('fopen', 'fclose', 'fread', 'fwrite', 'rename', 'file_exists', 'unlink', 'rmdir', 'mkdir', 'getcwd', 'chdir', 'chmod');
@@ -60,6 +60,7 @@ $tests_op = array(
'gz' => false,
'mcrypt' => false,
'magicquotes' => false,
'dom' => false,
);
// Execute tests
+37 -7
View File
@@ -31,8 +31,15 @@ $engineType = 'ENGINE_TYPE';
if (function_exists('date_default_timezone_set'))
date_default_timezone_set('Europe/Paris');
define('_PS_MODULE_DIR_', realpath(INSTALL_PATH).'/../modules/');
define('_PS_INSTALLER_PHP_UPGRADE_DIR_', realpath(INSTALL_PATH).'/php/');
// if _PS_ROOT_DIR_ is defined, use it instead of "guessing" the module dir.
if (defined('_PS_ROOT_DIR_') AND !defined('_PS_MODULE_DIR_'))
define('_PS_MODULE_DIR_', _PS_ROOT_DIR_.'/modules/');
else if (!defined('_PS_MODULE_DIR_'))
define('_PS_MODULE_DIR_', INSTALL_PATH.'/../modules/');
if(!defined('_PS_INSTALLER_PHP_UPGRADE_DIR_'))
define('_PS_INSTALLER_PHP_UPGRADE_DIR_', INSTALL_PATH.DIRECTORY_SEPARATOR.'php/');
// Only if loyalty module is installed
require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'update_module_loyalty.php');
// desactivate non-native module
@@ -104,6 +111,8 @@ require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'alter_cms_block.php');
require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'alter_blocklink.php');
require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'alter_productcomments_guest_index.php');
require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'update_module_loyalty.php');
require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'update_module_followup.php');
@@ -122,6 +131,8 @@ require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'migrate_block_info_to_cms_block.php
require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'create_multistore.php');
require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'add_order_state.php');
//old version detection
global $oldversion, $logger;
$oldversion = false;
@@ -133,14 +144,14 @@ if (file_exists(SETTINGS_FILE) AND file_exists(DEFINES_FILE))
}
else
{
die('<action result="fail" error="30" />'."\n");
$logger->logError('The config/settings.inc.php file was not found.');
die('<action result="fail" error="30" />'."\n");
}
if (!file_exists(DEFINES_FILE))
{
die('<action result="fail" error="37" />'."\n");
$logger->logError('The config/settings.inc.php file was not found.');
die('<action result="fail" error="37" />'."\n");
}
include_once(SETTINGS_FILE);
@@ -156,7 +167,8 @@ include_once(DEFINES_FILE);
$oldversion = _PS_VERSION_;
$versionCompare = version_compare(INSTALL_VERSION, _PS_VERSION_);
$versionCompare = version_compare(INSTALL_VERSION, $oldversion);
if ($versionCompare == '-1')
{
$logger->logError('This installer is too old.');
@@ -164,7 +176,7 @@ if ($versionCompare == '-1')
}
elseif ($versionCompare == 0)
{
$logger->logError('You already have the '.INSTALL_VERSION.' version.');
$logger->logError(sprintf('You already have the %s version.',INSTALL_VERSION));
die('<action result="fail" error="28" />'."\n");
}
elseif ($versionCompare === false)
@@ -198,9 +210,27 @@ if (empty($upgradeFiles))
}
natcasesort($upgradeFiles);
$neededUpgradeFiles = array();
// fix : complete version number if there is not all 4 numbers
// for example replace 1.4.3 by 1.4.3.0
// consequences : file 1.4.3.0.sql will be skipped if oldversion = 1.4.3
// @since 1.4.4.0
$arrayVersion = preg_split('#\.#', $oldversion);
$versionNumbers = sizeof($arrayVersion);
if ($versionNumbers != 4)
$arrayVersion = array_pad($arrayVersion, 4, '0');
$oldversion = implode('.', $arrayVersion);
// end of fix
foreach ($upgradeFiles AS $version)
if (version_compare($version, _PS_VERSION_) == 1 AND version_compare(INSTALL_VERSION, $version) != -1)
{
if (version_compare($version, $oldversion) == 1 AND version_compare(INSTALL_VERSION, $version) != -1)
$neededUpgradeFiles[] = $version;
}
if (empty($neededUpgradeFiles))
{
$logger->logError('No upgrade is possible.');
+36
View File
@@ -0,0 +1,36 @@
<?php
/*
* 2007-2011 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-2011 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
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;