[*] Project : Version 2 of Smarty has been removed for using only version 3

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8569 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
aFolletete
2011-09-14 13:27:32 +00:00
parent e5703a3d69
commit b3d60e169b
89 changed files with 19 additions and 9888 deletions
+1 -13
View File
@@ -1143,11 +1143,6 @@ abstract class ModuleCore
{
$context = Context::getContext();
if (Configuration::get('PS_FORCE_SMARTY_2')) /* Keep a backward compatibility for Smarty v2 */
{
$previousTemplate = $context->smarty->currentTemplate;
$context->smarty->currentTemplate = substr(basename($template), 0, -4);
}
$context->smarty->assign('module_dir', __PS_BASE_URI__.'modules/'.basename($file, '.php').'/');
if (($overloaded = self::_isTemplateOverloadedStatic(basename($file, '.php'), $template)) === NULL)
$result = Tools::displayError('No template found for module').' '.basename($file,'.php');
@@ -1156,8 +1151,6 @@ abstract class ModuleCore
$context->smarty->assign('module_template_dir', ($overloaded ? _THEME_DIR_ : __PS_BASE_URI__).'modules/'.basename($file, '.php').'/');
$result = $context->smarty->fetch(($overloaded ? _PS_THEME_DIR_.'modules/'.basename($file, '.php') : _PS_MODULE_DIR_.basename($file, '.php')).'/'.$template, $cacheId, $compileId);
}
if (Configuration::get('PS_FORCE_SMARTY_2')) /* Keep a backward compatibility for Smarty v2 */
$context->smarty->currentTemplate = $previousTemplate;
return $result;
}
@@ -1170,12 +1163,7 @@ abstract class ModuleCore
{
$context = Context::getContext();
/* Use Smarty 3 API calls */
if (!Configuration::get('PS_FORCE_SMARTY_2')) /* PHP version > 5.1.2 */
return $context->smarty->isCached($this->_getApplicableTemplateDir($template).$template, $cacheId, $compileId);
/* or keep a backward compatibility if PHP version < 5.1.2 */
else
return $context->smarty->is_cached($this->_getApplicableTemplateDir($template).$template, $cacheId, $compileId);
return $context->smarty->isCached($this->_getApplicableTemplateDir($template).$template, $cacheId, $compileId);
}
protected function _clearCache($template, $cacheId = NULL, $compileId = NULL)
+1 -17
View File
@@ -1871,19 +1871,6 @@ FileETag INode MTime Size
return $version;
}
/**
* @desc selection of Smarty depending on the version of php
*
*/
public static function selectionVersionSmarty()
{
//Smarty 3 requirements PHP 5.2 +
if (strnatcmp(self::checkPhpVersion(),'5.2.0') >= 0)
Configuration::updateValue('PS_FORCE_SMARTY_2', 0);
else
Configuration::updateValue('PS_FORCE_SMARTY_2',1);
}
/**
* @desc try to open a zip file in order to check if it's valid
@@ -2052,10 +2039,7 @@ FileETag INode MTime Size
*/
public static function clearCache($smarty)
{
if (!Configuration::get('PS_FORCE_SMARTY_2'))
$smarty->clearAllCache();
else
$smarty->clear_all_cache();
$smarty->clearAllCache();
}
/**