php上传服务器问题
时间:2008-08-30 来源:gxshao
在我的电脑上运行是可以的,但是上传到服务器上有个模块运行不了,提法错误是:
Warning: Smarty error: unable to read resource: "too_portcode.htm" in /www/www.tinsongroup.com/public_html/includes/smarty/Smarty.class.php on line 1095
我是真的找不原因了,在www.tinsongorup.com是"网上工具"-->"物流知识"-->"港口代码"(too_portcode.php)
主大伙帮帮忙啊,谢谢!
这是smarty.class.php代码:
<?php
if(!defined('DIR_SEP')) {
define('DIR_SEP', DIRECTORY_SEPARATOR);
}
if (!defined('SMARTY_DIR')) {
define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
}
if (!defined('SMARTY_CORE_DIR')) {
define('SMARTY_CORE_DIR', SMARTY_DIR . 'internals' . DIRECTORY_SEPARATOR);
}
define('SMARTY_PHP_PASSTHRU', 0);
define('SMARTY_PHP_QUOTE', 1);
define('SMARTY_PHP_REMOVE', 2);
define('SMARTY_PHP_ALLOW', 3);
class Smarty
{
var $template_dir = 'templates';
var $compile_dir = 'templates_c';
var $config_dir = 'configs';
var $plugins_dir = array('plugins');
var $debugging = false;
var $error_reporting = null;
var $debug_tpl = '';
var $debugging_ctrl = 'NONE';
var $compile_check = true;
var $force_compile = false;
var $caching = 0;
var $cache_dir = 'cache';
var $cache_lifetime = 3600;
var $cache_modified_check = false;
var $php_handling = SMARTY_PHP_PASSTHRU;
var $security = false;
var $secure_dir = array();
var $security_settings = array(
'PHP_HANDLING' => false,
'IF_FUNCS' => array('array', 'list',
'isset', 'empty',
'count', 'sizeof',
'in_array', 'is_array',
'true', 'false', 'null'),
'INCLUDE_ANY' => false,
'PHP_TAGS' => false,
'MODIFIER_FUNCS' => array('count'),
'ALLOW_CONSTANTS' => false
);
var $trusted_dir = array();
var $left_delimiter = '{';
var $right_delimiter = '}';
var $request_vars_order = 'EGPCS';
var $request_use_auto_globals = true;
var $compile_id = null;
var $use_sub_dirs = false;
var $default_modifiers = array();
var $default_resource_type = 'file';
var $cache_handler_func = null;
var $autoload_filters = array();
var $config_overwrite = true;
var $config_booleanize = true;
var $config_read_hidden = false;
var $config_fix_newlines = true;
var $default_template_handler_func = '';
var $compiler_file = 'Smarty_Compiler.class.php';
var $compiler_class = 'Smarty_Compiler';
var $config_class = 'Config_File';
var $_tpl_vars = array();
var $_smarty_vars = null;
var $_sections = array();
var $_foreach = array();
var $_tag_stack = array();
var $_conf_obj = null;
var $_config = array(array('vars' => array(), 'files' => array()));
var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f';
var $_version = '2.6.14';
var $_inclusion_depth = 0;
var $_compile_id = null;
var $_smarty_debug_id = 'SMARTY_DEBUG';
var $_smarty_debug_info = array();
var $_cache_info = array();
var $_file_perms = 0644;
var $_dir_perms = 0771;
var $_reg_objects = array();
var $_plugins = array(
'modifier' => array(),
'function' => array(),
'block' => array(),
'compiler' => array(),
'prefilter' => array(),
'postfilter' => array(),
'outputfilter' => array(),
'resource' => array(),
'insert' => array());
var $_cache_serials = array();
var $_cache_include = null;
var $_cache_including = false;
function Smarty()
{
$this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME']
: @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']);
}
function assign($tpl_var, $value = null)
{
if (is_array($tpl_var)){
foreach ($tpl_var as $key => $val) {
if ($key != '') {
$this->_tpl_vars[$key] = $val;
}
}
} else {
if ($tpl_var != '')
$this->_tpl_vars[$tpl_var] = $value;
}
}
function assign_by_ref($tpl_var, &$value)
{
if ($tpl_var != '')
$this->_tpl_vars[$tpl_var] = &$value;
}
function append($tpl_var, $value=null, $merge=false)
{
if (is_array($tpl_var)) {
// $tpl_var is an array, ignore $value
foreach ($tpl_var as $_key => $_val) {
if ($_key != '') {
if([email=!@is_array($this-]!@is_array($this->_tpl_vars[$_key[/email]])) {
settype($this->_tpl_vars[$_key],'array');
}
if($merge && is_array($_val)) {
foreach($_val as $_mkey => $_mval) {
$this->_tpl_vars[$_key][$_mkey] = $_mval;
}
} else {
$this->_tpl_vars[$_key][] = $_val;
}
}
}
} else {
if ($tpl_var != '' && isset($value)) {
if([email=!@is_array($this-]!@is_array($this->_tpl_vars[$tpl_var[/email]])) {
settype($this->_tpl_vars[$tpl_var],'array');
}
if($merge && is_array($value)) {
foreach($value as $_mkey => $_mval) {
$this->_tpl_vars[$tpl_var][$_mkey] = $_mval;
}
} else {
$this->_tpl_vars[$tpl_var][] = $value;
}
}
}
}
function append_by_ref($tpl_var, &$value, $merge=false)
{
if ($tpl_var != '' && isset($value)) {
if([email=!@is_array($this-]!@is_array($this->_tpl_vars[$tpl_var[/email]])) {
settype($this->_tpl_vars[$tpl_var],'array');
}
if ($merge && is_array($value)) {
foreach($value as $_key => $_val) {
$this->_tpl_vars[$tpl_var][$_key] = &$value[$_key];
}
} else {
$this->_tpl_vars[$tpl_var][] = &$value;
}
}
}
function clear_assign($tpl_var)
{
if (is_array($tpl_var))
foreach ($tpl_var as $curr_var)
unset($this->_tpl_vars[$curr_var]);
else
unset($this->_tpl_vars[$tpl_var]);
}
function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null)
{
$this->_plugins['function'][$function] =
array($function_impl, null, null, false, $cacheable, $cache_attrs);
}
function unregister_function($function)
{
unset($this->_plugins['function'][$function]);
}
function register_object($object, &$object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
{
settype($allowed, 'array');
settype($smarty_args, 'boolean');
$this->_reg_objects[$object] =
array(&$object_impl, $allowed, $smarty_args, $block_methods);
}
function unregister_object($object)
{
unset($this->_reg_objects[$object]);
}
function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null)
{
$this->_plugins['block'][$block] =
array($block_impl, null, null, false, $cacheable, $cache_attrs);
}
function unregister_block($block)
{
unset($this->_plugins['block'][$block]);
}
function register_compiler_function($function, $function_impl, $cacheable=true)
{
$this->_plugins['compiler'][$function] =
array($function_impl, null, null, false, $cacheable);
}
function unregister_compiler_function($function)
{
unset($this->_plugins['compiler'][$function]);
}
function register_modifier($modifier, $modifier_impl)
{
$this->_plugins['modifier'][$modifier] =
array($modifier_impl, null, null, false);
}
function unregister_modifier($modifier)
{
unset($this->_plugins['modifier'][$modifier]);
}
function register_resource($type, $functions)
{
if (count($functions)==4) {
$this->_plugins['resource'][$type] =
array($functions, false);
} elseif (count($functions)==5) {
$this->_plugins['resource'][$type] =
array(array(array(&$functions[0], $functions[1])
,array(&$functions[0], $functions[2])
,array(&$functions[0], $functions[3])
,array(&$functions[0], $functions[4]))
,false);
} else {
$this->trigger_error("malformed function-list for '$type' in register_resource");
}
}
function unregister_resource($type)
{
unset($this->_plugins['resource'][$type]);
}
function register_prefilter($function)
{
$_name = (is_array($function)) ? $function[1] : $function;
$this->_plugins['prefilter'][$_name]
= array($function, null, null, false);
}
function unregister_prefilter($function)
{
unset($this->_plugins['prefilter'][$function]);
}
function register_postfilter($function)
{
$_name = (is_array($function)) ? $function[1] : $function;
$this->_plugins['postfilter'][$_name]
= array($function, null, null, false);
}
function unregister_postfilter($function)
{
unset($this->_plugins['postfilter'][$function]);
}
function register_outputfilter($function)
{
$_name = (is_array($function)) ? $function[1] : $function;
$this->_plugins['outputfilter'][$_name]
= array($function, null, null, false);
}
function unregister_outputfilter($function)
{
unset($this->_plugins['outputfilter'][$function]);
}
function load_filter($type, $name)
{
switch ($type) {
case 'output':
$_params = array('plugins' => array(array($type . 'filter', $name, null, null, false)));
require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins($_params, $this);
break;
case 'pre':
case 'post':
if (!isset($this->_plugins[$type . 'filter'][$name]))
$this->_plugins[$type . 'filter'][$name] = false;
break;
}
}
function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
{
if (!isset($compile_id))
$compile_id = $this->compile_id;
if (!isset($tpl_file))
$compile_id = null;
$_auto_id = $this->_get_auto_id($cache_id, $compile_id);
if (!empty($this->cache_handler_func)) {
return call_user_func_array($this->cache_handler_func,
array('clear', &$this, &$dummy, $tpl_file, $cache_id, $compile_id, $exp_time));
} else {
$_params = array('auto_base' => $this->cache_dir,
'auto_source' => $tpl_file,
'auto_id' => $_auto_id,
'exp_time' => $exp_time);
require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
return smarty_core_rm_auto($_params, $this);
}
}
function clear_all_cache($exp_time = null)
{
return $this->clear_cache(null, null, null, $exp_time);
}
function is_cached($tpl_file, $cache_id = null, $compile_id = null)
{
if (!$this->caching)
return false;
if (!isset($compile_id))
$compile_id = $this->compile_id;
$_params = array(
'tpl_file' => $tpl_file,
'cache_id' => $cache_id,
'compile_id' => $compile_id
);
require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
return smarty_core_read_cache_file($_params, $this);
}
function clear_all_assign()
{
$this->_tpl_vars = array();
}
function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
{
if (!isset($compile_id)) {
$compile_id = $this->compile_id;
}
$_params = array('auto_base' => $this->compile_dir,
'auto_source' => $tpl_file,
'auto_id' => $compile_id,
'exp_time' => $exp_time,
'extensions' => array('.inc', '.php'));
require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
return smarty_core_rm_auto($_params, $this);
}
function template_exists($tpl_file)
{
$_params = array('resource_name' => $tpl_file, 'quiet'=>true, 'get_source'=>false);
return $this->_fetch_resource_info($_params);
}
function &get_template_vars($name=null)
{
if(!isset($name)) {
return $this->_tpl_vars;
} elseif(isset($this->_tpl_vars[$name])) {
return $this->_tpl_vars[$name];
} else {
// var non-existant, return valid reference
$_tmp = null;
return $_tmp;
}
}
function &get_config_vars($name=null)
{
if(!isset($name) && is_array($this->_config[0])) {
return $this->_config[0]['vars'];
} else if(isset($this->_config[0]['vars'][$name])) {
return $this->_config[0]['vars'][$name];
} else {
// var non-existant, return valid reference
$_tmp = null;
return $_tmp;
}
}
function trigger_error($error_msg, $error_type = E_USER_WARNING)
{
trigger_error("Smarty error: $error_msg", $error_type);
}
Warning: Smarty error: unable to read resource: "too_portcode.htm" in /www/www.tinsongroup.com/public_html/includes/smarty/Smarty.class.php on line 1095
我是真的找不原因了,在www.tinsongorup.com是"网上工具"-->"物流知识"-->"港口代码"(too_portcode.php)
主大伙帮帮忙啊,谢谢!
这是smarty.class.php代码:
<?php
if(!defined('DIR_SEP')) {
define('DIR_SEP', DIRECTORY_SEPARATOR);
}
if (!defined('SMARTY_DIR')) {
define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
}
if (!defined('SMARTY_CORE_DIR')) {
define('SMARTY_CORE_DIR', SMARTY_DIR . 'internals' . DIRECTORY_SEPARATOR);
}
define('SMARTY_PHP_PASSTHRU', 0);
define('SMARTY_PHP_QUOTE', 1);
define('SMARTY_PHP_REMOVE', 2);
define('SMARTY_PHP_ALLOW', 3);
class Smarty
{
var $template_dir = 'templates';
var $compile_dir = 'templates_c';
var $config_dir = 'configs';
var $plugins_dir = array('plugins');
var $debugging = false;
var $error_reporting = null;
var $debug_tpl = '';
var $debugging_ctrl = 'NONE';
var $compile_check = true;
var $force_compile = false;
var $caching = 0;
var $cache_dir = 'cache';
var $cache_lifetime = 3600;
var $cache_modified_check = false;
var $php_handling = SMARTY_PHP_PASSTHRU;
var $security = false;
var $secure_dir = array();
var $security_settings = array(
'PHP_HANDLING' => false,
'IF_FUNCS' => array('array', 'list',
'isset', 'empty',
'count', 'sizeof',
'in_array', 'is_array',
'true', 'false', 'null'),
'INCLUDE_ANY' => false,
'PHP_TAGS' => false,
'MODIFIER_FUNCS' => array('count'),
'ALLOW_CONSTANTS' => false
);
var $trusted_dir = array();
var $left_delimiter = '{';
var $right_delimiter = '}';
var $request_vars_order = 'EGPCS';
var $request_use_auto_globals = true;
var $compile_id = null;
var $use_sub_dirs = false;
var $default_modifiers = array();
var $default_resource_type = 'file';
var $cache_handler_func = null;
var $autoload_filters = array();
var $config_overwrite = true;
var $config_booleanize = true;
var $config_read_hidden = false;
var $config_fix_newlines = true;
var $default_template_handler_func = '';
var $compiler_file = 'Smarty_Compiler.class.php';
var $compiler_class = 'Smarty_Compiler';
var $config_class = 'Config_File';
var $_tpl_vars = array();
var $_smarty_vars = null;
var $_sections = array();
var $_foreach = array();
var $_tag_stack = array();
var $_conf_obj = null;
var $_config = array(array('vars' => array(), 'files' => array()));
var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f';
var $_version = '2.6.14';
var $_inclusion_depth = 0;
var $_compile_id = null;
var $_smarty_debug_id = 'SMARTY_DEBUG';
var $_smarty_debug_info = array();
var $_cache_info = array();
var $_file_perms = 0644;
var $_dir_perms = 0771;
var $_reg_objects = array();
var $_plugins = array(
'modifier' => array(),
'function' => array(),
'block' => array(),
'compiler' => array(),
'prefilter' => array(),
'postfilter' => array(),
'outputfilter' => array(),
'resource' => array(),
'insert' => array());
var $_cache_serials = array();
var $_cache_include = null;
var $_cache_including = false;
function Smarty()
{
$this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME']
: @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']);
}
function assign($tpl_var, $value = null)
{
if (is_array($tpl_var)){
foreach ($tpl_var as $key => $val) {
if ($key != '') {
$this->_tpl_vars[$key] = $val;
}
}
} else {
if ($tpl_var != '')
$this->_tpl_vars[$tpl_var] = $value;
}
}
function assign_by_ref($tpl_var, &$value)
{
if ($tpl_var != '')
$this->_tpl_vars[$tpl_var] = &$value;
}
function append($tpl_var, $value=null, $merge=false)
{
if (is_array($tpl_var)) {
// $tpl_var is an array, ignore $value
foreach ($tpl_var as $_key => $_val) {
if ($_key != '') {
if([email=!@is_array($this-]!@is_array($this->_tpl_vars[$_key[/email]])) {
settype($this->_tpl_vars[$_key],'array');
}
if($merge && is_array($_val)) {
foreach($_val as $_mkey => $_mval) {
$this->_tpl_vars[$_key][$_mkey] = $_mval;
}
} else {
$this->_tpl_vars[$_key][] = $_val;
}
}
}
} else {
if ($tpl_var != '' && isset($value)) {
if([email=!@is_array($this-]!@is_array($this->_tpl_vars[$tpl_var[/email]])) {
settype($this->_tpl_vars[$tpl_var],'array');
}
if($merge && is_array($value)) {
foreach($value as $_mkey => $_mval) {
$this->_tpl_vars[$tpl_var][$_mkey] = $_mval;
}
} else {
$this->_tpl_vars[$tpl_var][] = $value;
}
}
}
}
function append_by_ref($tpl_var, &$value, $merge=false)
{
if ($tpl_var != '' && isset($value)) {
if([email=!@is_array($this-]!@is_array($this->_tpl_vars[$tpl_var[/email]])) {
settype($this->_tpl_vars[$tpl_var],'array');
}
if ($merge && is_array($value)) {
foreach($value as $_key => $_val) {
$this->_tpl_vars[$tpl_var][$_key] = &$value[$_key];
}
} else {
$this->_tpl_vars[$tpl_var][] = &$value;
}
}
}
function clear_assign($tpl_var)
{
if (is_array($tpl_var))
foreach ($tpl_var as $curr_var)
unset($this->_tpl_vars[$curr_var]);
else
unset($this->_tpl_vars[$tpl_var]);
}
function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null)
{
$this->_plugins['function'][$function] =
array($function_impl, null, null, false, $cacheable, $cache_attrs);
}
function unregister_function($function)
{
unset($this->_plugins['function'][$function]);
}
function register_object($object, &$object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
{
settype($allowed, 'array');
settype($smarty_args, 'boolean');
$this->_reg_objects[$object] =
array(&$object_impl, $allowed, $smarty_args, $block_methods);
}
function unregister_object($object)
{
unset($this->_reg_objects[$object]);
}
function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null)
{
$this->_plugins['block'][$block] =
array($block_impl, null, null, false, $cacheable, $cache_attrs);
}
function unregister_block($block)
{
unset($this->_plugins['block'][$block]);
}
function register_compiler_function($function, $function_impl, $cacheable=true)
{
$this->_plugins['compiler'][$function] =
array($function_impl, null, null, false, $cacheable);
}
function unregister_compiler_function($function)
{
unset($this->_plugins['compiler'][$function]);
}
function register_modifier($modifier, $modifier_impl)
{
$this->_plugins['modifier'][$modifier] =
array($modifier_impl, null, null, false);
}
function unregister_modifier($modifier)
{
unset($this->_plugins['modifier'][$modifier]);
}
function register_resource($type, $functions)
{
if (count($functions)==4) {
$this->_plugins['resource'][$type] =
array($functions, false);
} elseif (count($functions)==5) {
$this->_plugins['resource'][$type] =
array(array(array(&$functions[0], $functions[1])
,array(&$functions[0], $functions[2])
,array(&$functions[0], $functions[3])
,array(&$functions[0], $functions[4]))
,false);
} else {
$this->trigger_error("malformed function-list for '$type' in register_resource");
}
}
function unregister_resource($type)
{
unset($this->_plugins['resource'][$type]);
}
function register_prefilter($function)
{
$_name = (is_array($function)) ? $function[1] : $function;
$this->_plugins['prefilter'][$_name]
= array($function, null, null, false);
}
function unregister_prefilter($function)
{
unset($this->_plugins['prefilter'][$function]);
}
function register_postfilter($function)
{
$_name = (is_array($function)) ? $function[1] : $function;
$this->_plugins['postfilter'][$_name]
= array($function, null, null, false);
}
function unregister_postfilter($function)
{
unset($this->_plugins['postfilter'][$function]);
}
function register_outputfilter($function)
{
$_name = (is_array($function)) ? $function[1] : $function;
$this->_plugins['outputfilter'][$_name]
= array($function, null, null, false);
}
function unregister_outputfilter($function)
{
unset($this->_plugins['outputfilter'][$function]);
}
function load_filter($type, $name)
{
switch ($type) {
case 'output':
$_params = array('plugins' => array(array($type . 'filter', $name, null, null, false)));
require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins($_params, $this);
break;
case 'pre':
case 'post':
if (!isset($this->_plugins[$type . 'filter'][$name]))
$this->_plugins[$type . 'filter'][$name] = false;
break;
}
}
function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
{
if (!isset($compile_id))
$compile_id = $this->compile_id;
if (!isset($tpl_file))
$compile_id = null;
$_auto_id = $this->_get_auto_id($cache_id, $compile_id);
if (!empty($this->cache_handler_func)) {
return call_user_func_array($this->cache_handler_func,
array('clear', &$this, &$dummy, $tpl_file, $cache_id, $compile_id, $exp_time));
} else {
$_params = array('auto_base' => $this->cache_dir,
'auto_source' => $tpl_file,
'auto_id' => $_auto_id,
'exp_time' => $exp_time);
require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
return smarty_core_rm_auto($_params, $this);
}
}
function clear_all_cache($exp_time = null)
{
return $this->clear_cache(null, null, null, $exp_time);
}
function is_cached($tpl_file, $cache_id = null, $compile_id = null)
{
if (!$this->caching)
return false;
if (!isset($compile_id))
$compile_id = $this->compile_id;
$_params = array(
'tpl_file' => $tpl_file,
'cache_id' => $cache_id,
'compile_id' => $compile_id
);
require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
return smarty_core_read_cache_file($_params, $this);
}
function clear_all_assign()
{
$this->_tpl_vars = array();
}
function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
{
if (!isset($compile_id)) {
$compile_id = $this->compile_id;
}
$_params = array('auto_base' => $this->compile_dir,
'auto_source' => $tpl_file,
'auto_id' => $compile_id,
'exp_time' => $exp_time,
'extensions' => array('.inc', '.php'));
require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
return smarty_core_rm_auto($_params, $this);
}
function template_exists($tpl_file)
{
$_params = array('resource_name' => $tpl_file, 'quiet'=>true, 'get_source'=>false);
return $this->_fetch_resource_info($_params);
}
function &get_template_vars($name=null)
{
if(!isset($name)) {
return $this->_tpl_vars;
} elseif(isset($this->_tpl_vars[$name])) {
return $this->_tpl_vars[$name];
} else {
// var non-existant, return valid reference
$_tmp = null;
return $_tmp;
}
}
function &get_config_vars($name=null)
{
if(!isset($name) && is_array($this->_config[0])) {
return $this->_config[0]['vars'];
} else if(isset($this->_config[0]['vars'][$name])) {
return $this->_config[0]['vars'][$name];
} else {
// var non-existant, return valid reference
$_tmp = null;
return $_tmp;
}
}
function trigger_error($error_msg, $error_type = E_USER_WARNING)
{
trigger_error("Smarty error: $error_msg", $error_type);
}
相关阅读 更多 +