mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
changed $smarty->_syntax_error to $smarty->trigger_error
This commit is contained in:
@@ -36,14 +36,14 @@ function smarty_function_config_load($params, &$smarty)
|
|||||||
$_global = isset($params['global']) ? $smarty->_dequote($params['global']) : false;
|
$_global = isset($params['global']) ? $smarty->_dequote($params['global']) : false;
|
||||||
|
|
||||||
if (!isset($_file) || strlen($_file) == 0) {
|
if (!isset($_file) || strlen($_file) == 0) {
|
||||||
$smarty->_syntax_error("missing 'file' attribute in config_load tag", E_USER_ERROR, __FILE__, __LINE__);
|
$smarty->trigger_error("missing 'file' attribute in config_load tag", E_USER_ERROR, __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_scope)) {
|
if (isset($_scope)) {
|
||||||
if ($_scope != 'local' &&
|
if ($_scope != 'local' &&
|
||||||
$_scope != 'parent' &&
|
$_scope != 'parent' &&
|
||||||
$_scope != 'global') {
|
$_scope != 'global') {
|
||||||
$smarty->_syntax_error("invalid 'scope' attribute value", E_USER_ERROR, __FILE__, __LINE__);
|
$smarty->trigger_error("invalid 'scope' attribute value", E_USER_ERROR, __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($_global) {
|
if ($_global) {
|
||||||
@@ -51,10 +51,10 @@ function smarty_function_config_load($params, &$smarty)
|
|||||||
} else {
|
} else {
|
||||||
$_scope = 'local';
|
$_scope = 'local';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(@is_dir($smarty->config_dir)) {
|
if(@is_dir($smarty->config_dir)) {
|
||||||
$_config_dir = $smarty->config_dir;
|
$_config_dir = $smarty->config_dir;
|
||||||
} else {
|
} else {
|
||||||
// config_dir not found, try include_path
|
// config_dir not found, try include_path
|
||||||
$_params = array('file_path' => $smarty->config_dir);
|
$_params = array('file_path' => $smarty->config_dir);
|
||||||
@@ -64,11 +64,11 @@ function smarty_function_config_load($params, &$smarty)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$_file_path = $_config_dir . DIRECTORY_SEPARATOR . $_file;
|
$_file_path = $_config_dir . DIRECTORY_SEPARATOR . $_file;
|
||||||
if (isset($_section))
|
if (isset($_section))
|
||||||
$_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section);
|
$_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section);
|
||||||
else
|
else
|
||||||
$_compile_file = $smarty->_get_compile_path($_file_path);
|
$_compile_file = $smarty->_get_compile_path($_file_path);
|
||||||
|
|
||||||
if($smarty->force_compile
|
if($smarty->force_compile
|
||||||
|| !file_exists($_compile_file)
|
|| !file_exists($_compile_file)
|
||||||
|| ($smarty->compile_check
|
|| ($smarty->compile_check
|
||||||
@@ -103,7 +103,7 @@ function smarty_function_config_load($params, &$smarty)
|
|||||||
|
|
||||||
$smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars);
|
$smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars);
|
||||||
$smarty->_config[0]['files'][$_file] = true;
|
$smarty->_config[0]['files'][$_file] = true;
|
||||||
|
|
||||||
if ($_scope == 'parent') {
|
if ($_scope == 'parent') {
|
||||||
$smarty->_config[1]['vars'] = @array_merge($smarty->_config[1]['vars'], $_config_vars);
|
$smarty->_config[1]['vars'] = @array_merge($smarty->_config[1]['vars'], $_config_vars);
|
||||||
$smarty->_config[1]['files'][$_file] = true;
|
$smarty->_config[1]['files'][$_file] = true;
|
||||||
@@ -113,7 +113,7 @@ function smarty_function_config_load($params, &$smarty)
|
|||||||
$smarty->_config[$i]['files'][$_file] = true;
|
$smarty->_config[$i]['files'][$_file] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($smarty->debugging) {
|
if ($smarty->debugging) {
|
||||||
$_params = array();
|
$_params = array();
|
||||||
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
|
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
|
||||||
@@ -122,7 +122,7 @@ function smarty_function_config_load($params, &$smarty)
|
|||||||
'depth' => $smarty->_inclusion_depth,
|
'depth' => $smarty->_inclusion_depth,
|
||||||
'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
|
'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vim: set expandtab: */
|
/* vim: set expandtab: */
|
||||||
|
Reference in New Issue
Block a user