Moved /libs/core to /libs/internals and created new constant, SMARTY_CORE_DIR which defaults to SMARTY_DIR/internals. This should help CVS and rsynch users butupgrades will require changes and this may affect 3rd party plugins that use the /core dir.

This commit is contained in:
boots
2004-09-16 23:07:32 +00:00
parent dbcfb3dfbf
commit a0d021ef60
29 changed files with 57 additions and 52 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- moved /libs/core to /libs/internals (boots)
- fixed more parsing problems (messju) - fixed more parsing problems (messju)
Version 2.6.5 (Sept 13, 2004) Version 2.6.5 (Sept 13, 2004)

View File

@@ -49,6 +49,10 @@ if (!defined('SMARTY_DIR')) {
define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR); define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
} }
if (!defined('SMARTY_CORE_DIR')) {
define('SMARTY_CORE_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR . 'internals' . DIRECTORY_SEPARATOR);
}
define('SMARTY_PHP_PASSTHRU', 0); define('SMARTY_PHP_PASSTHRU', 0);
define('SMARTY_PHP_QUOTE', 1); define('SMARTY_PHP_QUOTE', 1);
define('SMARTY_PHP_REMOVE', 2); define('SMARTY_PHP_REMOVE', 2);
@@ -910,7 +914,7 @@ class Smarty
switch ($type) { switch ($type) {
case 'output': case 'output':
$_params = array('plugins' => array(array($type . 'filter', $name, null, null, false))); $_params = array('plugins' => array(array($type . 'filter', $name, null, null, false)));
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php'); require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins($_params, $this); smarty_core_load_plugins($_params, $this);
break; break;
@@ -950,7 +954,7 @@ class Smarty
'auto_source' => $tpl_file, 'auto_source' => $tpl_file,
'auto_id' => $_auto_id, 'auto_id' => $_auto_id,
'exp_time' => $exp_time); 'exp_time' => $exp_time);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.rm_auto.php'); require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
return smarty_core_rm_auto($_params, $this); return smarty_core_rm_auto($_params, $this);
} }
@@ -990,7 +994,7 @@ class Smarty
'cache_id' => $cache_id, 'cache_id' => $cache_id,
'compile_id' => $compile_id 'compile_id' => $compile_id
); );
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.read_cache_file.php'); require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
return smarty_core_read_cache_file($_params, $this); return smarty_core_read_cache_file($_params, $this);
} }
@@ -1024,7 +1028,7 @@ class Smarty
'auto_id' => $compile_id, 'auto_id' => $compile_id,
'exp_time' => $exp_time, 'exp_time' => $exp_time,
'extensions' => array('.inc', '.php')); 'extensions' => array('.inc', '.php'));
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.rm_auto.php'); require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
return smarty_core_rm_auto($_params, $this); return smarty_core_rm_auto($_params, $this);
} }
@@ -1136,7 +1140,7 @@ class Smarty
if ($this->debugging) { if ($this->debugging) {
// capture time for debugging info // capture time for debugging info
$_params = array(); $_params = array();
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php'); require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$_debug_start_time = smarty_core_get_microtime($_params, $this); $_debug_start_time = smarty_core_get_microtime($_params, $this);
$this->_smarty_debug_info[] = array('type' => 'template', $this->_smarty_debug_info[] = array('type' => 'template',
'filename' => $resource_name, 'filename' => $resource_name,
@@ -1161,20 +1165,20 @@ class Smarty
'compile_id' => $compile_id, 'compile_id' => $compile_id,
'results' => null 'results' => null
); );
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.read_cache_file.php'); require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
if (smarty_core_read_cache_file($_params, $this)) { if (smarty_core_read_cache_file($_params, $this)) {
$_smarty_results = $_params['results']; $_smarty_results = $_params['results'];
if (@count($this->_cache_info['insert_tags'])) { if (@count($this->_cache_info['insert_tags'])) {
$_params = array('plugins' => $this->_cache_info['insert_tags']); $_params = array('plugins' => $this->_cache_info['insert_tags']);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php'); require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins($_params, $this); smarty_core_load_plugins($_params, $this);
$_params = array('results' => $_smarty_results); $_params = array('results' => $_smarty_results);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.process_cached_inserts.php'); require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
$_smarty_results = smarty_core_process_cached_inserts($_params, $this); $_smarty_results = smarty_core_process_cached_inserts($_params, $this);
} }
if (@count($this->_cache_info['cache_serials'])) { if (@count($this->_cache_info['cache_serials'])) {
$_params = array('results' => $_smarty_results); $_params = array('results' => $_smarty_results);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.process_compiled_include.php'); require_once(SMARTY_CORE_DIR . 'core.process_compiled_include.php');
$_smarty_results = smarty_core_process_compiled_include($_params, $this); $_smarty_results = smarty_core_process_compiled_include($_params, $this);
} }
@@ -1184,9 +1188,9 @@ class Smarty
{ {
// capture time for debugging info // capture time for debugging info
$_params = array(); $_params = array();
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php'); require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time; $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time;
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.display_debug_console.php'); require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
$_smarty_results .= smarty_core_display_debug_console($_params, $this); $_smarty_results .= smarty_core_display_debug_console($_params, $this);
} }
if ($this->cache_modified_check) { if ($this->cache_modified_check) {
@@ -1267,9 +1271,9 @@ class Smarty
'cache_id' => $cache_id, 'cache_id' => $cache_id,
'compile_id' => $compile_id, 'compile_id' => $compile_id,
'results' => $_smarty_results); 'results' => $_smarty_results);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_cache_file.php'); require_once(SMARTY_CORE_DIR . 'core.write_cache_file.php');
smarty_core_write_cache_file($_params, $this); smarty_core_write_cache_file($_params, $this);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.process_cached_inserts.php'); require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
$_smarty_results = smarty_core_process_cached_inserts($_params, $this); $_smarty_results = smarty_core_process_cached_inserts($_params, $this);
if ($this->_cache_serials) { if ($this->_cache_serials) {
@@ -1288,9 +1292,9 @@ class Smarty
if ($this->debugging) { if ($this->debugging) {
// capture time for debugging info // capture time for debugging info
$_params = array(); $_params = array();
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php'); require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time); $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.display_debug_console.php'); require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
echo smarty_core_display_debug_console($_params, $this); echo smarty_core_display_debug_console($_params, $this);
} }
error_reporting($_smarty_old_error_level); error_reporting($_smarty_old_error_level);
@@ -1356,7 +1360,7 @@ class Smarty
function _get_plugin_filepath($type, $name) function _get_plugin_filepath($type, $name)
{ {
$_params = array('type' => $type, 'name' => $name); $_params = array('type' => $type, 'name' => $name);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.assemble_plugin_filepath.php'); require_once(SMARTY_CORE_DIR . 'core.assemble_plugin_filepath.php');
return smarty_core_assemble_plugin_filepath($_params, $this); return smarty_core_assemble_plugin_filepath($_params, $this);
} }
@@ -1414,12 +1418,12 @@ class Smarty
if ($this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) { if ($this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) {
// if a _cache_serial was set, we also have to write an include-file: // if a _cache_serial was set, we also have to write an include-file:
if ($this->_cache_include_info) { if ($this->_cache_include_info) {
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_include.php'); require_once(SMARTY_CORE_DIR . 'core.write_compiled_include.php');
smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content'=>$_compiled_content)), $this); smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content'=>$_compiled_content)), $this);
} }
$_params = array('compile_path'=>$compile_path, 'compiled_content' => $_compiled_content); $_params = array('compile_path'=>$compile_path, 'compiled_content' => $_compiled_content);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_resource.php'); require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php');
smarty_core_write_compiled_resource($_params, $this); smarty_core_write_compiled_resource($_params, $this);
return true; return true;
@@ -1579,7 +1583,7 @@ class Smarty
$this->trigger_error('unable to read resource: "' . $params['resource_name'] . '"'); $this->trigger_error('unable to read resource: "' . $params['resource_name'] . '"');
} }
} else if ($_return && $this->security) { } else if ($_return && $this->security) {
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.is_secure.php'); require_once(SMARTY_CORE_DIR . 'core.is_secure.php');
if (!smarty_core_is_secure($_params, $this)) { if (!smarty_core_is_secure($_params, $this)) {
if (!$params['quiet']) if (!$params['quiet'])
$this->trigger_error('(secure mode) accessing "' . $params['resource_name'] . '" is not allowed'); $this->trigger_error('(secure mode) accessing "' . $params['resource_name'] . '" is not allowed');
@@ -1635,7 +1639,7 @@ class Smarty
} }
// didn't find the file, try include_path // didn't find the file, try include_path
$_params = array('file_path' => $_fullpath); $_params = array('file_path' => $_fullpath);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_include_path.php'); require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
if(smarty_core_get_include_path($_params, $this)) { if(smarty_core_get_include_path($_params, $this)) {
$params['resource_name'] = $_params['new_file_path']; $params['resource_name'] = $_params['new_file_path'];
return true; return true;
@@ -1648,7 +1652,7 @@ class Smarty
} }
} elseif (empty($this->_plugins['resource'][$params['resource_type']])) { } elseif (empty($this->_plugins['resource'][$params['resource_type']])) {
$_params = array('type' => $params['resource_type']); $_params = array('type' => $params['resource_type']);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_resource_plugin.php'); require_once(SMARTY_CORE_DIR . 'core.load_resource_plugin.php');
smarty_core_load_resource_plugin($_params, $this); smarty_core_load_resource_plugin($_params, $this);
} }
@@ -1836,7 +1840,7 @@ class Smarty
{ {
if ($this->debugging) { if ($this->debugging) {
$_params = array(); $_params = array();
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php'); require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$debug_start_time = smarty_core_get_microtime($_params, $this); $debug_start_time = smarty_core_get_microtime($_params, $this);
$this->_smarty_debug_info[] = array('type' => 'template', $this->_smarty_debug_info[] = array('type' => 'template',
'filename' => $params['smarty_include_tpl_file'], 'filename' => $params['smarty_include_tpl_file'],
@@ -1867,7 +1871,7 @@ class Smarty
if ($this->debugging) { if ($this->debugging) {
// capture time for debugging info // capture time for debugging info
$_params = array(); $_params = array();
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php'); require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$this->_smarty_debug_info[$included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $debug_start_time; $this->_smarty_debug_info[$included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $debug_start_time;
} }

View File

@@ -380,14 +380,14 @@ class Smarty_Compiler extends Smarty {
} }
} }
$_plugins_params .= '))'; $_plugins_params .= '))';
$plugins_code = "<?php require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');\nsmarty_core_load_plugins($_plugins_params, \$this); ?>\n"; $plugins_code = "<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');\nsmarty_core_load_plugins($_plugins_params, \$this); ?>\n";
$template_header .= $plugins_code; $template_header .= $plugins_code;
$this->_plugin_info = array(); $this->_plugin_info = array();
$this->_plugins_code = $plugins_code; $this->_plugins_code = $plugins_code;
} }
if ($this->_init_smarty_vars) { if ($this->_init_smarty_vars) {
$template_header .= "<?php require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.assign_smarty_interface.php');\nsmarty_core_assign_smarty_interface(null, \$this); ?>\n"; $template_header .= "<?php require_once(SMARTY_CORE_DIR . 'core.assign_smarty_interface.php');\nsmarty_core_assign_smarty_interface(null, \$this); ?>\n";
$this->_init_smarty_vars = false; $this->_init_smarty_vars = false;
} }
@@ -924,7 +924,7 @@ class Smarty_Compiler extends Smarty {
$_params = "array('args' => array(".implode(', ', (array)$arg_list)."))"; $_params = "array('args' => array(".implode(', ', (array)$arg_list)."))";
return "<?php require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.run_insert_handler.php');\necho smarty_core_run_insert_handler($_params, \$this); ?>" . $this->_additional_newline; return "<?php require_once(SMARTY_CORE_DIR . 'core.run_insert_handler.php');\necho smarty_core_run_insert_handler($_params, \$this); ?>" . $this->_additional_newline;
} }
/** /**
@@ -1008,7 +1008,7 @@ class Smarty_Compiler extends Smarty {
$_params = "array('smarty_file' => " . $attrs['file'] . ", 'smarty_assign' => '$assign_var', 'smarty_once' => $once_var, 'smarty_include_vars' => array(".implode(',', $arg_list)."))"; $_params = "array('smarty_file' => " . $attrs['file'] . ", 'smarty_assign' => '$assign_var', 'smarty_once' => $once_var, 'smarty_include_vars' => array(".implode(',', $arg_list)."))";
return "<?php require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.smarty_include_php.php');\nsmarty_core_smarty_include_php($_params, \$this); ?>" . $this->_additional_newline; return "<?php require_once(SMARTY_CORE_DIR . 'core.smarty_include_php.php');\nsmarty_core_smarty_include_php($_params, \$this); ?>" . $this->_additional_newline;
} }
@@ -2105,7 +2105,7 @@ class Smarty_Compiler extends Smarty {
if ($prefilter === false) { if ($prefilter === false) {
unset($this->_plugins['prefilter'][$filter_name]); unset($this->_plugins['prefilter'][$filter_name]);
$_params = array('plugins' => array(array('prefilter', $filter_name, null, null, false))); $_params = array('plugins' => array(array('prefilter', $filter_name, null, null, false)));
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php'); require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins($_params, $this); smarty_core_load_plugins($_params, $this);
} }
} }
@@ -2115,7 +2115,7 @@ class Smarty_Compiler extends Smarty {
if ($postfilter === false) { if ($postfilter === false) {
unset($this->_plugins['postfilter'][$filter_name]); unset($this->_plugins['postfilter'][$filter_name]);
$_params = array('plugins' => array(array('postfilter', $filter_name, null, null, false))); $_params = array('plugins' => array(array('postfilter', $filter_name, null, null, false)));
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php'); require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins($_params, $this); smarty_core_load_plugins($_params, $this);
} }
} }

View File

@@ -50,7 +50,7 @@ function smarty_core_assemble_plugin_filepath($params, &$smarty)
$_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename; $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
$_params = array('file_path' => $_plugin_filepath); $_params = array('file_path' => $_plugin_filepath);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_include_path.php'); require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
if(smarty_core_get_include_path($_params, $smarty)) { if(smarty_core_get_include_path($_params, $smarty)) {
$_return = $_params['new_file_path']; $_return = $_params['new_file_path'];
break; break;

View File

@@ -32,7 +32,7 @@ function smarty_core_get_php_resource(&$params, &$smarty)
} else { } else {
// test for file in include_path // test for file in include_path
$_params = array('file_path' => $params['resource_name']); $_params = array('file_path' => $params['resource_name']);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_include_path.php'); require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
if(smarty_core_get_include_path($_params, $smarty)) { if(smarty_core_get_include_path($_params, $smarty)) {
$_include_path = $_params['new_file_path']; $_include_path = $_params['new_file_path'];
$_readable = true; $_readable = true;
@@ -56,7 +56,7 @@ function smarty_core_get_php_resource(&$params, &$smarty)
if ($_readable) { if ($_readable) {
if ($smarty->security) { if ($smarty->security) {
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.is_trusted.php'); require_once(SMARTY_CORE_DIR . 'core.is_trusted.php');
if (!smarty_core_is_trusted($params, $smarty)) { if (!smarty_core_is_trusted($params, $smarty)) {
$smarty->$_error_funcc('(secure mode) ' . $params['resource_type'] . ':' . $params['resource_name'] . ' is not trusted'); $smarty->$_error_funcc('(secure mode) ' . $params['resource_type'] . ':' . $params['resource_name'] . ' is not trusted');
return false; return false;

View File

@@ -20,7 +20,7 @@ function smarty_core_process_cached_inserts($params, &$smarty)
for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) { for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) {
if ($smarty->debugging) { if ($smarty->debugging) {
$_params = array(); $_params = array();
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php'); require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$debug_start_time = smarty_core_get_microtime($_params, $smarty); $debug_start_time = smarty_core_get_microtime($_params, $smarty);
} }
@@ -29,7 +29,7 @@ function smarty_core_process_cached_inserts($params, &$smarty)
if (isset($args['script'])) { if (isset($args['script'])) {
$_params = array('resource_name' => $smarty->_dequote($args['script'])); $_params = array('resource_name' => $smarty->_dequote($args['script']));
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_php_resource.php'); require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
if(!smarty_core_get_php_resource($_params, $smarty)) { if(!smarty_core_get_php_resource($_params, $smarty)) {
return false; return false;
} }
@@ -55,7 +55,7 @@ function smarty_core_process_cached_inserts($params, &$smarty)
$params['results'] = str_replace($cached_inserts[$i], $replace, $params['results']); $params['results'] = str_replace($cached_inserts[$i], $replace, $params['results']);
if ($smarty->debugging) { if ($smarty->debugging) {
$_params = array(); $_params = array();
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php'); require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$smarty->_smarty_debug_info[] = array('type' => 'insert', $smarty->_smarty_debug_info[] = array('type' => 'insert',
'filename' => 'insert_'.$name, 'filename' => 'insert_'.$name,
'depth' => $smarty->_inclusion_depth, 'depth' => $smarty->_inclusion_depth,

View File

@@ -28,7 +28,7 @@ function smarty_core_rm_auto($params, &$smarty)
'level' => 0, 'level' => 0,
'exp_time' => $params['exp_time'] 'exp_time' => $params['exp_time']
); );
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.rmdir.php'); require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
$_res = smarty_core_rmdir($_params, $smarty); $_res = smarty_core_rmdir($_params, $smarty);
} else { } else {
$_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']); $_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']);
@@ -47,7 +47,7 @@ function smarty_core_rm_auto($params, &$smarty)
'level' => 1, 'level' => 1,
'exp_time' => $params['exp_time'] 'exp_time' => $params['exp_time']
); );
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.rmdir.php'); require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
$_res = smarty_core_rmdir($_params, $smarty); $_res = smarty_core_rmdir($_params, $smarty);
} else { } else {
// remove matching file names // remove matching file names

View File

@@ -32,7 +32,7 @@ function smarty_core_rmdir($params, &$smarty)
'level' => $params['level'] + 1, 'level' => $params['level'] + 1,
'exp_time' => $params['exp_time'] 'exp_time' => $params['exp_time']
); );
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.rmdir.php'); require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
smarty_core_rmdir($_params, $smarty); smarty_core_rmdir($_params, $smarty);
} }
else { else {

View File

@@ -14,7 +14,7 @@
function smarty_core_run_insert_handler($params, &$smarty) function smarty_core_run_insert_handler($params, &$smarty)
{ {
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php'); require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
if ($smarty->debugging) { if ($smarty->debugging) {
$_params = array(); $_params = array();
$_debug_start_time = smarty_core_get_microtime($_params, $smarty); $_debug_start_time = smarty_core_get_microtime($_params, $smarty);
@@ -34,7 +34,7 @@ function smarty_core_run_insert_handler($params, &$smarty)
} else { } else {
if (isset($params['args']['script'])) { if (isset($params['args']['script'])) {
$_params = array('resource_name' => $smarty->_dequote($params['args']['script'])); $_params = array('resource_name' => $smarty->_dequote($params['args']['script']));
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_php_resource.php'); require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
if(!smarty_core_get_php_resource($_params, $smarty)) { if(!smarty_core_get_php_resource($_params, $smarty)) {
return false; return false;
} }
@@ -51,7 +51,7 @@ function smarty_core_run_insert_handler($params, &$smarty)
$_content = $_funcname($params['args'], $smarty); $_content = $_funcname($params['args'], $smarty);
if ($smarty->debugging) { if ($smarty->debugging) {
$_params = array(); $_params = array();
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php'); require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$smarty->_smarty_debug_info[] = array('type' => 'insert', $smarty->_smarty_debug_info[] = array('type' => 'insert',
'filename' => 'insert_'.$params['args']['name'], 'filename' => 'insert_'.$params['args']['name'],
'depth' => $smarty->_inclusion_depth, 'depth' => $smarty->_inclusion_depth,

View File

@@ -21,7 +21,7 @@
function smarty_core_smarty_include_php($params, &$smarty) function smarty_core_smarty_include_php($params, &$smarty)
{ {
$_params = array('resource_name' => $params['smarty_file']); $_params = array('resource_name' => $params['smarty_file']);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_php_resource.php'); require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php');
smarty_core_get_php_resource($_params, $smarty); smarty_core_get_php_resource($_params, $smarty);
$_smarty_resource_type = $_params['resource_type']; $_smarty_resource_type = $_params['resource_type'];
$_smarty_php_resource = $_params['php_resource']; $_smarty_php_resource = $_params['php_resource'];

View File

@@ -62,7 +62,7 @@ function smarty_core_write_cache_file($params, &$smarty)
$_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']); $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']);
$_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id); $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id);
$_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true); $_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_file.php'); require_once(SMARTY_CORE_DIR . 'core.write_file.php');
smarty_core_write_file($_params, $smarty); smarty_core_write_file($_params, $smarty);
return true; return true;
} }

View File

@@ -69,7 +69,7 @@ $source
$_params = array('filename' => $_compile_path, $_params = array('filename' => $_compile_path,
'contents' => $_include_compiled, 'create_dirs' => true); 'contents' => $_include_compiled, 'create_dirs' => true);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_file.php'); require_once(SMARTY_CORE_DIR . 'core.write_file.php');
smarty_core_write_file($_params, $smarty); smarty_core_write_file($_params, $smarty);
return true; return true;
} }

View File

@@ -25,7 +25,7 @@ function smarty_core_write_compiled_resource($params, &$smarty)
} }
$_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true); $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_file.php'); require_once(SMARTY_CORE_DIR . 'core.write_file.php');
smarty_core_write_file($_params, $smarty); smarty_core_write_file($_params, $smarty);
return true; return true;
} }

View File

@@ -19,7 +19,7 @@ function smarty_core_write_file($params, &$smarty)
if ($params['create_dirs']) { if ($params['create_dirs']) {
$_params = array('dir' => $_dirname); $_params = array('dir' => $_dirname);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.create_dir_structure.php'); require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php');
smarty_core_create_dir_structure($_params, $smarty); smarty_core_create_dir_structure($_params, $smarty);
} }

View File

@@ -26,7 +26,7 @@ function smarty_function_config_load($params, &$smarty)
{ {
if ($smarty->debugging) { if ($smarty->debugging) {
$_params = array(); $_params = array();
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php'); require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$_debug_start_time = smarty_core_get_microtime($_params, $smarty); $_debug_start_time = smarty_core_get_microtime($_params, $smarty);
} }
@@ -101,7 +101,7 @@ function smarty_function_config_load($params, &$smarty)
$_output = '<?php $_config_vars = unserialize(\'' . strtr(serialize($_config_vars),array('\''=>'\\\'', '\\'=>'\\\\')) . '\'); ?>'; $_output = '<?php $_config_vars = unserialize(\'' . strtr(serialize($_config_vars),array('\''=>'\\\'', '\\'=>'\\\\')) . '\'); ?>';
} }
$_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => $_params['resource_timestamp'])); $_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => $_params['resource_timestamp']));
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_resource.php'); require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php');
smarty_core_write_compiled_resource($_params, $smarty); smarty_core_write_compiled_resource($_params, $smarty);
} else { } else {
include($_compile_file); include($_compile_file);
@@ -126,7 +126,7 @@ function smarty_function_config_load($params, &$smarty)
if ($smarty->debugging) { if ($smarty->debugging) {
$_params = array(); $_params = array();
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php'); require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
$smarty->_smarty_debug_info[] = array('type' => 'config', $smarty->_smarty_debug_info[] = array('type' => 'config',
'filename' => $_file.' ['.$_section.'] '.$_scope, 'filename' => $_file.' ['.$_section.'] '.$_scope,
'depth' => $smarty->_inclusion_depth, 'depth' => $smarty->_inclusion_depth,

View File

@@ -26,7 +26,7 @@ function smarty_function_debug($params, &$smarty)
if (isset($params['output'])) { if (isset($params['output'])) {
$smarty->assign('_smarty_debug_output', $params['output']); $smarty->assign('_smarty_debug_output', $params['output']);
} }
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.display_debug_console.php'); require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
return smarty_core_display_debug_console(null, $smarty); return smarty_core_display_debug_console(null, $smarty);
} }

View File

@@ -29,7 +29,7 @@ function smarty_function_fetch($params, &$smarty)
$content = ''; $content = '';
if ($smarty->security && !preg_match('!^(http|ftp)://!i', $params['file'])) { if ($smarty->security && !preg_match('!^(http|ftp)://!i', $params['file'])) {
$_params = array('resource_type' => 'file', 'resource_name' => $params['file']); $_params = array('resource_type' => 'file', 'resource_name' => $params['file']);
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.is_secure.php'); require_once(SMARTY_CORE_DIR . 'core.is_secure.php');
if(!smarty_core_is_secure($_params, $smarty)) { if(!smarty_core_is_secure($_params, $smarty)) {
$smarty->_trigger_fatal_error('[plugin] (secure mode) fetch \'' . $params['file'] . '\' is not allowed'); $smarty->_trigger_fatal_error('[plugin] (secure mode) fetch \'' . $params['file'] . '\' is not allowed');
return; return;

View File

@@ -97,7 +97,7 @@ function smarty_function_html_image($params, &$smarty)
if(!isset($params['width']) || !isset($params['height'])) { if(!isset($params['width']) || !isset($params['height'])) {
if ($smarty->security && if ($smarty->security &&
($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) && ($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) &&
(require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.is_secure.php')) && (require_once(SMARTY_CORE_DIR . 'core.is_secure.php')) &&
(!smarty_core_is_secure($_params, $smarty)) ) { (!smarty_core_is_secure($_params, $smarty)) ) {
$smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE); $smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE);