配置加载失败SMARTY

时间:2013-04-07 22:16:46

标签: smarty smarty3

在我的PHP文件中使用

$smarty->config_load('en.conf');

我得到以下内容:

Notice: function call 'config_load' is unknown or deprecated. in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ex\libs\sysplugins\smarty_internal_wrapper.php on line 57

然后我将语句更改为@$smarty->config_load('en.conf');,错误被隐藏。

但是我的所有ajax脚本在此时都失败了并且在使用firebug的ajax响应中,我这次可以看到一个致命的错误:

<b>Fatal error</b>:  Uncaught exception 'SmartyException' with message 'Unable to load config file &quot;en.conf&quot;' in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ex\libs\sysplugins\smarty_internal_config.php:90
Stack trace:
#0 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ex\libs\sysplugins\smarty_internal_config.php(39): Smarty_Internal_Config-&gt;buildConfigFilepath()
#1 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ex\libs\sysplugins\smarty_internal_config.php(117): Smarty_Internal_Config-&gt;getConfigFilepath()
#2 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ex\libs\sysplugins\smarty_internal_config.php(108): Smarty_Internal_Config-&gt;readConfigSource(Object(Smarty_Internal_Config))
#3 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ex\libs\sysplugins\smarty_internal_config_file_compiler.php(44): Smarty_Internal_Config-&gt;getConfigSource()
#4 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ex\libs\sysplugins\smarty_in in <b>C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ex\libs\sysplugins\smarty_internal_config.php</b> on line <b>90</b><br />

我知道为什么我会收到第一个警告(例如,如果语法已经改变)以及为什么我会收到致命错误?

(Smarty版本3.0.8)

由于

1 个答案:

答案 0 :(得分:0)

configLoad是一个单词所以$smarty->configLoad('en.conf');似乎正在解决第一个错误,似乎该函数已在版本3中重命名