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

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);
}