// remove deprecated PS_ADMIN_DIR by _PS_ADMIN_DIR_

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8666 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-09-20 15:53:57 +00:00
parent b9e7daf0b7
commit b45dd02452
79 changed files with 339 additions and 339 deletions
+9 -8
View File
@@ -1,4 +1,5 @@
<?php
class Autoupgrade extends Module
{
function __construct()
@@ -9,11 +10,11 @@ class Autoupgrade extends Module
if (!defined('_PS_ADMIN_DIR_'))
{
if (defined('PS_ADMIN_DIR'))
define('_PS_ADMIN_DIR_',PS_ADMIN_DIR);
if (defined('_PS_ADMIN_DIR_'))
define('_PS_ADMIN_DIR_', _PS_ADMIN_DIR_);
else
{
$this->_errors[] = $this->l('This version of PrestaShop cannot be upgraded : PS_ADMIN_DIR constant is missing');
$this->_errors[] = $this->l('This version of PrestaShop cannot be upgraded :_PS_ADMIN_DIR_ constant is missing');
$autoupgradeCanWork = false;
}
}
@@ -36,7 +37,7 @@ class Autoupgrade extends Module
$tab = new Tab($idTab);
$res &= $tab->delete();
}
$idTab = Tab::getIdFromClassName('AdminSelfUpgrade');
// Then we add AdminSelfUpgrade only if not exists
if (!$idTab)
@@ -58,11 +59,11 @@ class Autoupgrade extends Module
if(file_exists($autoupgradeDir.DIRECTORY_SEPARATOR.'ajax-upgradetab.php'))
$res &= unlink($autoupgradeDir.DIRECTORY_SEPARATOR.'ajax-upgradetab.php');
$path = dirname(__FILE__).'/';
$res &= copy($path.'ajax-upgradetab.php',$autoupgradeDir . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php');
$res &= copy($path.'logo.gif',_PS_ROOT_DIR_. DIRECTORY_SEPARATOR . 'img/t/AdminSelfUpgrade.gif');
if (!$res
if (!$res
OR !Tab::getIdFromClassName('AdminSelfUpgrade')
OR !parent::install()
)
@@ -85,7 +86,7 @@ class Autoupgrade extends Module
}
$res &= unlink(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'tabs'.'AdminUpgrade.php');
}
if (file_exists(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'autoupgrade'.DIRECTORY_SEPARATOR.'ajax-upgradetab.php'))
$res &= @unlink(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'autoupgrade'.DIRECTORY_SEPARATOR.'ajax-upgradetab.php');
if (!$res OR !parent::uninstall())