fix filepaths to core files to use DIRECTORY_SEPARATOR

This commit is contained in:
mohrt
2003-06-21 17:35:15 +00:00
parent e61e05e05b
commit 9526d1ed42
22 changed files with 60 additions and 59 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- added filepath caching (Monte)
- added optional assign-attribute to {capture}-tag (messju)
- added $cacheable-parameter to register_compiler_function() (messju)
- added $cacheable-parameter with default=true to register_function()

View File

@@ -964,7 +964,7 @@ reques * @var string
switch ($type) {
case 'output':
$_params = array('plugins' => array(array($type . 'filter', $name, null, null, false)));
require_once(SMARTY_DIR . 'core/core.load_plugins.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');
smarty_core_load_plugins($_params, $this);
break;
@@ -1004,7 +1004,7 @@ reques * @var string
'auto_source' => $tpl_file,
'auto_id' => $_auto_id,
'exp_time' => $exp_time);
require_once(SMARTY_DIR . 'core/core.rm_auto.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.rm_auto.php');
return smarty_core_rm_auto($_params, $this);
}
@@ -1027,7 +1027,7 @@ reques * @var string
'auto_source' => null,
'auto_id' => null,
'exp_time' => $exp_time);
require_once(SMARTY_DIR . 'core/core.rm_auto.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.rm_auto.php');
return smarty_core_rm_auto($_params, $this);
}
}
@@ -1054,7 +1054,7 @@ reques * @var string
'cache_id' => $cache_id,
'compile_id' => $compile_id
);
require_once(SMARTY_DIR . 'core/core.read_cache_file.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.read_cache_file.php');
return smarty_core_read_cache_file($_params, $this);
}
@@ -1087,7 +1087,7 @@ reques * @var string
'auto_source' => $tpl_file,
'auto_id' => $compile_id,
'exp_time' => $exp_time);
require_once(SMARTY_DIR . 'core/core.rm_auto.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.rm_auto.php');
return smarty_core_rm_auto($_params, $this);
}
@@ -1100,7 +1100,7 @@ reques * @var string
function template_exists($tpl_file)
{
$_params = array('resource_name' => $tpl_file);
require_once(SMARTY_DIR . 'core/core.fetch_resource_info.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.fetch_resource_info.php');
return smarty_core_fetch_resource_info($_params, $this);
}
@@ -1189,7 +1189,7 @@ reques * @var string
if ($this->debugging) {
// capture time for debugging info
$_params = array();
require_once(SMARTY_DIR . 'core/core.get_microtime.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
$_debug_start_time = smarty_core_get_microtime($_params, $this);
$this->_smarty_debug_info[] = array('type' => 'template',
'filename' => $resource_name,
@@ -1214,20 +1214,20 @@ reques * @var string
'compile_id' => $compile_id,
'results' => null
);
require_once(SMARTY_DIR . 'core/core.read_cache_file.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.read_cache_file.php');
if (smarty_core_read_cache_file($_params, $this)) {
$_smarty_results = $_params['results'];
if (@count($this->_cache_info['insert_tags'])) {
$_params = array('plugins' => $this->_cache_info['insert_tags']);
require_once(SMARTY_DIR . 'core/core.load_plugins.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');
smarty_core_load_plugins($_params, $this);
$_params = array('results' => $_smarty_results);
require_once(SMARTY_DIR . 'core/core.process_cached_inserts.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.process_cached_inserts.php');
$_smarty_results = smarty_core_process_cached_inserts($_params, $this);
}
if (@count($this->_cache_info['cache_serials'])) {
$_params = array('results' => $_smarty_results);
require_once(SMARTY_DIR . 'core/core.process_compiled_include.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.process_compiled_include.php');
$_smarty_results = smarty_core_process_compiled_include($_params, $this);
}
@@ -1237,9 +1237,9 @@ reques * @var string
{
// capture time for debugging info
$_params = array();
require_once(SMARTY_DIR . 'core/core.get_microtime.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
$this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time;
require_once(SMARTY_DIR . 'core/core.display_debug_console.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.display_debug_console.php');
$_smarty_results .= smarty_core_display_debug_console($_params, $this);
}
if ($this->cache_modified_check) {
@@ -1314,9 +1314,9 @@ reques * @var string
'cache_id' => $cache_id,
'compile_id' => $compile_id,
'results' => $_smarty_results);
require_once(SMARTY_DIR . 'core/core.write_cache_file.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_cache_file.php');
smarty_core_write_cache_file($_params, $this);
require_once(SMARTY_DIR . 'core/core.process_cached_inserts.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.process_cached_inserts.php');
$_smarty_results = smarty_core_process_cached_inserts($_params, $this);
if ($this->_cache_serials) {
@@ -1334,9 +1334,9 @@ reques * @var string
if ($this->debugging) {
// capture time for debugging info
$_params = array();
require_once(SMARTY_DIR . 'core/core.get_microtime.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
$this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time);
require_once(SMARTY_DIR . 'core/core.display_debug_console.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.display_debug_console.php');
echo smarty_core_display_debug_console($_params, $this);
}
error_reporting($_smarty_old_error_level);
@@ -1423,12 +1423,12 @@ reques * @var string
}
$_params = array('type' => $type, 'name' => $name);
require_once(SMARTY_DIR . 'core/core.assemble_plugin_filepath.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.assemble_plugin_filepath.php');
$_return = smarty_core_assemble_plugin_filepath($_params, $this);
if($_return !== false) {
$this->_cache_paths['plugins'][$_cache_paths_key] = $_return;
require_once(SMARTY_DIR . 'core/core.write_cache_paths_file.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_cache_paths_file.php');
smarty_core_write_cache_paths_file(null, $this);
return $_return;
}
@@ -1451,7 +1451,7 @@ reques * @var string
return true;
} else {
// get file source and timestamp
require_once(SMARTY_DIR . 'core/core.fetch_resource_info.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.fetch_resource_info.php');
$_params = array('resource_name' => $resource_name);
if (!smarty_core_fetch_resource_info($_params, $this)) {
return false;
@@ -1481,7 +1481,7 @@ reques * @var string
{
$_params = array('resource_name' => $resource_name);
require_once(SMARTY_DIR . 'core/core.fetch_resource_info.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.fetch_resource_info.php');
if (!smarty_core_fetch_resource_info($_params, $this)) {
return false;
}
@@ -1491,12 +1491,12 @@ reques * @var string
if ($this->_compile_source($resource_name, $_source_content, $_compiled_content)) {
$_params = array('compile_path'=>$compile_path, 'compiled_content' => $_compiled_content, 'resource_timestamp' => $_resource_timestamp);
require_once(SMARTY_DIR . 'core/core.write_compiled_resource.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_resource.php');
smarty_core_write_compiled_resource($_params, $this);
// if a _cache_serial was set, we also have to write an include-file:
if ($this->_cache_include_info) {
require_once(SMARTY_DIR . 'core/core.write_compiled_include.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_include.php');
smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content'=>$_compiled_content)), $this);
}
return true;
@@ -1693,12 +1693,12 @@ reques * @var string
}
$_params = array('auto_base' => $auto_base, 'auto_source' => $auto_source, 'auto_id' => $auto_id);
require_once(SMARTY_DIR . 'core/core.assemble_auto_filename.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.assemble_auto_filename.php');
$_return = smarty_core_assemble_auto_filename($_params, $this);
if($_return !== false) {
$this->_cache_paths['auto_file'][$_cache_paths_key] = $_return;
require_once(SMARTY_DIR . 'core/core.write_cache_paths_file.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_cache_paths_file.php');
smarty_core_write_cache_paths_file(null, $this);
return $_return;
}

View File

@@ -34,7 +34,7 @@ function smarty_core_assemble_auto_filename($params, &$this)
} else {
// auto_base not found, try include_path
$_params = array('file_path' => $params['auto_base']);
require_once(SMARTY_DIR . 'core/core.get_include_path.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_include_path.php');
smarty_core_get_include_path($_params, $this);
$_return = isset($_params['new_file_path']) ? $_params['new_file_path'] . DIRECTORY_SEPARATOR : null;
}

View File

@@ -43,7 +43,7 @@ function smarty_core_assemble_plugin_filepath($params, &$this)
$_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename;
$_params = array('file_path' => $_plugin_filepath);
require_once(SMARTY_DIR . 'core/core.get_include_path.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_include_path.php');
if(smarty_core_get_include_path($_params, $this)) {
return $_params['new_file_path'];
}

View File

@@ -27,7 +27,7 @@ function smarty_core_fetch_resource_info(&$params, &$this)
$_return = false;
$_params = array('resource_name' => $params['resource_name']) ;
require_once(SMARTY_DIR . 'core/core.parse_resource_name.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.parse_resource_name.php');
if (smarty_core_parse_resource_name($_params, $this)) {
$_resource_type = $_params['resource_type'];
$_resource_name = $_params['resource_name'];
@@ -72,7 +72,7 @@ function smarty_core_fetch_resource_info(&$params, &$this)
}
}
require_once(SMARTY_DIR . 'core/core.is_secure.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.is_secure.php');
if (!$_return) {
if (!$params['quiet']) {
$this->trigger_error('unable to read resource: "' . $params['resource_name'] . '"');

View File

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

View File

@@ -52,7 +52,7 @@ function smarty_core_parse_resource_name(&$params, &$this)
}
// didn't find the file, try include_path
$_params = array('resource_name' => $_fullpath);
require_once(SMARTY_DIR . 'core/core.get_include_path.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_include_path.php');
if(smarty_core_get_include_path($_params, $this)) {
$params['resource_name'] = $_params['new_resource_name'];
return true;
@@ -62,7 +62,7 @@ function smarty_core_parse_resource_name(&$params, &$this)
}
} else {
$_params = array('type' => $params['resource_type']);
require_once(SMARTY_DIR . 'core/core.load_resource_plugin.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_resource_plugin.php');
smarty_core_load_resource_plugin($_params, $this);
}

View File

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

View File

@@ -68,7 +68,7 @@ function smarty_core_read_cache_file(&$params, &$this)
}
if ($this->compile_check) {
require_once(SMARTY_DIR . 'core/core.fetch_resource_info.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.fetch_resource_info.php');
foreach (array_keys($this->_cache_info['template']) as $_template_dep) {
$_params = array('resource_name' => $_template_dep);
smarty_core_fetch_resource_info($_params, $this);
@@ -79,7 +79,7 @@ function smarty_core_read_cache_file(&$params, &$this)
}
if (isset($this->_cache_info['config'])) {
require_once(SMARTY_DIR . 'core/core.fetch_resource_info.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.fetch_resource_info.php');
foreach (array_keys($this->_cache_info['config']) as $_config_dep) {
$_params = array('resource_name' => $_config_dep);
smarty_core_fetch_resource_info($_params, $this);

View File

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

View File

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

View File

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

View File

@@ -18,7 +18,7 @@ function smarty_core_smarty_include($params, &$this)
{
if ($this->debugging) {
$_params = array();
require_once(SMARTY_DIR . 'core/core.get_microtime.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
$debug_start_time = smarty_core_get_microtime($_params, $this);
$this->_smarty_debug_info[] = array('type' => 'template',
'filename' => $params['smarty_include_tpl_file'],
@@ -49,7 +49,7 @@ function smarty_core_smarty_include($params, &$this)
if ($this->debugging) {
// capture time for debugging info
$_params = array();
require_once(SMARTY_DIR . 'core/core.get_microtime.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
$this->_smarty_debug_info[$included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $debug_start_time;
}

View File

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

View File

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

View File

@@ -26,7 +26,7 @@ function smarty_core_write_cache_paths_file($params, &$this)
$_compiled_content = function_exists('var_export') ? var_export($this->_cache_paths, true) : "unserialize('" . serialize($this->_cache_paths) . "')";
$_compiled_content = '<?php $this->_cache_paths = ' . $_compiled_content . '; ?>';
$_params = array('compile_path' => $this->_cache_paths_file, 'compiled_content' => $_compiled_content, 'resource_timestamp' => time());
require_once(SMARTY_DIR . 'core/core.write_compiled_resource.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_resource.php');
smarty_core_write_compiled_resource($_params, $this);
return $_return;
}

View File

@@ -50,7 +50,7 @@ $_match[4]
$_params = array('filename' => $_compile_path,
'contents' => $_include_compiled, 'create_dirs' => true);
require_once(SMARTY_DIR . 'core/core.write_file.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_file.php');
smarty_core_write_file($_params, $this);
return true;
}

View File

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

View File

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

View File

@@ -26,7 +26,7 @@ function smarty_function_config_load($params, &$smarty)
{
if ($smarty->debugging) {
$_params = array();
require_once(SMARTY_DIR . 'core/core.get_microtime.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
$_debug_start_time = smarty_core_get_microtime($_params, $smarty);
}
@@ -58,7 +58,7 @@ function smarty_function_config_load($params, &$smarty)
} else {
// config_dir not found, try include_path
$_params = array('file_path' => $smarty->config_dir);
require_once(SMARTY_DIR . 'core/core.get_include_path.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_include_path.php');
smarty_core_get_include_path($_params, $smarty);
$_config_dir = $_params['new_file_path'];
}
@@ -88,7 +88,7 @@ function smarty_function_config_load($params, &$smarty)
$_output = '<?php $_config_vars = unserialize(' . serialize($_config_vars) . '); ?>';
}
$_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => filemtime($_file_path)));
require_once(SMARTY_DIR . 'core/core.write_compiled_resource.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_resource.php');
smarty_core_write_compiled_resource($_params, $smarty);
} else {
include_once($_compile_file);
@@ -113,7 +113,7 @@ function smarty_function_config_load($params, &$smarty)
if ($smarty->debugging) {
$_params = array();
require_once(SMARTY_DIR . 'core/core.get_microtime.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
$smarty->_smarty_debug_info[] = array('type' => 'config',
'filename' => $_file.' ['.$_section.'] '.$_scope,
'depth' => $smarty->_inclusion_depth,

View File

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

View File

@@ -113,7 +113,7 @@ function smarty_function_html_image($params, &$smarty)
}
}
$_params = array('resource_type' => 'file', 'resource_name' => $_image_path);
require_once(SMARTY_DIR . 'core/core.is_secure.php');
require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.is_secure.php');
if(!$smarty->security && !smarty_core_is_secure($_params, $smarty)) {
$smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE);
return;