//// Merge -> revision 8290

This commit is contained in:
tDidierjean
2011-09-01 09:53:43 +00:00
parent b973c3ef12
commit a7ad178f28
50 changed files with 431 additions and 256 deletions
+5 -5
View File
@@ -30,11 +30,11 @@ if (function_exists('date_default_timezone_set'))
define('_PS_MAGIC_QUOTES_GPC_', get_magic_quotes_gpc());
include(INSTALL_PATH.'/classes/AddConfToFile.php');
include(INSTALL_PATH.'/../classes/Validate.php');
include(INSTALL_PATH.'/../classes/Db.php');
include(INSTALL_PATH.'/../classes/Tools.php');
include_once(INSTALL_PATH.'/../config/settings.inc.php');
require_once(INSTALL_PATH.'/classes/AddConfToFile.php');
require_once(INSTALL_PATH.'/../classes/Validate.php');
require_once(INSTALL_PATH.'/../classes/Db.php');
require_once(INSTALL_PATH.'/../classes/Tools.php');
require_once(INSTALL_PATH.'/../config/settings.inc.php');
Context::getContext()->shop = Shop::initialize();
define('_THEME_NAME_', Context::getContext()->shop->getTheme());
+10 -17
View File
@@ -36,29 +36,22 @@ if (file_exists(SETTINGS_FILE))
if (!unlink(SETTINGS_FILE))
die('<action result="fail" error="17" />'."\n");
include(INSTALL_PATH.'/classes/AddConfToFile.php');
include(INSTALL_PATH.'/../classes/Validate.php');
include(INSTALL_PATH.'/../classes/Db.php');
include(INSTALL_PATH.'/../classes/Tools.php');
require_once(INSTALL_PATH.'/classes/AddConfToFile.php');
require_once(INSTALL_PATH.'/../classes/Validate.php');
require_once(INSTALL_PATH.'/../classes/Db.php');
require_once(INSTALL_PATH.'/../classes/Tools.php');
global $logger;
//check db access
include_once(INSTALL_PATH.'/classes/ToolsInstall.php');
$resultDB = ToolsInstall::checkDB($_GET['server'], $_GET['login'], $_GET['password'], $_GET['name'], true, $_GET['engine']);
$resultDB = ToolsInstall::checkDB($_GET['server'], $_GET['login'], $_GET['password'], $_GET['name'], true);
if ($resultDB !== true){
$logger->logError('Invalid database configuration');
die("<action result='fail' error='".$resultDB."'/>\n");
}
// Check POST data...
$data_check = array(
!isset($_GET['mode']) OR ( $_GET['mode'] != "full" AND $_GET['mode'] != "lite"),
!isset($_GET['tablePrefix']) OR !Validate::isMailName($_GET['tablePrefix']) OR !preg_match('/^[a-z0-9_]*$/i', $_GET['tablePrefix'])
);
foreach ($data_check AS $data)
if ($data)
if (!isset($_GET['mode']) OR ($_GET['mode'] != "full" AND $_GET['mode'] != "lite"))
die('<action result="fail" error="8"/>'."\n");
// Writing data in settings file
@@ -67,12 +60,12 @@ $_PS_DIRECTORY_ = trim(str_replace(' ', '%20', INSTALLER__PS_BASE_URI), '/');
$_PS_DIRECTORY_ = ($_PS_DIRECTORY_) ? '/'.$_PS_DIRECTORY_.'/' : '/';
$datas = array(
array('_DB_SERVER_', trim($_GET['server'])),
array('_DB_TYPE_', trim($_GET['type'])),
array('_DB_TYPE_', 'MySQL'),
array('_DB_NAME_', trim($_GET['name'])),
array('_DB_USER_', trim($_GET['login'])),
array('_DB_PASSWD_', trim($_GET['password'])),
array('_DB_PREFIX_', trim($_GET['tablePrefix'])),
array('_MYSQL_ENGINE_', $_GET['engine']),
array('_MYSQL_ENGINE_', trim($_GET['engine'])),
array('_PS_CACHING_SYSTEM_', 'MCached'),
array('_PS_CACHE_ENABLED_', '0'),
array('_MEDIA_SERVER_1_', ''),
@@ -103,8 +96,8 @@ foreach (array(INSTALL_PATH.'/../tools/smarty/cache/', INSTALL_PATH.'/../tools/s
if ($confFile->error != false)
die('<action result="fail" error="'.$confFile->error.'" />'."\n");
//load new settings
include(SETTINGS_FILE);
//load new settings, and fatal error if you can't
require_once(SETTINGS_FILE);
//-----------
//import SQL data
+1 -1
View File
@@ -241,7 +241,7 @@ if (empty($neededUpgradeFiles))
//refresh conf file
include(INSTALL_PATH.'/classes/AddConfToFile.php');
require_once(INSTALL_PATH.'/classes/AddConfToFile.php');
$oldLevel = error_reporting(E_ALL);
$mysqlEngine = (defined('_MYSQL_ENGINE_') ? _MYSQL_ENGINE_ : 'MyISAM');
$datas = array(
+3 -3
View File
@@ -26,9 +26,9 @@
*/
require_once(SETTINGS_FILE);
include_once(INSTALL_PATH.'/classes/GetVersionFromDb.php');
require_once(INSTALL_PATH.'/classes/GetVersionFromDb.php');
include(INSTALL_PATH.'/classes/LanguagesManager.php');
require_once(INSTALL_PATH.'/classes/LanguagesManager.php');
$lm = new LanguageManager(INSTALL_PATH.'/langs/list.xml');
$_LANG = array();
$_LIST_WORDS = array();
@@ -82,4 +82,4 @@ if ($psVersionDb && in_array($psVersionDb, $versions))
else
{
die('<action result="ko" lang="' . htmlspecialchars(sprintf(lang('Warning, we detected that the version specified in your config/settings.inc.php does not match your SQL database structure.<br />File config/settings.inc.php indicates: %1$s<br />Our automatic detection tool has detected a version between %2$s and %3$s<br /><br />You should edit your config/settings.inc.php file to replace %1$s by your real shop version.<br />Failure to fix this issue before upgrading may result in severe complications.<br />Do not forget to relaunch the installer after this modification by pressing F5 on your web browser.'), '<span class="versionInfo">' . _PS_VERSION_ . '</span>', '<span class="versionInfo">' . $versions[count($versions) - 1] . '</span>', '<span class="versionInfo">' . $versions[0] . '</span>')) . '" />');
}
}