* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 6815 $
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
require_once(SETTINGS_FILE);
include_once(INSTALL_PATH.'/classes/GetVersionFromDb.php');
include(INSTALL_PATH.'/classes/LanguagesManager.php');
$lm = new LanguageManager(INSTALL_PATH.'/langs/list.xml');
$_LANG = array();
$_LIST_WORDS = array();
function lang($txt) {
global $_LANG , $_LIST_WORDS;
return (isset($_LANG[$txt]) ? $_LANG[$txt] : $txt);
}
if ($lm->getIncludeTradFilename())
include_once($lm->getIncludeTradFilename());
$dbVersion = new GetVersionFromDb();
$versions = $dbVersion->getVersions();
$psVersionDb = Configuration::get('PS_VERSION_DB');
// Usefull debug
/* echo '
';
print_r($versions);
print_r($dbVersion->getErrors());
exit;*/
if (!$versions)
{
// Desactivate this case temporary
die('');
$message = lang('Warning, the installer was unable to detect what is your current PrestaShop version from a database structure analysis. This means some fields or tables are missing, and upgrade is under your own risk.');
if ($psVersionDb)
{
$message .= '
' . sprintf(lang('However the installer has detected that the version stored in your configuration table is %1$s'), '' . $psVersionDb . '');
}
die('');
}
foreach ($versions as $version)
{
if (version_compare(_PS_VERSION_, $version) == 0)
{
die('');
}
}
if (count($versions) == 1)
{
die('' . _PS_VERSION_ . '', '' . $versions[0] . '')) . '" />');
}
if ($psVersionDb && in_array($psVersionDb, $versions))
{
die('' . _PS_VERSION_ . '', '' . $psVersionDb . '')) . '" />');
}
else
{
die('' . _PS_VERSION_ . '', '' . $versions[count($versions) - 1] . '', '' . $versions[0] . '')) . '" />');
}