diff --git a/NEWS b/NEWS index 49f3e98c..66c14b22 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - moved /libs/core to /libs/internals (boots) - fixed more parsing problems (messju) Version 2.6.5 (Sept 13, 2004) diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 784e1663..035960c4 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -49,6 +49,10 @@ if (!defined('SMARTY_DIR')) { 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_QUOTE', 1); define('SMARTY_PHP_REMOVE', 2); @@ -910,7 +914,7 @@ class Smarty switch ($type) { case 'output': $_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); break; @@ -950,7 +954,7 @@ class Smarty 'auto_source' => $tpl_file, 'auto_id' => $_auto_id, '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); } @@ -990,7 +994,7 @@ class Smarty 'cache_id' => $cache_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); } @@ -1024,7 +1028,7 @@ class Smarty 'auto_id' => $compile_id, 'exp_time' => $exp_time, '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); } @@ -1136,7 +1140,7 @@ class Smarty if ($this->debugging) { // capture time for debugging info $_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); $this->_smarty_debug_info[] = array('type' => 'template', 'filename' => $resource_name, @@ -1161,20 +1165,20 @@ class Smarty 'compile_id' => $compile_id, '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)) { $_smarty_results = $_params['results']; if (@count($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); $_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); } if (@count($this->_cache_info['cache_serials'])) { $_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); } @@ -1184,9 +1188,9 @@ class Smarty { // capture time for debugging info $_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; - 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); } if ($this->cache_modified_check) { @@ -1267,9 +1271,9 @@ class Smarty 'cache_id' => $cache_id, 'compile_id' => $compile_id, '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); - 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); if ($this->_cache_serials) { @@ -1288,9 +1292,9 @@ class Smarty if ($this->debugging) { // capture time for debugging info $_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); - 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); } error_reporting($_smarty_old_error_level); @@ -1356,7 +1360,7 @@ class Smarty function _get_plugin_filepath($type, $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); } @@ -1414,12 +1418,12 @@ class Smarty 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 ($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); } $_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); return true; @@ -1579,7 +1583,7 @@ class Smarty $this->trigger_error('unable to read resource: "' . $params['resource_name'] . '"'); } } 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 (!$params['quiet']) $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 $_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)) { $params['resource_name'] = $_params['new_file_path']; return true; @@ -1648,7 +1652,7 @@ class Smarty } } elseif (empty($this->_plugins['resource'][$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); } @@ -1836,7 +1840,7 @@ class Smarty { if ($this->debugging) { $_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); $this->_smarty_debug_info[] = array('type' => 'template', 'filename' => $params['smarty_include_tpl_file'], @@ -1867,7 +1871,7 @@ class Smarty if ($this->debugging) { // capture time for debugging info $_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; } diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 4c5354a6..ee2e7910 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -380,14 +380,14 @@ class Smarty_Compiler extends Smarty { } } $_plugins_params .= '))'; - $plugins_code = "\n"; + $plugins_code = "\n"; $template_header .= $plugins_code; $this->_plugin_info = array(); $this->_plugins_code = $plugins_code; } if ($this->_init_smarty_vars) { - $template_header .= "\n"; + $template_header .= "\n"; $this->_init_smarty_vars = false; } @@ -924,7 +924,7 @@ class Smarty_Compiler extends Smarty { $_params = "array('args' => array(".implode(', ', (array)$arg_list)."))"; - return "" . $this->_additional_newline; + return "" . $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)."))"; - return "" . $this->_additional_newline; + return "" . $this->_additional_newline; } @@ -2105,7 +2105,7 @@ class Smarty_Compiler extends Smarty { if ($prefilter === false) { unset($this->_plugins['prefilter'][$filter_name]); $_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); } } @@ -2115,7 +2115,7 @@ class Smarty_Compiler extends Smarty { if ($postfilter === false) { unset($this->_plugins['postfilter'][$filter_name]); $_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); } } diff --git a/libs/core/core.assemble_plugin_filepath.php b/libs/internals/core.assemble_plugin_filepath.php similarity index 94% rename from libs/core/core.assemble_plugin_filepath.php rename to libs/internals/core.assemble_plugin_filepath.php index cb8f5441..690d3ddb 100644 --- a/libs/core/core.assemble_plugin_filepath.php +++ b/libs/internals/core.assemble_plugin_filepath.php @@ -50,7 +50,7 @@ function smarty_core_assemble_plugin_filepath($params, &$smarty) $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename; $_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)) { $_return = $_params['new_file_path']; break; diff --git a/libs/core/core.assign_smarty_interface.php b/libs/internals/core.assign_smarty_interface.php similarity index 100% rename from libs/core/core.assign_smarty_interface.php rename to libs/internals/core.assign_smarty_interface.php diff --git a/libs/core/core.create_dir_structure.php b/libs/internals/core.create_dir_structure.php similarity index 100% rename from libs/core/core.create_dir_structure.php rename to libs/internals/core.create_dir_structure.php diff --git a/libs/core/core.display_debug_console.php b/libs/internals/core.display_debug_console.php similarity index 100% rename from libs/core/core.display_debug_console.php rename to libs/internals/core.display_debug_console.php diff --git a/libs/core/core.get_include_path.php b/libs/internals/core.get_include_path.php similarity index 100% rename from libs/core/core.get_include_path.php rename to libs/internals/core.get_include_path.php diff --git a/libs/core/core.get_microtime.php b/libs/internals/core.get_microtime.php similarity index 100% rename from libs/core/core.get_microtime.php rename to libs/internals/core.get_microtime.php diff --git a/libs/core/core.get_php_resource.php b/libs/internals/core.get_php_resource.php similarity index 92% rename from libs/core/core.get_php_resource.php rename to libs/internals/core.get_php_resource.php index 8121acf8..786d4e78 100644 --- a/libs/core/core.get_php_resource.php +++ b/libs/internals/core.get_php_resource.php @@ -32,7 +32,7 @@ function smarty_core_get_php_resource(&$params, &$smarty) } else { // test for file in include_path $_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)) { $_include_path = $_params['new_file_path']; $_readable = true; @@ -56,7 +56,7 @@ function smarty_core_get_php_resource(&$params, &$smarty) if ($_readable) { 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)) { $smarty->$_error_funcc('(secure mode) ' . $params['resource_type'] . ':' . $params['resource_name'] . ' is not trusted'); return false; diff --git a/libs/core/core.is_secure.php b/libs/internals/core.is_secure.php similarity index 100% rename from libs/core/core.is_secure.php rename to libs/internals/core.is_secure.php diff --git a/libs/core/core.is_trusted.php b/libs/internals/core.is_trusted.php similarity index 100% rename from libs/core/core.is_trusted.php rename to libs/internals/core.is_trusted.php diff --git a/libs/core/core.load_plugins.php b/libs/internals/core.load_plugins.php similarity index 100% rename from libs/core/core.load_plugins.php rename to libs/internals/core.load_plugins.php diff --git a/libs/core/core.load_resource_plugin.php b/libs/internals/core.load_resource_plugin.php similarity index 100% rename from libs/core/core.load_resource_plugin.php rename to libs/internals/core.load_resource_plugin.php diff --git a/libs/core/core.process_cached_inserts.php b/libs/internals/core.process_cached_inserts.php similarity index 88% rename from libs/core/core.process_cached_inserts.php rename to libs/internals/core.process_cached_inserts.php index 0e368fdd..29cb007e 100644 --- a/libs/core/core.process_cached_inserts.php +++ b/libs/internals/core.process_cached_inserts.php @@ -20,7 +20,7 @@ function smarty_core_process_cached_inserts($params, &$smarty) for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) { if ($smarty->debugging) { $_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); } @@ -29,7 +29,7 @@ function smarty_core_process_cached_inserts($params, &$smarty) if (isset($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)) { return false; } @@ -55,7 +55,7 @@ function smarty_core_process_cached_inserts($params, &$smarty) $params['results'] = str_replace($cached_inserts[$i], $replace, $params['results']); if ($smarty->debugging) { $_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', 'filename' => 'insert_'.$name, 'depth' => $smarty->_inclusion_depth, diff --git a/libs/core/core.process_compiled_include.php b/libs/internals/core.process_compiled_include.php similarity index 100% rename from libs/core/core.process_compiled_include.php rename to libs/internals/core.process_compiled_include.php diff --git a/libs/core/core.read_cache_file.php b/libs/internals/core.read_cache_file.php similarity index 100% rename from libs/core/core.read_cache_file.php rename to libs/internals/core.read_cache_file.php diff --git a/libs/core/core.rm_auto.php b/libs/internals/core.rm_auto.php similarity index 92% rename from libs/core/core.rm_auto.php rename to libs/internals/core.rm_auto.php index b7cdaf8c..b251f649 100644 --- a/libs/core/core.rm_auto.php +++ b/libs/internals/core.rm_auto.php @@ -28,7 +28,7 @@ function smarty_core_rm_auto($params, &$smarty) 'level' => 0, '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); } else { $_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, '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); } else { // remove matching file names diff --git a/libs/core/core.rmdir.php b/libs/internals/core.rmdir.php similarity index 93% rename from libs/core/core.rmdir.php rename to libs/internals/core.rmdir.php index 38df822c..4fdbccc9 100644 --- a/libs/core/core.rmdir.php +++ b/libs/internals/core.rmdir.php @@ -32,7 +32,7 @@ function smarty_core_rmdir($params, &$smarty) 'level' => $params['level'] + 1, '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); } else { diff --git a/libs/core/core.run_insert_handler.php b/libs/internals/core.run_insert_handler.php similarity index 89% rename from libs/core/core.run_insert_handler.php rename to libs/internals/core.run_insert_handler.php index aa391ab3..71c38450 100644 --- a/libs/core/core.run_insert_handler.php +++ b/libs/internals/core.run_insert_handler.php @@ -14,7 +14,7 @@ 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) { $_params = array(); $_debug_start_time = smarty_core_get_microtime($_params, $smarty); @@ -34,7 +34,7 @@ function smarty_core_run_insert_handler($params, &$smarty) } else { if (isset($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)) { return false; } @@ -51,7 +51,7 @@ function smarty_core_run_insert_handler($params, &$smarty) $_content = $_funcname($params['args'], $smarty); if ($smarty->debugging) { $_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', 'filename' => 'insert_'.$params['args']['name'], 'depth' => $smarty->_inclusion_depth, diff --git a/libs/core/core.smarty_include_php.php b/libs/internals/core.smarty_include_php.php similarity index 94% rename from libs/core/core.smarty_include_php.php rename to libs/internals/core.smarty_include_php.php index 4b316480..30c6e765 100644 --- a/libs/core/core.smarty_include_php.php +++ b/libs/internals/core.smarty_include_php.php @@ -21,7 +21,7 @@ function smarty_core_smarty_include_php($params, &$smarty) { $_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_resource_type = $_params['resource_type']; $_smarty_php_resource = $_params['php_resource']; diff --git a/libs/core/core.write_cache_file.php b/libs/internals/core.write_cache_file.php similarity index 96% rename from libs/core/core.write_cache_file.php rename to libs/internals/core.write_cache_file.php index 7429ad98..9b3a14e3 100644 --- a/libs/core/core.write_cache_file.php +++ b/libs/internals/core.write_cache_file.php @@ -62,7 +62,7 @@ function smarty_core_write_cache_file($params, &$smarty) $_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); $_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); return true; } diff --git a/libs/core/core.write_compiled_include.php b/libs/internals/core.write_compiled_include.php similarity index 96% rename from libs/core/core.write_compiled_include.php rename to libs/internals/core.write_compiled_include.php index 5f894fe4..21cac845 100644 --- a/libs/core/core.write_compiled_include.php +++ b/libs/internals/core.write_compiled_include.php @@ -69,7 +69,7 @@ $source $_params = array('filename' => $_compile_path, '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); return true; } diff --git a/libs/core/core.write_compiled_resource.php b/libs/internals/core.write_compiled_resource.php similarity index 92% rename from libs/core/core.write_compiled_resource.php rename to libs/internals/core.write_compiled_resource.php index 5e132ead..b902eff3 100644 --- a/libs/core/core.write_compiled_resource.php +++ b/libs/internals/core.write_compiled_resource.php @@ -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); - 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); return true; } diff --git a/libs/core/core.write_file.php b/libs/internals/core.write_file.php similarity index 92% rename from libs/core/core.write_file.php rename to libs/internals/core.write_file.php index ea08adb8..09e16984 100644 --- a/libs/core/core.write_file.php +++ b/libs/internals/core.write_file.php @@ -19,7 +19,7 @@ function smarty_core_write_file($params, &$smarty) if ($params['create_dirs']) { $_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); } diff --git a/libs/plugins/function.config_load.php b/libs/plugins/function.config_load.php index be455a44..db7f8f6b 100644 --- a/libs/plugins/function.config_load.php +++ b/libs/plugins/function.config_load.php @@ -26,7 +26,7 @@ function smarty_function_config_load($params, &$smarty) { if ($smarty->debugging) { $_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); } @@ -101,7 +101,7 @@ function smarty_function_config_load($params, &$smarty) $_output = ''\\\'', '\\'=>'\\\\')) . '\'); ?>'; } $_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); } else { include($_compile_file); @@ -126,7 +126,7 @@ function smarty_function_config_load($params, &$smarty) if ($smarty->debugging) { $_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', 'filename' => $_file.' ['.$_section.'] '.$_scope, 'depth' => $smarty->_inclusion_depth, diff --git a/libs/plugins/function.debug.php b/libs/plugins/function.debug.php index 200b9669..77e71092 100644 --- a/libs/plugins/function.debug.php +++ b/libs/plugins/function.debug.php @@ -26,7 +26,7 @@ function smarty_function_debug($params, &$smarty) if (isset($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); } diff --git a/libs/plugins/function.fetch.php b/libs/plugins/function.fetch.php index cbc3b0e3..f5a6987a 100644 --- a/libs/plugins/function.fetch.php +++ b/libs/plugins/function.fetch.php @@ -29,7 +29,7 @@ function smarty_function_fetch($params, &$smarty) $content = ''; if ($smarty->security && !preg_match('!^(http|ftp)://!i', $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)) { $smarty->_trigger_fatal_error('[plugin] (secure mode) fetch \'' . $params['file'] . '\' is not allowed'); return; diff --git a/libs/plugins/function.html_image.php b/libs/plugins/function.html_image.php index 2654b03d..aa2aa187 100644 --- a/libs/plugins/function.html_image.php +++ b/libs/plugins/function.html_image.php @@ -97,7 +97,7 @@ function smarty_function_html_image($params, &$smarty) if(!isset($params['width']) || !isset($params['height'])) { if ($smarty->security && ($_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->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE);