|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
gtraxx Smarty Regular
Joined: 08 Jan 2008 Posts: 56
|
Posted: Thu Sep 22, 2011 7:35 am Post subject: Bug compile smarty 3.1 |
|
|
Hello, I just did the migration of smarty 3.0.8 to 3.1 and I get an error that I can not explain
Quote: | Notice: Undefined property: frontend_config_smarty::$compile_error in C:\wamp\www\mytest\library\smarty3\Smarty.class.php on line 638
Fatal error: Uncaught exception 'SmartyException' with message 'property 'deprecation_notices' does not exist.' in C:\wamp\www\mytest\library\smarty3\sysplugins\smarty_internal_templatebase.php:690 Stack trace: #0 [internal function]: Smarty_Internal_TemplateBase->__call('setDeprecationN...', Array) #1 C:\wamp\www\cinepedia\api\frontend\config\smarty.php(8: frontend_config_smarty->setDeprecationNotices(false) #2 C:\wamp\www\cinepedia\api\frontend\config\smarty.php(49): frontend_config_smarty->setParams() #3 C:\wamp\www\mytest\api\frontend\config\smarty.php(153): frontend_config_smarty->__construct() #4 C:\wamp\www\mytest\api\frontend\model\template.php(49): frontend_config_smarty::getInstance() #5 C:\wamp\www\mytest\api\frontend\controller\home.php(15): frontend_model_template::display('home/index.phtm...') #6 C:\wamp\www\cinepedia\index.php(23): frontend_controller_home->run() #7 {main} thrown in C:\wamp\www\mytest\library\smarty3\sysplugins\smarty_internal_templatebase.php on line 690 |
My class was working fine until now but may be changes should I do?
Code: | class backend_config_smarty extends Smarty{
/**
* Variable statique permettant de porter l'instance unique
*/
static protected $instance;
/**
* @var protected server_root
*/
static protected $server_root;
/**
* function construct class
*
*/
public function __construct(){
/**
* include parent var smarty
*/
self::$server_root = $_SERVER['DOCUMENT_ROOT'];
parent::__construct();
self::setParams();
/*
You can remove this comment, if you prefer this JSP tag style
instead of the default { and }
$this->left_delimiter = '<%';
$this->right_delimiter = '%>';
*/
}
/**
* Les paramètres pour la configuration de smarty 3
*/
private function setParams(){
/**
* Path -> configs
*/
$this->config_dir = self::$server_root."/i18/";
/**
* Path -> templates
*/
$this->template_dir = self::$server_root."/view/";
/**
* path plugins
* @var void
*/
$this->plugins_dir = array(
'../library/smarty3/plugins/'
,'../api/smartytools/core/'
,self::$server_root.'/tools/'
);
/**
* Path -> compile
*/
$this->compile_dir = dirname(self::$server_root)."/mageadmin/caching/var_compile/";
//$this->error_reporting = 1;
$this->compile_error = false;
/**
* set $smarty->deprecation_notices
*/
$this->setDeprecationNotices(false);
/**
* debugging (true/false)
*/
$this->debugging = false;
$this->getDebugging();
/**
* compile (true/false)
*/
$this->compile_check = true;
/**
* Force compile
* @var void
* (true/false)
*/
$this->force_compile = false;
/**
* set Caching (true/false)
*/
$this->setCaching(false);
/**
* caching
*/
$this->caching = false;
/**
* cache lifetime
* @var $cache_lifetime
*/
//$this->cache_lifetime = 360;
/**
* Use sub dirs (true/false)
*/
$this->use_sub_dirs = false;
/**
* cache_dir -> cache
*/
$this->cache_dir = dirname(self::$server_root).'/caching/private_tpl/';
/**
* Security
*/
$this->security = false;
/**
* load pre filter
*/
//$this->load_filter('pre','magixmin');
$this->autoload_filters = array('pre' => array('magixmin'));
/**
*
* @var error_reporting
*/
$this->error_reporting = error_reporting() &~E_NOTICE;
/**
* security settings
*/
//$this->enableSecurity('Security_Policy');
}
public static function getInstance(){
if (!isset(self::$instance))
{
self::$instance = new backend_config_smarty();
}
return self::$instance;
}
} |
If I replace the smarty version 3.0.9 it works?
So what are the changes to be made for this to work?
Best regards |
|
Back to top |
|
gtraxx Smarty Regular
Joined: 08 Jan 2008 Posts: 56
|
Posted: Thu Sep 22, 2011 9:19 am Post subject: |
|
|
I just understand that setDeprecationNotices function does not work in this version
If I remove :
Code: | $ this-> setDeprecationNotices (false); |
The error no longer appears in part
To correct the error after I edit:
Code: | $this->template_dir = array(self::$server_root."/view/"); |
We must use a table in template_dir
A bug in deprecation_notices ? see other configurations
Best regards |
|
Back to top |
|
tpneumat Smarty Rookie
Joined: 10 Dec 2009 Posts: 5
|
Posted: Wed Dec 21, 2011 9:42 pm Post subject: |
|
|
Same issue here. $ this-> setDeprecationNotices (false); throws error. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Dec 22, 2011 4:58 pm Post subject: |
|
|
This property has been removed from Smarty3 a while ago.
All deprecated functions are available by using the SmartyBC class. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|