系统发生错误

您可以选择 [ 重试 ] [ 返回 ] 或者 [ 回到首页 ]

[ 错误信息 ]

{ "message": "_ERROR_ACTION_p", "type": "ThinkException", "detail": "_MODULE_[Supplyshow] _ACTION_[p]\n0: 1: 2: if (!defined('THINK_PATH')) exit(); if(version_compare(PHP_VERSION,'6.0.0','<') ) { @set_magic_quotes_runtime (0); define('MAGIC_QUOTES_GPC',get_magic_quotes_gpc()?True:False); }else{ define('MAGIC_QUOTES_GPC',False); } define('MEMORY_LIMIT_ON',function_exists('memory_get_usage')); define('IS_CGI',substr(PHP_SAPI, 0,3)=='cgi' ? 1 : 0 ); define('IS_WIN',strstr(PHP_OS, 'WIN') ? 1 : 0 ); define('IS_CLI',PHP_SAPI=='cli'? 1 : 0); if(!IS_CLI) { if(!defined('_PHP_FILE_')) { if(IS_CGI) { $_temp = explode('.php',$_SERVER[\"PHP_SELF\"]); define('_PHP_FILE_', rtrim(str_replace($_SERVER[\"HTTP_HOST\"],'',$_temp[0].'.php'),'\/')); }else { define('_PHP_FILE_', rtrim($_SERVER[\"SCRIPT_NAME\"],'\/')); } } if(!defined('__ROOT__')) { if( strtoupper(APP_NAME) == strtoupper(basename(dirname(_PHP_FILE_))) ) { $_root = dirname(dirname(_PHP_FILE_)); }else { $_root = dirname(_PHP_FILE_); } define('__ROOT__', (($_root=='\/' || $_root=='\\\\')?'':$_root)); } define('URL_COMMON', 0); define('URL_PATHINFO', 1); define('URL_REWRITE', 2); define('URL_COMPAT', 3); } define('THINK_VERSION', '2.0'); if(MEMORY_LIMIT_ON) { $GLOBALS['_startUseMems'] = memory_get_usage(); } define('CACHE_DIR', 'Cache'); define('HTML_DIR', 'Html'); define('CONF_DIR', 'Conf'); define('LIB_DIR', 'Lib'); define('LOG_DIR', 'Logs'); define('LANG_DIR', 'Lang'); define('TEMP_DIR', 'Temp'); define('TMPL_DIR', 'Tpl'); define('TMPL_PATH',APP_PATH.'\/'.TMPL_DIR.'\/'); define('HTML_PATH',APP_PATH.'\/'.HTML_DIR.'\/'); define('COMMON_PATH', APP_PATH.'\/Common\/'); define('LIB_PATH', APP_PATH.'\/'.LIB_DIR.'\/'); define('CACHE_PATH', RUNTIME_PATH.CACHE_DIR.'\/'); define('CONFIG_PATH', APP_PATH.'\/'.CONF_DIR.'\/'); define('LOG_PATH', RUNTIME_PATH.LOG_DIR.'\/'); define('LANG_PATH', APP_PATH.'\/'.LANG_DIR.'\/'); define('TEMP_PATH', RUNTIME_PATH.TEMP_DIR.'\/'); define('DATA_PATH', RUNTIME_PATH.'Data\/'); define('VENDOR_PATH',THINK_PATH.'\/Vendor\/'); set_include_path(get_include_path() . PATH_SEPARATOR . VENDOR_PATH); spl_autoload_register('_autoload'); function U($url,$params=array(),$redirect=false,$suffix=true) { if(0===strpos($url,'\/')) $url = substr($url,1); if(!strpos($url,':\/\/')) $url = APP_NAME.':\/\/'.$url; if(stripos($url,'@?')) { $url = str_replace('@?','@think?',$url); }elseif(stripos($url,'@')) { $url = $url.MODULE_NAME; } $array = parse_url($url); $app = isset($array['scheme'])? $array['scheme'] :APP_NAME; $route = isset($array['user'])?$array['user']:''; if(defined('GROUP_NAME') && strcasecmp(GROUP_NAME,C('DEFAULT_GROUP'))) $group= GROUP_NAME; if(isset($array['path'])) { $action = substr($array['path'],1); if(!isset($array['host'])) { $module = MODULE_NAME; }else{ if(strpos($array['host'],'-')) { list($group,$module) = explode('-',$array['host']); }else{ $module = $array['host']; } } }else{ $module = MODULE_NAME; $action = $array['host']; } if(isset($array['query'])) { parse_str($array['query'],$query); $params = array_merge($query,$params); } if(C('URL_DISPATCH_ON') && C('URL_MODEL')>0) { $depr = C('URL_PATHINFO_MODEL')==2?C('URL_PATHINFO_DEPR'):'\/'; $str = $depr; foreach ($params as $var=>$val) $str .= $var.$depr.$val.$depr; $str = substr($str,0,-1); $group = isset($group)?$group.$depr:''; if(!empty($route)) { $url = str_replace(APP_NAME,$app,__APP__).'\/'.$group.$route.$str; }else{ $url = str_replace(APP_NAME,$app,__APP__).'\/'.$group.$module.$depr.$action.$str; } if($suffix && C('URL_HTML_SUFFIX')) $url .= C('URL_HTML_SUFFIX'); }else{ $params = http_build_query($params); if(isset($group)) { $url = str_replace(APP_NAME,$app,__APP__).'?'.C('VAR_GROUP').'='.$group.'&'.C('VAR_MODULE').'='.$module.'&'.C('VAR_ACTION').'='.$action.'&'.$params; }else{ $url = str_replace(APP_NAME,$app,__APP__).'?'.C('VAR_MODULE').'='.$module.'&'.C('VAR_ACTION').'='.$action.'&'.$params; } } if($redirect) redirect($url); else return $url; } function parse_name($name,$type=0) { if($type) { return ucfirst(preg_replace(\"\/_([a-zA-Z])\/e\", \"strtoupper('\\\\1')\", $name)); }else{ $name = preg_replace(\"\/[A-Z]\/\", \"_\\\\0\", $name); return strtolower(trim($name, \"_\")); } } function halt($error) { if(IS_CLI) exit ($error); $e = array(); if(C('APP_DEBUG')){ if(!is_array($error)) { $trace = debug_backtrace(); $e['message'] = $error; $e['file'] = $trace[0]['file']; $e['class'] = $trace[0]['class']; $e['function'] = $trace[0]['function']; $e['line'] = $trace[0]['line']; $traceInfo=''; $time = date(\"y-m-d H:i:m\"); foreach($trace as $t) { $traceInfo .= '['.$time.'] '.$t['file'].' ('.$t['line'].') '; $traceInfo .= $t['class'].$t['type'].$t['function'].'('; $traceInfo .= implode(', ', $t['args']); $traceInfo .=\")\"; } $e['trace'] = $traceInfo; }else { $e = $error; } include C('TMPL_EXCEPTION_FILE'); } else { $error_page = C('ERROR_PAGE'); if(!empty($error_page)){ redirect($error_page); }else { if(C('SHOW_ERROR_MSG')) $e['message'] = is_array($error)?$error['message']:$error; else $e['message'] = C('ERROR_MESSAGE'); include C('TMPL_EXCEPTION_FILE'); } } exit; } function redirect($url,$time=0,$msg='') { $url = str_replace(array(\"\\n\", \"\\r\"), '', $url); if(empty($msg)) $msg = \"\u7cfb\u7edf\u5c06\u5728{$time}\u79d2\u4e4b\u540e\u81ea\u52a8\u8df3\u8f6c\u5230{$url}\uff01\"; if (!headers_sent()) { if(0===$time) { header(\"Location: \".$url); }else { header(\"refresh:{$time};url={$url}\"); echo($msg); } exit(); }else { $str = \"\"; if($time!=0) $str .= $msg; exit($str); } } function throw_exception($msg,$type='ThinkException',$code=0) { if(IS_CLI) exit($msg); if(class_exists($type,false)) throw new $type($msg,$code,true); else halt($msg); } function debug_start($label='') { $GLOBALS[$label]['_beginTime'] = microtime(TRUE); if ( MEMORY_LIMIT_ON ) $GLOBALS[$label]['_beginMem'] = memory_get_usage(); } function debug_end($label='') { $GLOBALS[$label]['_endTime'] = microtime(TRUE); echo '

Process '.$label.': Times '.number_format($GLOBALS[$label]['_endTime']-$GLOBALS[$label]['_beginTime'],6).'s '; if ( MEMORY_LIMIT_ON ) { $GLOBALS[$label]['_endMem'] = memory_get_usage(); echo ' Memories '.number_format(($GLOBALS[$label]['_endMem']-$GLOBALS[$label]['_beginMem'])\/1024).' k'; } echo '<\/div>'; } function dump($var, $echo=true,$label=null, $strict=true) { $label = ($label===null) ? '' : rtrim($label) . ' '; if(!$strict) { if (ini_get('html_errors')) { $output = print_r($var, true); $output = \"
\".$label.htmlspecialchars($output,ENT_QUOTES).\"<\/pre>\"; } else { $output = $label . \" : \" . print_r($var, true); } }else { ob_start(); var_dump($var); $output = ob_get_clean(); if(!extension_loaded('xdebug')) { $output = preg_replace(\"\/\\]\\=\\>\\n(\\s+)\/m\", \"] => \", $output); $output = '
'. $label. htmlspecialchars($output, ENT_QUOTES). '<\/pre>'; } } if ($echo) { echo($output); return null; }else return $output; } function get_instance_of($name,$method='',$args=array()) { static $_instance = array(); $identify = empty($args)?$name.$method:$name.$method.to_guid_string($args); if (!isset($_instance[$identify])) { if(class_exists($name)){ $o = new $name(); if(method_exists($o,$method)){ if(!empty($args)) { $_instance[$identify] = call_user_func_array(array(&$o, $method), $args); }else { $_instance[$identify] = $o->$method(); } } else $_instance[$identify] = $o; } else halt(L('_CLASS_NOT_EXIST_').':'.$name); } return $_instance[$identify]; } function _autoload($name) { if(alias_import($name)) return ; if(substr($name,-5)==\"Model\") { require_cache(LIB_PATH.'Model\/'.$name.'.class.php'); }elseif(substr($name,-6)==\"Action\"){ require_cache(LIB_PATH.'Action\/'.$name.'.class.php'); }else { if(C('APP_AUTOLOAD_PATH')) { $paths = explode(',',C('APP_AUTOLOAD_PATH')); foreach ($paths as $path){ if(import($path.$name)) { return ; } } } } return ; } function require_cache($filename) { static $_importFiles = array(); $filename = realpath($filename); if (!isset($_importFiles[$filename])) { if(file_exists_case($filename)){ require $filename; $_importFiles[$filename] = true; } else { $_importFiles[$filename] = false; } } return $_importFiles[$filename]; } function file_exists_case($filename) { if(is_file($filename)) { if(IS_WIN && C('APP_FILE_CASE')) { if(basename(realpath($filename)) != basename($filename)) return false; } return true; } return false; } function import($class,$baseUrl = '',$ext='.class.php') { static $_file = array(); static $_class = array(); $class = str_replace(array('.','#'), array('\/','.'), $class); if('' === $baseUrl && false === strpos($class,'\/')) { return alias_import($class); } if(isset($_file[$class.$baseUrl])) return true; else $_file[$class.$baseUrl] = true; $class_strut = explode(\"\/\",$class); if(empty($baseUrl)) { if('@'==$class_strut[0] || APP_NAME == $class_strut[0] ) { $baseUrl = dirname(LIB_PATH); $class = str_replace(array(APP_NAME.'\/','@\/'),LIB_DIR.'\/',$class); }elseif(in_array(strtolower($class_strut[0]),array('think','org','com'))) { $baseUrl = THINK_PATH.'\/Lib\/'; }else { $class = substr_replace($class, '', 0,strlen($class_strut[0])+1); $baseUrl = APP_PATH.'\/..\/'.$class_strut[0].'\/'.LIB_DIR.'\/'; } } if(substr($baseUrl, -1) != \"\/\") $baseUrl .= \"\/\"; $classfile = $baseUrl . $class . $ext; if($ext == '.class.php' && is_file($classfile)) { $class = basename($classfile,$ext); if(isset($_class[$class])) throw_exception(L('_CLASS_CONFLICT_').':'.$_class[$class].' '.$classfile); $_class[$class] = $classfile; } return require_cache($classfile); } function load($name,$baseUrl='',$ext='.php') { $name = str_replace(array('.','#'), array('\/','.'), $name); if(empty($baseUrl)) { if(0 === strpos($name,'@\/')) { $baseUrl = APP_PATH.'\/Common\/'; $name = substr($name,2); }else{ $baseUrl = THINK_PATH.'\/Common\/'; } } if(substr($baseUrl, -1) != \"\/\") $baseUrl .= \"\/\"; include $baseUrl . $name . $ext; } function vendor($class,$baseUrl = '',$ext='.php') { if(empty($baseUrl)) $baseUrl = VENDOR_PATH; return import($class,$baseUrl,$ext); } function alias_import($alias,$classfile='') { static $_alias = array(); if('' !== $classfile) { $_alias[$alias] = $classfile; return ; } if(is_string($alias)) { if(isset($_alias[$alias])) return require_cache($_alias[$alias]); }elseif(is_array($alias)){ foreach ($alias as $key=>$val) $_alias[$key] = $val; return ; } return false; } function D($name='',$app='') { static $_model = array(); if(empty($name)) return new Model; if(empty($app)) $app = C('DEFAULT_APP'); if(isset($_model[$app.$name])) return $_model[$app.$name]; $OriClassName = $name; if(strpos($name,C('APP_GROUP_DEPR'))) { $array = explode(C('APP_GROUP_DEPR'),$name); $name = array_pop($array); $className = $name.'Model'; import($app.'.Model.'.implode('.',$array).'.'.$className); }else{ $className = $name.'Model'; import($app.'.Model.'.$className); } if(class_exists($className)) { $model = new $className(); }else { $model = new Model($name); } $_model[$app.$OriClassName] = $model; return $model; } function M($name='',$class='Model') { static $_model = array(); if(!isset($_model[$name.'_'.$class])) $_model[$name.'_'.$class] = new $class($name); return $_model[$name.'_'.$class]; } function A($name,$app='@', $actionName='', $args=array()) { static $_action = array(); if(isset($_action[$app.$name])) return $_action[$app.$name]; $OriClassName = $name; if(strpos($name,C('APP_GROUP_DEPR'))) { $array = explode(C('APP_GROUP_DEPR'),$name); $name = array_pop($array); $className = $name.'Action'; import($app.'.Action.'.implode('.',$array).'.'.$className); }else{ $className = $name.'Action'; import($app.'.Action.'.$className); } if(class_exists($className)) { $action = new $className(); $_action[$app.$OriClassName] = $action; if('' != $actionName) { if(method_exists($action,$actionName)) { $action->$actionName($args); } else { throw_exception(L('_ERROR_ACTION_').':'.$actionName); } } else { return $action; } }else { return false; } } function R($module,$action,$app='@') { $class = A($module,$app); if($class) return call_user_func(array(&$class,$action)); else return false; } function L($name=null,$value=null) { static $_lang = array(); if(empty($name)) return $_lang; if (is_string($name) ) { $name = strtoupper($name); if (is_null($value)) return isset($_lang[$name]) ? $_lang[$name] : $name; $_lang[$name] = $value; return; } if (is_array($name)) $_lang = array_merge($_lang,array_change_key_case($name,CASE_UPPER)); return; } function C($name=null,$value=null) { static $_config = array(); if(empty($name)) return $_config; if (is_string($name)) { if (!strpos($name,'.')) { $name = strtolower($name); if (is_null($value)) return isset($_config[$name])? $_config[$name] : null; $_config[$name] = $value; return; } $name = explode('.',$name); $name[0] = strtolower($name[0]); if (is_null($value)) return isset($_config[$name[0]][$name[1]]) ? $_config[$name[0]][$name[1]] : null; $_config[$name[0]][$name[1]] = $value; return; } if(is_array($name)) return $_config = array_merge($_config,array_change_key_case($name)); return null; } function tag($name,$params=array()) { $tags = C('_tags_.'.$name); if($tags) { foreach ($tags as $key=>$call){ if(is_callable($call)) $result = call_user_func_array($call,$params); } return $result; } return false; } function B($name) { $class = $name.'Behavior'; require_cache(LIB_PATH.'Behavior\/'.$class.'.class.php'); $behavior = new $class(); $behavior->run(); } function W($name,$data=array(),$return=false) { $class = $name.'Widget'; require_cache(LIB_PATH.'Widget\/'.$class.'.class.php'); if(!class_exists($class)) throw_exception(L('_CLASS_NOT_EXIST_').':'.$class); $widget = Think::instance($class); $content = $widget->render($data); if($return) return $content; else echo $content; } function S($name,$value='',$expire='',$type='') { static $_cache = array(); alias_import('Cache'); $cache = Cache::getInstance($type); if('' !== $value) { if(is_null($value)) { $result = $cache->rm($name); if($result) unset($_cache[$type.'_'.$name]); return $result; }else{ $cache->set($name,$value,$expire); $_cache[$type.'_'.$name] = $value; } return ; } if(isset($_cache[$type.'_'.$name])) return $_cache[$type.'_'.$name]; $value = $cache->get($name); $_cache[$type.'_'.$name] = $value; return $value; } function F($name,$value='',$path=DATA_PATH) { static $_cache = array(); $filename = $path.$name.'.php'; if('' !== $value) { if(is_null($value)) { return unlink($filename); }else{ $dir = dirname($filename); if(!is_dir($dir)) mkdir($dir); $_cache[$name] = $value; return file_put_contents($filename,\"\"); } } if(isset($_cache[$name])) return $_cache[$name]; if(is_file($filename)) { $value = include $filename; $_cache[$name] = $value; }else{ $value = false; } return $value; } function to_guid_string($mix) { if(is_object($mix) && function_exists('spl_object_hash')) { return spl_object_hash($mix); }elseif(is_resource($mix)){ $mix = get_resource_type($mix).strval($mix); }else{ $mix = serialize($mix); } return md5($mix); } function compile($filename,$runtime=false) { $content = file_get_contents($filename); if(true === $runtime) $content = preg_replace('\/\\\/\\\/\\[RUNTIME\\](.*?)\\\/\\\/\\[\\\/RUNTIME\\]\/s','',$content); $content = substr(trim($content),5); if('?>' == substr($content,-2)) $content = substr($content,0,-2); return $content; } function strip_whitespace($content) { $stripStr = ''; $tokens = token_get_all ($content); $last_space = false; for ($i = 0, $j = count ($tokens); $i < $j; $i++) { if (is_string ($tokens[$i])) { $last_space = false; $stripStr .= $tokens[$i]; } else { switch ($tokens[$i][0]) { case T_COMMENT: case T_DOC_COMMENT: break; case T_WHITESPACE: if (!$last_space) { $stripStr .= ' '; $last_space = true; } break; default: $last_space = false; $stripStr .= $tokens[$i][1]; } } } return $stripStr; } function array_define($array) { $content = ''; foreach($array as $key=>$val) { $key = strtoupper($key); if(in_array($key,array('THINK_PATH','APP_NAME','APP_PATH','RUNTIME_PATH','RUNTIME_ALLINONE','THINK_MODE'))) $content .= 'if(!defined(\\''.$key.'\\')) '; if(is_int($val) || is_float($val)) { $content .= \"define('\".$key.\"',\".$val.\");\"; }elseif(is_bool($val)) { $val = ($val)?'true':'false'; $content .= \"define('\".$key.\"',\".$val.\");\"; }elseif(is_string($val)) { $content .= \"define('\".$key.\"','\".addslashes($val).\"');\"; } } return $content; } function mk_dir($dir, $mode = 0755) { if (is_dir($dir) || @mkdir($dir,$mode)) return true; if (!mk_dir(dirname($dir),$mode)) return false; return @mkdir($dir,$mode); } function auto_charset($fContents,$from,$to){ $from = strtoupper($from)=='UTF8'? 'utf-8':$from; $to = strtoupper($to)=='UTF8'? 'utf-8':$to; if( strtoupper($from) === strtoupper($to) || empty($fContents) || (is_scalar($fContents) && !is_string($fContents)) ){ return $fContents; } if(is_string($fContents) ) { if(function_exists('mb_convert_encoding')){ return mb_convert_encoding ($fContents, $to, $from); }elseif(function_exists('iconv')){ return iconv($from,$to,$fContents); }else{ return $fContents; } } elseif(is_array($fContents)){ foreach ( $fContents as $key => $val ) { $_key = auto_charset($key,$from,$to); $fContents[$_key] = auto_charset($val,$from,$to); if($key != $_key ) unset($fContents[$key]); } return $fContents; } else{ return $fContents; } } function xml_encode($data,$encoding='utf-8',$root=\"think\") { $xml = ''; $xml.= '<'.$root.'>'; $xml.= data_to_xml($data); $xml.= '<\/'.$root.'>'; return $xml; } function data_to_xml($data) { if(is_object($data)) { $data = get_object_vars($data); } $xml = ''; foreach($data as $key=>$val) { is_numeric($key) && $key=\"item id=\\\"$key\\\"\"; $xml.=\"<$key>\"; $xml.=(is_array($val)||is_object($val))?data_to_xml($val):$val; list($key,)=explode(' ',$key); $xml.=\"<\/$key>\"; } return $xml; } function cookie($name,$value='',$option=null) { $config = array( 'prefix' => C('COOKIE_PREFIX'), 'expire' => C('COOKIE_EXPIRE'), 'path' => C('COOKIE_PATH'), 'domain' => C('COOKIE_DOMAIN'), ); if (!empty($option)) { if (is_numeric($option)) $option = array('expire'=>$option); elseif( is_string($option) ) parse_str($option,$option); array_merge($config,array_change_key_case($option)); } if (is_null($name)) { if (empty($_COOKIE)) return; $prefix = empty($value)? $config['prefix'] : $value; if (!empty($prefix)) { foreach($_COOKIE as $key=>$val) { if (0 === stripos($key,$prefix)){ setcookie($_COOKIE[$key],'',time()-3600,$config['path'],$config['domain']); unset($_COOKIE[$key]); } } } return; } $name = $config['prefix'].$name; if (''===$value){ return isset($_COOKIE[$name]) ? $_COOKIE[$name] : null; }else { if (is_null($value)) { setcookie($name,'',time()-3600,$config['path'],$config['domain']); unset($_COOKIE[$name]); }else { $expire = !empty($config['expire'])? time()+ intval($config['expire']):0; setcookie($name,$value,$expire,$config['path'],$config['domain']); $_COOKIE[$name] = $value; } } } class Think { private static $_instance = array(); public function __set($name ,$value) { if(property_exists($this,$name)) $this->$name = $value; } public function __get($name) { return isset($this->$name)?$this->$name:null; } public static function autoload($classname) { if(alias_import($classname)) return ; if(substr($classname,-5)==\"Model\") { require_cache(LIB_PATH.'Model\/'.$classname.'.class.php'); }elseif(substr($classname,-6)==\"Action\"){ require_cache(LIB_PATH.'Action\/'.$classname.'.class.php'); }else { if(C('APP_AUTOLOAD_PATH')) { $paths = explode(',',C('APP_AUTOLOAD_PATH')); foreach ($paths as $path){ if(import($path.$classname)) return ; } } } return ; } static public function instance($class,$method='') { $identify = $class.$method; if(!isset(self::$_instance[$identify])) { if(class_exists($class)){ $o = new $class(); if(!empty($method) && method_exists($o,$method)) self::$_instance[$identify] = call_user_func_array(array(&$o, $method)); else self::$_instance[$identify] = $o; } else halt(L('_CLASS_NOT_EXIST_')); } return self::$_instance[$identify]; } } class ThinkException extends Exception { private $type; private $extra; public function __construct($message,$code=0,$extra=false) { parent::__construct($message,$code); $this->type = get_class($this); $this->extra = $extra; } public function __toString() { $trace = $this->getTrace(); if($this->extra) array_shift($trace); $this->class = $trace[0]['class']; $this->function = $trace[0]['function']; $this->file = $trace[0]['file']; $this->line = $trace[0]['line']; $file = file($this->file); $traceInfo=''; $time = date(\"y-m-d H:i:m\"); foreach($trace as $t) { $traceInfo .= '['.$time.'] '.$t['file'].' ('.$t['line'].') '; $traceInfo .= $t['class'].$t['type'].$t['function'].'('; if(!is_array($t['args'])){ $t['args'] = [$t['args']]; } $traceInfo .= implode(', ', $t['args']); $traceInfo .=\")\\n\"; } $error['message'] = $this->message; $error['type'] = $this->type; $error['detail'] = L('_MODULE_').'['.MODULE_NAME.'] '.L('_ACTION_').'['.ACTION_NAME.']'.\"\\n\"; $error['detail'] .= ($this->line-2).': '.$file[$this->line-3]; $error['detail'] .= ($this->line-1).': '.$file[$this->line-2]; $error['detail'] .= ''.($this->line).': '.$file[$this->line-1].'<\/b><\/font>'; $error['detail'] .= ($this->line+1).': '.$file[$this->line]; $error['detail'] .= ($this->line+2).': '.$file[$this->line+1]; $error['class'] = $this->class; $error['function'] = $this->function; $error['file'] = $this->file; $error['line'] = $this->line; $error['trace'] = $traceInfo; if(C('LOG_EXCEPTION_RECORD')) { Log::Write('('.$this->type.') '.$this->message); } return json_encode($error, JSON_PRETTY_PRINT); } } class Log extends Think { const EMERG = 'EMERG'; const ALERT = 'ALERT'; const CRIT = 'CRIT'; const ERR = 'ERR'; const WARN = 'WARN'; const NOTICE = 'NOTIC'; const INFO = 'INFO'; const DEBUG = 'DEBUG'; const SQL = 'SQL'; const SYSTEM = 0; const MAIL = 1; const TCP = 2; const FILE = 3; static $log = array(); static $format = '[ c ]'; static function record($message,$level=self::ERR,$record=false) { if($record || in_array($level,(array)C('LOG_RECORD_LEVEL'))) { $now = date(self::$format); self::$log[] = \"{$now} {$level}: {$message}\\r\\n\"; } } static function save($type=self::FILE,$destination='',$extra='') { if(empty($destination)) $destination = LOG_PATH.date('y_m_d').\".log\"; if(self::FILE == $type) { if(is_file($destination) && floor(C('LOG_FILE_SIZE')) <= filesize($destination) ) rename($destination,dirname($destination).'\/'.time().'-'.basename($destination)); } error_log(implode(\"\",self::$log), $type,$destination ,$extra); self::$log = array(); } static function write($message,$level=self::ERR,$type=self::FILE,$destination='',$extra='') { $now = date(self::$format); if(empty($destination)) $destination = LOG_PATH.date('y_m_d').\".log\"; if(self::FILE == $type) { if(is_file($destination) && floor(C('LOG_FILE_SIZE')) <= filesize($destination) ) rename($destination,dirname($destination).'\/'.time().'-'.basename($destination)); } error_log(\"{$now} {$level}: {$message}\\r\\n\", $type,$destination,$extra ); } } class App { static public function init() { set_error_handler(array('App','appError')); set_exception_handler(array('App','appException')); if(defined('RUNTIME_MODEL')){ }elseif(is_file(RUNTIME_PATH.'~app.php') && (!is_file(CONFIG_PATH.'config.php') || filemtime(RUNTIME_PATH.'~app.php')>filemtime(CONFIG_PATH.'config.php'))) { C(include RUNTIME_PATH.'~app.php'); }else{ App::build(); } if(C('APP_PLUGIN_ON')) tag('app_begin'); if(function_exists('date_default_timezone_set')) date_default_timezone_set(C('DEFAULT_TIMEZONE')); if(C('APP_AUTOLOAD_REG') && function_exists('spl_autoload_register')) spl_autoload_register(array('Think', 'autoload')); if(C('SESSION_AUTO_START')) session_start(); if(C('URL_DISPATCH_ON')) Dispatcher::dispatch(); if(!defined('PHP_FILE')) define('PHP_FILE',_PHP_FILE_); if(C('APP_GROUP_LIST')) { if(!defined('GROUP_NAME')) define('GROUP_NAME', App::getGroup()); if(is_file(CONFIG_PATH.GROUP_NAME.'\/config.php')) C(include CONFIG_PATH.GROUP_NAME.'\/config.php'); if(is_file(COMMON_PATH.GROUP_NAME.'\/function.php')) include COMMON_PATH.GROUP_NAME.'\/function.php'; } if(!defined('MODULE_NAME')) define('MODULE_NAME', App::getModule()); if(!defined('ACTION_NAME')) define('ACTION_NAME', App::getAction()); if(is_file(CONFIG_PATH.strtolower(MODULE_NAME).'_config.php')) C(include CONFIG_PATH.strtolower(MODULE_NAME).'_config.php'); App::checkLanguage(); App::checkTemplate(); if(C('HTML_CACHE_ON')) HtmlCache::readHTMLCache(); if(C('APP_PLUGIN_ON')) tag('app_init'); return ; } static private function build() { C(include THINK_PATH.'\/Common\/convention.php'); if(is_file(CONFIG_PATH.'config.php')) C(include CONFIG_PATH.'config.php'); $runtime = defined('RUNTIME_ALLINONE'); $common = ''; $debug = C('APP_DEBUG') && !$runtime; if(is_file(COMMON_PATH.'common.php')) { include COMMON_PATH.'common.php'; if(!$debug) $common .= compile(COMMON_PATH.'common.php',$runtime); } if(is_file(CONFIG_PATH.'app.php')) { $list = include CONFIG_PATH.'app.php'; foreach ($list as $file){ require $file; if(!$debug) $common .= compile($file,$runtime); } } $list = C('APP_CONFIG_LIST'); foreach ($list as $val){ if(is_file(CONFIG_PATH.$val.'.php')) C('_'.$val.'_',array_change_key_case(include CONFIG_PATH.$val.'.php')); } if($debug) { C(include THINK_PATH.'\/Common\/debug.php'); if(is_file(CONFIG_PATH.'debug.php')) C(include CONFIG_PATH.'debug.php'); }else{ if(defined('RUNTIME_ALLINONE')) { $defs = get_defined_constants(TRUE); $content = array_define($defs['user']); $content .= substr(file_get_contents(RUNTIME_PATH.'~runtime.php'),5); $content .= $common.\"\\nreturn \".var_export(C(),true).';'; file_put_contents(RUNTIME_PATH.'~allinone.php',strip_whitespace('\"; file_put_contents(RUNTIME_PATH.'~app.php',strip_whitespace($content)); } } return ; } static private function getModule() { $var = C('VAR_MODULE'); $module = !empty($_POST[$var]) ? $_POST[$var] : (!empty($_GET[$var])? $_GET[$var]:C('DEFAULT_MODULE')); if(C('URL_CASE_INSENSITIVE')) { define('P_MODULE_NAME',strtolower($module)); $module = ucfirst(parse_name(P_MODULE_NAME,1)); } unset($_POST[$var],$_GET[$var]); return $module; } static private function getAction() { $var = C('VAR_ACTION'); $action = !empty($_POST[$var]) ? $_POST[$var] : (!empty($_GET[$var])?$_GET[$var]:C('DEFAULT_ACTION')); unset($_POST[$var],$_GET[$var]); return $action; } static private function getGroup() { $var = C('VAR_GROUP'); $group = !empty($_POST[$var]) ? $_POST[$var] : (!empty($_GET[$var])?$_GET[$var]:C('DEFAULT_GROUP')); unset($_POST[$var],$_GET[$var]); return ucfirst(strtolower($group)); } static private function checkLanguage() { $langSet = C('DEFAULT_LANG'); if (!C('LANG_SWITCH_ON')){ L(include THINK_PATH.'\/Lang\/'.$langSet.'.php'); return; } if (C('LANG_AUTO_DETECT')){ if(isset($_GET[C('VAR_LANGUAGE')])){ $langSet = $_GET[C('VAR_LANGUAGE')]; cookie('think_language',$langSet,3600); }elseif(cookie('think_language')) $langSet = cookie('think_language'); elseif(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){ preg_match('\/^([a-z\\-]+)\/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches); $langSet = $matches[1]; cookie('think_language',$langSet,3600); } } define('LANG_SET',strtolower($langSet)); if(is_file(THINK_PATH.'\/Lang\/'.$langSet.'.php')) L(include THINK_PATH.'\/Lang\/'.$langSet.'.php'); if (is_file(LANG_PATH.$langSet.'\/common.php')) L(include LANG_PATH.$langSet.'\/common.php'); $group = ''; if (defined('GROUP_NAME')){ $group = GROUP_NAME.C('TMPL_FILE_DEPR'); if (is_file(LANG_PATH.$langSet.'\/'.$group.'lang.php')) L(include LANG_PATH.$langSet.'\/'.$group.'lang.php'); } if (is_file(LANG_PATH.$langSet.'\/'.$group.strtolower(MODULE_NAME).'.php')) L(include LANG_PATH.$langSet.'\/'.$group.strtolower(MODULE_NAME).'.php'); } static private function checkTemplate() { if(C('TMPL_DETECT_THEME')) { $t = C('VAR_TEMPLATE'); if (isset($_GET[$t])){ $templateSet = $_GET[$t]; cookie('think_template',$templateSet,3600); }else{ if(cookie('think_template')){ $templateSet = cookie('think_template'); }else{ $templateSet = C('DEFAULT_THEME'); cookie('think_template',$templateSet,3600); } } if(!is_dir(TMPL_PATH.$templateSet)) $templateSet = C('DEFAULT_THEME'); }else{ $templateSet = C('DEFAULT_THEME'); } define('TEMPLATE_NAME',$templateSet); define('TEMPLATE_PATH',TMPL_PATH.TEMPLATE_NAME); $tmplDir = TMPL_DIR.'\/'.TEMPLATE_NAME.'\/'; define('__APP__',PHP_FILE); define('__SELF__',$_SERVER['PHP_SELF']); if(C('APP_DOMAIN_DEPLOY')) { $appRoot = '\/'; }else{ $appRoot = __ROOT__.'\/'.APP_NAME.'\/'; } $depr = C('URL_PATHINFO_MODEL')==2?C('URL_PATHINFO_DEPR'):'\/'; $module = defined('P_MODULE_NAME')?P_MODULE_NAME:MODULE_NAME; if(defined('GROUP_NAME')) { $group = C('URL_CASE_INSENSITIVE') ?strtolower(GROUP_NAME):GROUP_NAME; define('__URL__',PHP_FILE.'\/'.((GROUP_NAME != C('DEFAULT_GROUP'))?$group.$depr:'').$module); C('TMPL_FILE_NAME',TEMPLATE_PATH.'\/'.GROUP_NAME.'\/'.MODULE_NAME.C('TMPL_FILE_DEPR').ACTION_NAME.C('TMPL_TEMPLATE_SUFFIX')); C('CACHE_PATH',CACHE_PATH.GROUP_NAME.'\/'); }else{ define('__URL__',PHP_FILE.'\/'.$module); C('TMPL_FILE_NAME',TEMPLATE_PATH.'\/'.str_replace(C('APP_GROUP_DEPR'),'\/',MODULE_NAME).'\/'.ACTION_NAME.C('TMPL_TEMPLATE_SUFFIX')); C('CACHE_PATH',CACHE_PATH); } define('__ACTION__',__URL__.C('URL_PATHINFO_DEPR').ACTION_NAME); define('__CURRENT__', __ROOT__.'\/'.APP_NAME.'\/'.$tmplDir.MODULE_NAME); define('APP_TMPL_PATH', $appRoot.$tmplDir); define('WEB_PUBLIC_PATH', __ROOT__.'\/Public'); define('APP_PUBLIC_PATH', APP_TMPL_PATH.'Public'); return ; } static public function exec() { $tagOn = C('APP_PLUGIN_ON'); if($tagOn) tag('app_run'); $group = defined('GROUP_NAME') ? GROUP_NAME.C('APP_GROUP_DEPR') : ''; $module = A($group.MODULE_NAME); if(!$module) { $_module = C('_modules_.'.MODULE_NAME); if($_module) { import($_module[0]); $class = isset($_module[1])?$_module[1]:MODULE_NAME.'Action'; $module = new $class; }else{ $module = A(\"Empty\"); } if(!$module) throw_exception(L('_MODULE_NOT_EXIST_').MODULE_NAME); } $action = ACTION_NAME; if(strpos($action,':')) { $actionList = explode(':',$action); foreach ($actionList as $action){ $module->$action(); } }else{ if (method_exists($module,'_before_'.$action)) { call_user_func(array(&$module,'_before_'.$action)); } call_user_func(array(&$module,$action)); if (method_exists($module,'_after_'.$action)) { call_user_func(array(&$module,'_after_'.$action)); } } if($tagOn) tag('app_end'); return ; } static public function run() { App::init(); if(C('SHOW_RUN_TIME')) $GLOBALS['_initTime'] = microtime(TRUE); App::exec(); if(C('LOG_RECORD')) Log::save(); return ; } static public function appException($e) { halt($e->__toString()); } static public function appError($errno, $errstr, $errfile, $errline) { switch ($errno) { case E_ERROR: case E_USER_ERROR: $errorStr = \"[$errno] $errstr \".basename($errfile).\" \u7b2c $errline \u884c.\"; if(C('LOG_RECORD')) Log::write($errorStr,Log::ERR); halt($errorStr); break; case E_STRICT: case E_USER_WARNING: case E_USER_NOTICE: default: $errorStr = \"[$errno] $errstr \".basename($errfile).\" \u7b2c $errline \u884c.\"; Log::record($errorStr,Log::NOTICE); break; } } }; abstract class Action extends Think { protected $view = null; private $name = ''; public function __construct() { $this->view = Think::instance('View'); if(method_exists($this,'_initialize')) $this->_initialize(); } protected function getActionName() { if(empty($this->name)) { $this->name = substr(get_class($this),0,-6); } return $this->name; } protected function isAjax() { if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) ) { if('xmlhttprequest' == strtolower($_SERVER['HTTP_X_REQUESTED_WITH'])) return true; } if(!empty($_POST[C('VAR_AJAX_SUBMIT')]) || !empty($_GET[C('VAR_AJAX_SUBMIT')])) return true; return false; } protected function display($templateFile='',$charset='',$contentType='text\/html') { $this->view->display($templateFile,$charset,$contentType); } protected function fetch($templateFile='',$charset='',$contentType='text\/html') { return $this->view->fetch($templateFile,$charset,$contentType); } protected function buildHtml($htmlfile='',$htmlpath='',$templateFile='',$charset='',$contentType='text\/html') { return $this->view->buildHtml($htmlfile,$htmlpath,$templateFile,$charset,$contentType); } protected function assign($name,$value='') { $this->view->assign($name,$value); } public function __set($name,$value) { $this->view->assign($name,$value); } protected function get($name) { return $this->view->get($name); } protected function trace($name,$value='') { $this->view->trace($name,$value); } public function __call($method,$parms) { if( 0 === strcasecmp($method,ACTION_NAME)) { $_action = C('_actions_'); if($_action) { if(isset($_action[MODULE_NAME.':'.ACTION_NAME])) { $action = $_action[MODULE_NAME.':'.ACTION_NAME]; }elseif(isset($_action[ACTION_NAME])){ $action = $_action[ACTION_NAME]; } if(!empty($action)) { call_user_func($action); return ; } } if(method_exists($this,'_empty')) { $this->_empty($method,$parms); }else { if(file_exists_case(C('TMPL_FILE_NAME'))) $this->display(); else throw_exception(L('_ERROR_ACTION_').ACTION_NAME); } }elseif(in_array(strtolower($method),array('ispost','isget','ishead','isdelete','isput'))){ return strtolower($_SERVER['REQUEST_METHOD']) == strtolower(substr($method,2)); }else{ throw_exception(__CLASS__.':'.$method.L('_METHOD_NOT_EXIST_')); } } protected function error($message,$ajax=false) { $this->_dispatch_jump($message,0,$ajax); } protected function success($message,$ajax=false) { $this->_dispatch_jump($message,1,$ajax); } protected function ajaxReturn($data,$info='',$status=1,$type='') { if(C('LOG_RECORD')) Log::save(); $result = array(); $result['status'] = $status; $result['info'] = $info; $result['data'] = $data; if(empty($type)) $type = C('DEFAULT_AJAX_RETURN'); if(strtoupper($type)=='JSON') { header(\"Content-Type:text\/html; charset=utf-8\"); exit(json_encode($result)); }elseif(strtoupper($type)=='XML'){ header(\"Content-Type:text\/xml; charset=utf-8\"); exit(xml_encode($result)); }elseif(strtoupper($type)=='EVAL'){ header(\"Content-Type:text\/html; charset=utf-8\"); exit($data); }else{ } } protected function redirect($url,$params=array(),$delay=0,$msg='') { if(C('LOG_RECORD')) Log::save(); $url = U($url,$params); redirect($url,$delay,$msg); } private function _dispatch_jump($message,$status=1,$ajax=false) { if($ajax || $this->isAjax()) $this->ajaxReturn('',$message,$status); $this->assign('msgTitle',$status? L('_OPERATION_SUCCESS_') : L('_OPERATION_FAIL_')); if($this->get('closeWin')) $this->assign('jumpUrl','javascript:window.close();'); $this->assign('status',$status); $this->assign('message',$message); C('HTML_CACHE_ON',false); if($status) { if(!$this->get('waitSecond')) $this->assign('waitSecond',\"1\"); if(!$this->get('jumpUrl')) $this->assign(\"jumpUrl\",$_SERVER[\"HTTP_REFERER\"]); $this->display(C('TMPL_ACTION_SUCCESS')); }else{ if(!$this->get('waitSecond')) $this->assign('waitSecond',\"3\"); if(!$this->get('jumpUrl')) $this->assign('jumpUrl',\"javascript:history.back(-1);\"); $this->display(C('TMPL_ACTION_ERROR')); } if(C('LOG_RECORD')) Log::save(); exit ; } } class View extends Think { protected $tVar = array(); protected $trace = array(); protected $templateFile = ''; public function assign($name,$value=''){ if(is_array($name)) { $this->tVar = array_merge($this->tVar,$name); }elseif(is_object($name)){ foreach($name as $key =>$val) $this->tVar[$key] = $val; }else { $this->tVar[$name] = $value; } } public function trace($title,$value='') { if(is_array($title)) $this->trace = array_merge($this->trace,$title); else $this->trace[$title] = $value; } public function get($name){ if(isset($this->tVar[$name])) return $this->tVar[$name]; else return false; } public function display($templateFile='',$charset='',$contentType='') { $this->fetch($templateFile,$charset,$contentType,true); } protected function layout($content,$charset='',$contentType='') { if(false !== strpos($content,'\/is',$content,$matches); if($find) { for ($i=0; $i< $find; $i++) { if(0===strpos($matches[1][$i],'$')) $matches[1][$i] = $this->get(substr($matches[1][$i],1)); if(0 != $matches[2][$i] ) { $guid = md5($matches[1][$i]); $cache = S($guid); if($cache) { $layoutContent = $cache; }else{ $layoutContent = $this->fetch($matches[1][$i],$charset,$contentType); S($guid,$layoutContent,$matches[2][$i]); } }else{ $layoutContent = $this->fetch($matches[1][$i],$charset,$contentType); } $content = str_replace($matches[0][$i],$layoutContent,$content); } } } return $content; } public function fetch($templateFile='',$charset='',$contentType='',$display=false) { $GLOBALS['_viewStartTime'] = microtime(TRUE); if(null===$templateFile) return ; if(empty($charset)) $charset = C('DEFAULT_CHARSET'); $contentType = $contentType?$contentType:C('TMPL_CONTENT_TYPE'); header(\"Content-Type:\".$contentType.\"; charset=\".$charset); header(\"Cache-control: private\"); ob_start(); ob_implicit_flush(0); if(!file_exists_case($templateFile)) $templateFile = $this->parseTemplateFile($templateFile); $engine = strtolower(C('TMPL_ENGINE_TYPE')); if('php'==$engine) { extract($this->tVar, EXTR_OVERWRITE); include $templateFile; }elseif('think'==$engine && $this->checkCache($templateFile)) { extract($this->tVar, EXTR_OVERWRITE); include C('CACHE_PATH').md5($templateFile).C('TMPL_CACHFILE_SUFFIX'); }else{ $className = 'Template'.ucwords($engine); require_cache(THINK_PATH.'\/Lib\/Think\/Util\/Template\/'.$className.'.class.php'); $tpl = new $className; $tpl->fetch($templateFile,$this->tVar,$charset); } $this->templateFile = $templateFile; $content = ob_get_clean(); $content = $this->templateContentReplace($content); $content = $this->layout($content,$charset,$contentType); return $this->output($content,$display); } protected function checkCache($tmplTemplateFile) { if (!C('TMPL_CACHE_ON')) return false; $tmplCacheFile = C('CACHE_PATH').md5($tmplTemplateFile).C('TMPL_CACHFILE_SUFFIX'); if(!is_file($tmplCacheFile)){ return false; }elseif (filemtime($tmplTemplateFile) > filemtime($tmplCacheFile)) { return false; }elseif (C('TMPL_CACHE_TIME') != -1 && time() > filemtime($tmplCacheFile)+C('TMPL_CACHE_TIME')) { return false; } return true; } public function buildHtml($htmlfile,$htmlpath='',$templateFile='',$charset='',$contentType='') { $content = $this->fetch($templateFile,$charset,$contentType); $htmlpath = !empty($htmlpath)?$htmlpath:HTML_PATH; $htmlfile = $htmlpath.$htmlfile.C('HTML_FILE_SUFFIX'); if(!is_dir(dirname($htmlfile))) mk_dir(dirname($htmlfile)); if(false === file_put_contents($htmlfile,$content)) throw_exception(L('_CACHE_WRITE_ERROR_')); return $content; } protected function output($content,$display) { if(C('HTML_CACHE_ON')) HtmlCache::writeHTMLCache($content); if($display) { if(C('SHOW_RUN_TIME')){ $runtime = '
'.$this->showTime().'<\/div>'; if(strpos($content,'{__RUNTIME__}')) $content = str_replace('{__RUNTIME__}',$runtime,$content); else $content .= $runtime; } echo $content; if(C('SHOW_PAGE_TRACE')) $this->showTrace(); return null; }else { return $content; } } protected function templateContentReplace($content) { $replace = array( '..\/Public' => APP_PUBLIC_PATH, '__PUBLIC__' => WEB_PUBLIC_PATH, '__TMPL__' => APP_TMPL_PATH, '__ROOT__' => __ROOT__, '__APP__' => __APP__, '__URL__' => __URL__, '__ACTION__' => __ACTION__, '__SELF__' => __SELF__, ); if(C('TOKEN_ON')) { if(strpos($content,'{__TOKEN__}')) { $replace['{__TOKEN__}'] = $this->buildFormToken(); }elseif(strpos($content,'{__NOTOKEN__}')){ $replace['{__NOTOKEN__}'] = ''; }elseif(preg_match('\/<\\\/form(\\s*)>\/is',$content,$match)) { $replace[$match[0]] = $this->buildFormToken().$match[0]; } } if(is_array(C('TMPL_PARSE_STRING')) ) $replace = array_merge($replace,C('TMPL_PARSE_STRING')); $content = str_replace(array_keys($replace),array_values($replace),$content); return $content; } private function buildFormToken() { $tokenName = C('TOKEN_NAME'); $tokenType = C('TOKEN_TYPE'); $tokenValue = $tokenType(microtime(TRUE)); $token = ''; $_SESSION[$tokenName] = $tokenValue; return $token; } private function parseTemplateFile($templateFile) { if(''==$templateFile) { $templateFile = C('TMPL_FILE_NAME'); }elseif(strpos($templateFile,'@')){ $templateFile = TMPL_PATH.str_replace(array('@',':'),'\/',$templateFile).C('TMPL_TEMPLATE_SUFFIX'); }elseif(strpos($templateFile,':')){ $templateFile = TEMPLATE_PATH.'\/'.str_replace(':','\/',$templateFile).C('TMPL_TEMPLATE_SUFFIX'); }elseif(!is_file($templateFile)) { $templateFile = dirname(C('TMPL_FILE_NAME')).'\/'.$templateFile.C('TMPL_TEMPLATE_SUFFIX'); } if(!file_exists_case($templateFile)) throw_exception(L('_TEMPLATE_NOT_EXIST_').'['.$templateFile.']'); return $templateFile; } private function showTime() { $startTime = $GLOBALS['_viewStartTime']; $endTime = microtime(TRUE); $total_run_time = number_format(($endTime - $GLOBALS['_beginTime']), 3); $showTime = 'Process: '.$total_run_time.'s '; if(C('SHOW_ADV_TIME')) { $_load_time = number_format(($GLOBALS['_loadTime'] -$GLOBALS['_beginTime'] ), 3); $_init_time = number_format(($GLOBALS['_initTime'] -$GLOBALS['_loadTime'] ), 3); $_exec_time = number_format(($startTime -$GLOBALS['_initTime'] ), 3); $_parse_time = number_format(($endTime - $startTime), 3); $showTime .= '( Load:'.$_load_time.'s Init:'.$_init_time.'s Exec:'.$_exec_time.'s Template:'.$_parse_time.'s )'; } if(C('SHOW_DB_TIMES') && class_exists('Db',false) ) { $db = Db::getInstance(); $showTime .= ' | DB :'.$db->Q().' queries '.$db->W().' writes '; } if(C('SHOW_CACHE_TIMES') && class_exists('Cache',false)) { $cache = Cache::getInstance(); $showTime .= ' | Cache :'.$cache->Q().' gets '.$cache->W().' writes '; } if(MEMORY_LIMIT_ON && C('SHOW_USE_MEM')) { $startMem = array_sum(explode(' ', $GLOBALS['_startUseMems'])); $endMem = array_sum(explode(' ', memory_get_usage())); $showTime .= ' | UseMem:'. number_format(($endMem - $startMem)\/1024).' kb'; } return $showTime; } private function showTrace(){ $traceFile = CONFIG_PATH.'trace.php'; $_trace = is_file($traceFile)? include $traceFile : array(); $this->trace('\u5f53\u524d\u9875\u9762', $_SERVER['REQUEST_URI']); $this->trace('\u6a21\u677f\u7f13\u5b58', C('CACHE_PATH').md5($this->templateFile).C('TMPL_CACHFILE_SUFFIX')); $this->trace('\u8bf7\u6c42\u65b9\u6cd5', $_SERVER['REQUEST_METHOD']); $this->trace('\u901a\u4fe1\u534f\u8bae', $_SERVER['SERVER_PROTOCOL']); $this->trace('\u8bf7\u6c42\u65f6\u95f4', date('Y-m-d H:i:s',$_SERVER['REQUEST_TIME'])); $this->trace('\u7528\u6237\u4ee3\u7406', $_SERVER['HTTP_USER_AGENT']); $this->trace('\u4f1a\u8bddID' , session_id()); $log = Log::$log; $this->trace('\u65e5\u5fd7\u8bb0\u5f55',count($log)?count($log).'\u6761\u65e5\u5fd7'.implode('',$log):'\u65e0\u65e5\u5fd7\u8bb0\u5f55'); $files = get_included_files(); $this->trace('\u52a0\u8f7d\u6587\u4ef6', count($files).str_replace(\"\\n\",'',substr(substr(print_r($files,true),7),0,-2))); $_trace = array_merge($_trace,$this->trace); include C('TMPL_TRACE_FILE'); } } alias_import(array( 'Model' => THINK_PATH.'\/Lib\/Think\/Core\/Model.class.php', 'Dispatcher' => THINK_PATH.'\/Lib\/Think\/Util\/Dispatcher.class.php', 'HtmlCache' => THINK_PATH.'\/Lib\/Think\/Util\/HtmlCache.class.php', 'Db' => THINK_PATH.'\/Lib\/Think\/Db\/Db.class.php', 'ThinkTemplate' => THINK_PATH.'\/Lib\/Think\/Template\/ThinkTemplate.class.php', 'Template' => THINK_PATH.'\/Lib\/Think\/Util\/Template.class.php', 'TagLib' => THINK_PATH.'\/Lib\/Think\/Template\/TagLib.class.php', 'Cache' => THINK_PATH.'\/Lib\/Think\/Util\/Cache.class.php', 'Debug' => THINK_PATH.'\/Lib\/Think\/Util\/Debug.class.php', 'Session' => THINK_PATH.'\/Lib\/Think\/Util\/Session.class.php', 'TagLibCx' => THINK_PATH.'\/Lib\/Think\/Template\/TagLib\/TagLibCx.class.php', 'ViewModel' => THINK_PATH.'\/Lib\/Think\/Core\/Model\/ViewModel.class.php', 'AdvModel' => THINK_PATH.'\/Lib\/Think\/Core\/Model\/AdvModel.class.php', 'RelationModel' => THINK_PATH.'\/Lib\/Think\/Core\/Model\/RelationModel.class.php', ) ); <\/b><\/font>3: 4: ", "class": "Action", "function": "__call", "file": "\/home2\/srichdur\/ebiochem.com\/Home\/Runtime\/~runtime.php", "line": 2, "trace": "[25-04-24 12:40:04] \/home2\/srichdur\/ebiochem.com\/Home\/Runtime\/~runtime.php (2) Action->__call(p, Array)\n[25-04-24 12:40:04] \/home2\/srichdur\/ebiochem.com\/Home\/Runtime\/~runtime.php (2) App::exec()\n[25-04-24 12:40:04] \/home2\/srichdur\/ebiochem.com\/index.php (25) App::run()\n" }

ThinkPHP 2.0 { Fast & Simple OOP PHP Framework } -- [ WE CAN DO IT JUST THINK IT ]