changed path from dirname(__FILE__) to PS_ROOT_DIR
This commit is contained in:
@@ -51,7 +51,7 @@ class Autoload
|
||||
|
||||
protected function __construct()
|
||||
{
|
||||
$this->root_dir = dirname(dirname(__FILE__)).'/';
|
||||
$this->root_dir = _PS_ROOT_DIR_.'/';
|
||||
if (file_exists($this->root_dir.Autoload::INDEX_FILE))
|
||||
$this->index = include($this->root_dir.Autoload::INDEX_FILE);
|
||||
else
|
||||
|
||||
@@ -40,9 +40,9 @@ class ControllerFactoryCore
|
||||
|
||||
if (!class_exists($className, false))
|
||||
{
|
||||
require_once(dirname(__FILE__).'/../controllers/'.$className.'.php');
|
||||
if (file_exists(dirname(__FILE__).'/../override/controllers/'.$className.'.php'))
|
||||
require_once(dirname(__FILE__).'/../override/controllers/'.$className.'.php');
|
||||
require_once(_PS_ROOT_DIR_.'/controllers/'.$className.'.php');
|
||||
if (file_exists(_PS_ROOT_DIR_.'/override/controllers/'.$className.'.php'))
|
||||
require_once(_PS_ROOT_DIR_.'/override/controllers/'.$className.'.php');
|
||||
else
|
||||
{
|
||||
$coreClass = new ReflectionClass($className.'Core');
|
||||
|
||||
@@ -530,8 +530,8 @@ class LanguageCore extends ObjectModel
|
||||
{
|
||||
if (file_exists($image_directory.$this->iso_code.$image))
|
||||
unlink($image_directory.$this->iso_code.$image);
|
||||
if (file_exists(dirname(__FILE__).'/../img/l/'.$this->id.'.jpg'))
|
||||
unlink(dirname(__FILE__).'/../img/l/'.$this->id.'.jpg');
|
||||
if (file_exists(_PS_ROOT_DIR_.'/img/l/'.$this->id.'.jpg'))
|
||||
unlink(_PS_ROOT_DIR_.'/img/l/'.$this->id.'.jpg');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -716,7 +716,7 @@ class LanguageCore extends ObjectModel
|
||||
$flag = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/flags/jpeg/'.$iso_code.'.jpg');
|
||||
if ($flag != null && !preg_match('/<body>/', $flag))
|
||||
{
|
||||
$file = fopen(dirname(__FILE__).'/../img/l/'.(int)$lang->id.'.jpg', 'w');
|
||||
$file = fopen(_PS_ROOT_DIR_.'/img/l/'.(int)$lang->id.'.jpg', 'w');
|
||||
if ($file)
|
||||
{
|
||||
fwrite($file, $flag);
|
||||
@@ -740,14 +740,14 @@ class LanguageCore extends ObjectModel
|
||||
|
||||
foreach (array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_) as $to)
|
||||
foreach ($files_copy as $file)
|
||||
@copy(dirname(__FILE__).'/../img/l'.$file, $to.str_replace('/en', '/'.$iso_code, $file));
|
||||
@copy(_PS_ROOT_DIR_.'/img/l'.$file, $to.str_replace('/en', '/'.$iso_code, $file));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected static function _copyNoneFlag($id)
|
||||
{
|
||||
return copy(dirname(__FILE__).'/../img/l/none.jpg', dirname(__FILE__).'/../img/l/'.$id.'.jpg');
|
||||
return copy(_PS_ROOT_DIR_.'/img/l/none.jpg', _PS_ROOT_DIR_.'/img/l/'.$id.'.jpg');
|
||||
}
|
||||
|
||||
protected static $_cache_language_installation = null;
|
||||
|
||||
+2
-2
@@ -2089,7 +2089,7 @@ exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once(dirname(__FILE__).'/../tools/pclzip/pclzip.lib.php');
|
||||
require_once(_PS_ROOT_DIR_.'/tools/pclzip/pclzip.lib.php');
|
||||
$zip = new PclZip($from_file);
|
||||
return ($zip->privCheckFormat() === true);
|
||||
}
|
||||
@@ -2119,7 +2119,7 @@ exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
require_once(dirname(__FILE__).'/../tools/pclzip/pclzip.lib.php');
|
||||
require_once(_PS_ROOT_DIR_.'/tools/pclzip/pclzip.lib.php');
|
||||
$zip = new PclZip($from_file);
|
||||
$list = $zip->extract(PCLZIP_OPT_PATH, $to_dir);
|
||||
foreach ($list as $file)
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
if (file_exists(dirname(__FILE__).'/../../config/settings.inc.php'))
|
||||
include_once(dirname(__FILE__).'/../../config/settings.inc.php');
|
||||
if (file_exists(_PS_ROOT_DIR_.'/config/settings.inc.php'))
|
||||
include_once(_PS_ROOT_DIR_.'/config/settings.inc.php');
|
||||
|
||||
abstract class DbCore
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user