Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
class InstallSession
|
||||
{
|
||||
protected static $_instance;
|
||||
protected static $_cookie_mode = false;
|
||||
protected static $_cookie = false;
|
||||
|
||||
public static function getInstance()
|
||||
{
|
||||
@@ -41,39 +43,71 @@ class InstallSession
|
||||
public function __construct()
|
||||
{
|
||||
session_name('install_'.md5(__PS_BASE_URI__));
|
||||
session_start();
|
||||
if (!session_start() || (!isset($_SESSION['session_mode']) && (count($_POST) || count($_GET))))
|
||||
{
|
||||
InstallSession::$_cookie_mode = true;
|
||||
InstallSession::$_cookie = new Cookie('ps_install', null, time() + 7200, null, true);
|
||||
}
|
||||
$_SESSION['session_mode'] = 'session';
|
||||
}
|
||||
|
||||
public function clean()
|
||||
{
|
||||
foreach ($_SESSION as $k => $v)
|
||||
unset($_SESSION[$k]);
|
||||
if (InstallSession::$_cookie_mode)
|
||||
InstallSession::$_cookie->logout();
|
||||
else
|
||||
foreach ($_SESSION as $k => $v)
|
||||
unset($_SESSION[$k]);
|
||||
}
|
||||
|
||||
public function &__get($varname)
|
||||
{
|
||||
if (isset($_SESSION[$varname]))
|
||||
$ref = &$_SESSION[$varname];
|
||||
if (InstallSession::$_cookie_mode)
|
||||
{
|
||||
$ref = InstallSession::$_cookie->{$varname};
|
||||
if (0 === strncmp($ref, 'serialized_array:', strlen('serialized_array:')))
|
||||
$ref = unserialize(substr($ref, strlen('serialized_array:')));
|
||||
}
|
||||
else
|
||||
{
|
||||
$null = null;
|
||||
$ref = &$null;
|
||||
if (isset($_SESSION[$varname]))
|
||||
$ref = &$_SESSION[$varname];
|
||||
else
|
||||
{
|
||||
$null = null;
|
||||
$ref = &$null;
|
||||
}
|
||||
}
|
||||
return $ref;
|
||||
}
|
||||
|
||||
public function __set($varname, $value)
|
||||
{
|
||||
$_SESSION[$varname] = $value;
|
||||
if (InstallSession::$_cookie_mode)
|
||||
{
|
||||
if ($varname == 'xml_loader_ids')
|
||||
return;
|
||||
if (is_array($value))
|
||||
$value = 'serialized_array:'.serialize($value);
|
||||
InstallSession::$_cookie->{$varname} = $value;
|
||||
}
|
||||
else
|
||||
$_SESSION[$varname] = $value;
|
||||
}
|
||||
|
||||
public function __isset($varname)
|
||||
{
|
||||
return isset($_SESSION[$varname]);
|
||||
if (InstallSession::$_cookie_mode)
|
||||
return isset(InstallSession::$_cookie->{$varname});
|
||||
else
|
||||
return isset($_SESSION[$varname]);
|
||||
}
|
||||
|
||||
public function __unset($varname)
|
||||
{
|
||||
unset($_SESSION[$varname]);
|
||||
if (InstallSession::$_cookie_mode)
|
||||
unset(InstallSession::$_cookie->{$varname});
|
||||
else
|
||||
unset($_SESSION[$varname]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
||||
public function process()
|
||||
{
|
||||
if (file_exists(_PS_ROOT_DIR_.'/'.self::SETTINGS_FILE))
|
||||
@require_once _PS_ROOT_DIR_.'/'.self::SETTINGS_FILE;
|
||||
require_once _PS_ROOT_DIR_.'/'.self::SETTINGS_FILE;
|
||||
|
||||
if (!$this->session->process_validated)
|
||||
$this->session->process_validated = array();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<language>
|
||||
<name><![CDATA[Polski(Polish)]]></name>
|
||||
<name><![CDATA[Polski (Polish)]]></name>
|
||||
<language_code>pl</language_code>
|
||||
<date_format_lite>m/j/Y</date_format_lite>
|
||||
<date_format_full>m/j/Y H:i:s</date_format_full>
|
||||
|
||||
@@ -20,8 +20,8 @@ function start_install()
|
||||
$('.stepList li:last-child').removeClass('ok').removeClass('ko');
|
||||
process_pixel = parseInt($('#progress_bar .total').css('width')) / process_steps.length;
|
||||
$('#tabs li a').each(function() {
|
||||
this.rel=$(this).attr('href');
|
||||
this.href='#';
|
||||
this.rel = $(this).attr('href');
|
||||
this.href = '#';
|
||||
});
|
||||
process_install();
|
||||
}
|
||||
@@ -31,11 +31,11 @@ function process_install(step)
|
||||
if (!step)
|
||||
step = process_steps[0];
|
||||
|
||||
$('.installing').hide().html(step.lang+' ...').fadeIn('slow');
|
||||
$('.installing').hide().html(step.lang + ' ...').fadeIn('slow');
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php',
|
||||
data: step.key+'=true',
|
||||
data: step.key + '=true',
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
success: function(json)
|
||||
@@ -51,10 +51,7 @@ function process_install(step)
|
||||
$('#progress_bar .total span').html('100%');
|
||||
|
||||
// Installation finished
|
||||
setTimeout(function()
|
||||
{
|
||||
install_success();
|
||||
}, 700)
|
||||
setTimeout(function(){install_success();}, 700);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -83,4 +83,7 @@
|
||||
<li <?php if ($this->isStepFinished($step)): ?>class="ok"<?php endif; ?>><?php echo $this->l('menu_'.$this->step) ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<noscript>
|
||||
<h3 class="errorBlock" style="margin-bottom:10px"><?php echo $this->l('To install PrestaShop, you need to have JavaScript enabled in your browser.') ?></h3>
|
||||
</noscript>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2013 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-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
function fix_download_product_feature_active()
|
||||
{
|
||||
if (Db::getInstance()->getValue('SELECT COUNT(id_product_download) FROM `'._DB_PREFIX_.'product_download` WHERE `active` = 1 ;') > 0)
|
||||
Configuration::updateGlobaleValue('PS_VIRTUAL_PROD_FEATURE_ACTIVE');
|
||||
}
|
||||
@@ -14,3 +14,6 @@ CHANGE `module_name` `module_name` VARCHAR(64) NULL DEFAULT NULL;
|
||||
/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierDeleteAfter); */;
|
||||
/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierAddAfter); */;
|
||||
/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierUpdateAfter); */;
|
||||
/* PHP:fix_download_product_feature_active(); */;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user