2013-04-07 94 views
0

在我的PHP文件中使用配置加載失敗SMARTY

$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腳本在這一點上,並在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)

感謝

回答

0

configLoad是一個詞所以$smarty->configLoad('en.conf');似乎要解決的第一個錯誤,似乎該功能已在第3版

+0

被更名關於第二個問題(ajax腳本不加載)似乎我必須明確地設置配置目錄,這也解決了'$ smarty-> setConfigDir('../ configs');' – Athanatos 2013-04-07 22:40:28