View previous topic :: View next topic |
Author |
Message |
diwu Smarty Rookie
Joined: 21 Sep 2005 Posts: 5 Location: Brandenburg, Germany
|
Posted: Sun Jun 22, 2014 12:11 pm Post subject: template property 'plugins_dir' does not exist |
|
|
I am trying to update to php 5.5.11 and in this process also update to the latest Smarty 3.18.
However, when I try to load the page I get the error:
Code: |
Fatal error: Uncaught --> Smarty: template property 'plugins_dir' does not exist. <-- thrown in /Applications/XAMPP/xamppfiles/htdocs/openkims/include/ext_libs/Smarty/libs/sysplugins/smarty_internal_template.php on line 694
|
I have changed the constructor according to the read.me:
Code: |
class Smarty_OpenKIMS extends Smarty {
function __construct()
{
parent::__construct();
// these seem to work fine:
// (...at least there haven't been any error messages yet...)
// _TEMP_ , _HOME_PATH_ , _SMARTY_DIR_ and _INCLUDE_PATH_ have been defined as constants of the absolute path earlier.
$this->setTemplateDir('./');
$this->setCompileDir( _TEMP_ . 'smarty/templates_c/');
$this->setConfigDir(_HOME_PATH_ . "modules/PatientenOrdner/".$kategorie ."/");
$this->setCacheDir(_TEMP_ . 'smarty/cache/');
// this doesn't seem to have any affect:
$this->plugins_dir = array(_SMARTY_DIR_."plugins/", _INCLUDE_PATH_ );
$this->caching = Smarty::CACHING_LIFETIME_CURRENT;
$this->assign('app_name', 'MyAppName');
}
}
|
both plugins directories are world readable and accessible...
just to check the valid path:
Code: |
echo "<pre>";
print_r($this->plugins_dir);
echo "</pre>";
|
returns the correct setting:
Code: |
Array
(
[0] => /Applications/XAMPP/xamppfiles/htdocs/openkims/include/ext_libs/Smarty/libs/plugins/
[1] => /Applications/XAMPP/xamppfiles/htdocs/openkims/include/
)
|
I don't know what else to do, or maybe I am just blind...
Thanks a lot for any help! |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sun Jun 22, 2014 8:46 pm Post subject: |
|
|
$this->setPluginsDir()
My full well wrapper code, currently running 3.1.12:
Code: | <?php
/*
$Id: tplSmarty.php 208 2013-08-08 11:43:34Z anrdaemon $
*/
@include_once('ToolsClass.php');
require_once('Smarty.class.php');
@include_once('Smarty-config.php');
class tplSmarty extends Smarty
{
// Override much of the default constructor. Because.
public function __construct($ldelim = NULL, $rdelim = NULL)
{
if(defined('toolPageGenerationStarted'))
{
$this->start_time = toolPageGenerationStarted;
}
else
{
$this->start_time = version_compare(phpversion(), '5.4.0', '<')
? microtime(true)
: $_SERVER['REQUEST_TIME_FLOAT'];
}
// Fix passed arguments
$compile_check = defined('TS_COMPILE_CHECK') ? TS_COMPILE_CHECK : self::COMPILECHECK_CACHEMISS;
$caching = defined('TS_CACHING') ? TS_CACHING : self::CACHING_LIFETIME_SAVED;
$cache_lifetime = defined('TS_CACHE_LIFETIME') ? TS_CACHE_LIFETIME : 21600;
// selfpointer needed by some other class methods
$this->smarty = $this;
if(is_callable('mb_internal_encoding'))
{
mb_internal_encoding(self::$_CHARSET);
}
// set default dirs
$this->setPluginsDir(SMARTY_PLUGINS_DIR)
->setTemplateDir(dirname($_SERVER['DOCUMENT_ROOT']) . '/inc/templates')
->setConfigDir(dirname($_SERVER['DOCUMENT_ROOT']) . '/inc/templates/configs')
->setCompileDir(dirname($_SERVER['DOCUMENT_ROOT']) . '/tmp/templates_c')
->setCacheDir(dirname($_SERVER['DOCUMENT_ROOT']) . '/tmp/smarty_cache');
$this->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl';
if(isset($_SERVER['SCRIPT_NAME']))
{
$this->assignGlobal('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']);
}
// Default options
$this->setCompileCheck($compile_check);
if($caching)
{
$this->setCaching($caching);
$this->cache_lifetime = $cache_lifetime;
}
if(isset($ldelim, $rdelim))
{
$this->left_delimiter = $ldelim;
$this->right_delimiter = $rdelim;
}
} // tplSmarty::__construct
} // class tplSmarty |
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Jun 23, 2014 5:11 pm Post subject: |
|
|
You should use setPluginsDir()
Code: | $this->setPluginsDir(rray(_SMARTY_DIR_."plugins/", _INCLUDE_PATH_ )); |
Does your class Smarty_OpenKIMS also overload the magic functions _-get() and __set() ?
Do you get a trace back of function call when the exception occurs? If yes please provide. |
|
Back to top |
|
diwu Smarty Rookie
Joined: 21 Sep 2005 Posts: 5 Location: Brandenburg, Germany
|
Posted: Tue Jun 24, 2014 6:24 pm Post subject: |
|
|
U.Tews wrote: | You should use setPluginsDir()
Code: | $this->setPluginsDir(array(_SMARTY_DIR_."plugins/", _INCLUDE_PATH_ )); |
Does your class Smarty_OpenKIMS also overload the magic functions _-get() and __set() ?
Do you get a trace back of function call when the exception occurs? If yes please provide. |
Now you got me...I am not really sure...
I haven't overload the _-get() and _-set()
...do I really need to?
Sorry to ask those maybe silly questions, I haven't been following the developments and advancements in the last several years...
I don't think there is a trace back of function...
the complete error message is as follows:
Code: |
Fatal error: Uncaught --> Smarty: template property 'plugins_dir' does not exist. <-- thrown in /Applications/XAMPP/xamppfiles/htdocs/openkims/include/ext_libs/Smarty/libs/sysplugins/smarty_internal_template.php on line 694
|
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Jun 24, 2014 7:40 pm Post subject: |
|
|
No __get() and __set() should not be overloaded. A direct access to plugins_dir is wrapped by this magic functions. I ask it because overloading would disable the wrapping.
For a test insert debug_print_backtrace (); before the exception in smarty_internal_template line 694.
The trace back information would be important for the analysis of the problem. |
|
Back to top |
|
diwu Smarty Rookie
Joined: 21 Sep 2005 Posts: 5 Location: Brandenburg, Germany
|
Posted: Tue Jun 24, 2014 8:44 pm Post subject: |
|
|
U.Tews wrote: | No __get() and __set() should not be overloaded. A direct access to plugins_dir is wrapped by this magic functions. I ask it because overloading would disable the wrapping.
For a test insert debug_print_backtrace (); before the exception in smarty_internal_template line 694.
The trace back information would be important for the analysis of the problem. |
Cool, I thought so, that I shouldn't overload the _-get and _-set functions.
Nothing happened, when I had inserted debug_print_backtrace (); before or after the exception in smarty_internal_template line 694.
But when I put it in the beginning of the setPluginsDir function I get the following, I am not really sure, though how this helps me...
Code: |
#0 Smarty->setPluginsDir(/Applications/XAMPP/xamppfiles/htdocs/openkims/include/ext_libs/Smarty/libs/plugins/) called at [/Applications/XAMPP/xamppfiles/htdocs/openkims/include/ext_libs/Smarty/libs/Smarty.class.php:631]
#1 Smarty->__construct() called at [/Applications/XAMPP/xamppfiles/htdocs/openkims/config.inc.php:180]
#2 Smarty_OpenKIMS->__construct() called at [/Applications/XAMPP/xamppfiles/htdocs/openkims/include/lib.inc.php:28]
#3 include_once(/Applications/XAMPP/xamppfiles/htdocs/openkims/include/lib.inc.php) called at [/Applications/XAMPP/xamppfiles/htdocs/openkims/index.php:3]
#0 Smarty->setPluginsDir(Array ([0] => /Applications/XAMPP/xamppfiles/htdocs/openkims/include/ext_libs/Smarty/libs/plugins/,[1] => /Applications/XAMPP/xamppfiles/htdocs/openkims/include/)) called at [/Applications/XAMPP/xamppfiles/htdocs/openkims/config.inc.php:216]
#1 Smarty_OpenKIMS->__construct() called at [/Applications/XAMPP/xamppfiles/htdocs/openkims/include/lib.inc.php:28]
#2 include_once(/Applications/XAMPP/xamppfiles/htdocs/openkims/include/lib.inc.php) called at [/Applications/XAMPP/xamppfiles/htdocs/openkims/index.php:3]
Fatal error: Uncaught --> Smarty: template property 'plugins_dir' does not exist. <-- thrown in /Applications/XAMPP/xamppfiles/htdocs/openkims/include/ext_libs/Smarty/libs/sysplugins/smarty_internal_template.php on line 694
|
|
|
Back to top |
|
AmandaPratt184 Smarty Rookie
Joined: 02 Jan 2015 Posts: 5
|
Posted: Mon Mar 09, 2015 11:17 am Post subject: |
|
|
Try putting in the original question as a support call to the admin/product owner. They might be able to help you. |
|
Back to top |
|
|