EEEMd Y]fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP،3PEdEEMPEPhtUE Ph`UhX:EPEEEMd Y]fUjh dP،3PEdE EMPhy:EPEEEMd Y]fUjh dP،3PEdEEMPE Ph`UhF:EPdEEEMd Y] fUjh dP،3PEdEEMPE PhUhN:EPEEEMd Y] fUjh dP،3PEdEEMPEPhUE PhTUh/:EPEEEMd Y]fUjh dP،3PEdEEMPEPhUE PhTUh.:EP{EEEMd Y]fUjh dP،3PEdE EMPh:EP=EEEMd Y]fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP،3PEdE EMPh:EP]EEEMd Y]fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP،3PEdE EMPh:EP}EEEMd Y]fUjh dP،3PEdE EMPh:EP EEEMd Y]fUjh dP،3PEdE EMPh!:EPEEEMd Y]fUjh dP،3PEdE EMPh :EP-EEEMd Y]fUjh dP V،3PEdEuFETFc:EjwEEt vKjt5u h`U@uhU1uhU"ujEj6eEXEEƋMd Y^]fUjh dP،3PEdEEMPE Ph`Uhd:EPEEEMd Y] fUjh dP،3PEdEEMPEPhUE PhUh:EP EEEMd Y]fUjh dP،3PEdEEMPEPhUEPhUE PhUhH:EPbEEEMd Y]fUjh dP،3PEdEEMPE Ph Uh<:EPEEEMd Y] fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP،3PEdE EMPh:EPmEEEMd Y]fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP،3PEdEEMPE Ph8Uh:EPDEEEMd Y] fUjh dP،3PEdEEMPE PhUh):EPEEEMd Y] fUjh dP،3PEdE EMPh_:EPEEEMd Y]fUjh dP،3PEdEEMPEPhUEPhUE PhUh:EP"EEEMd Y]fUjh dP،3PEdEEMPEPhUEPhUE PhUh:EPEEEMd Y]fUjh dP،3PEdEEMPE PhUh:EPEEEMd Y] fUjh dP،3PEdEEPMEPhUEPhUEPhUE Ph<Uh:EPEEEMd Y]fUjh dP،3PEdE EMPh::EP}EEEMd Y]fUjh dP،3PEdEEMPEPhtUE Ph`Uh8:EPEEEMd Y]fUjh dP،3PEdEEMPEPhtUE Ph`Uh9:EPEEEMd Y]fUjh dP،3PEdE EMPh]:EP EEEMd Y]fUjh dP،3PEdEEMPE PhUhu:EPEEEMd Y] fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP V،3PEdEuFETF:EjgZEEt vKjst5u h8UuhTUuh@UuZjEjYEXEEƋMd Y^]fUjh dP،3PEdEEMPE PhUh EPEEEMd Y] fUjh dP،3PEdEEMPE PhUh3:EPTEEEMd Y] fUjh dP،3PEdEEMPEPhUE PhUh{ EPKEEEMd Y]fUjh dP،3PEdEEMPEPh8UE PhUh:EPEEEMd Y]fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP،3PEdE EMPhZ:EP=EEEMd Y]fUjh dP،3PEdE EMPh\:EPEEEMd Y]fUjh dP،3PEdEEMPE PhUh:EPEEEMd Y] fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP،3PEdE EMPh:EPmEEEMd Y]fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP،3PEdEEMPE PhUh-:EPEEEMd Y] fUjh dP،3PEdE EMPh:EP EEEMd Y]fUjh dP،3PEdE EMPh:EP蝿EEEMd Y]fUjh dP،3PEdE EMPhR:EP-EEEMd Y]fUjh dP،3PEdE EMPh:EP轾EEEMd Y]fUjh dP،3PEdEEMPE PhUhf:EPtEEEMd Y] fUjh dP،3PEdEEMPE Ph`UhV:EPEEEMd Y] fUjh dP،3PEdE EMPh:EPMEEEMd Y]fUjh dP،3PEdE EMPh:EPݼEEEMd Y]fUjh dP،3PEdE EMPh:EPmEEEMd Y]fUjh dP،3PEdEEMPEPhUE PhUh:EPEEEMd Y]fUjh dP،3PEdEEMPE PhUh:EPEEEMd Y] fUjh dP،3PEdEEMPE PhUh`:EP$EEEMd Y] fUjh dP V،3PEdEuFETF:Ej7NEEt vη?jCt)uu hU]uhU農u6j]EjMEXEEƋMd Y^]fUjh dP،3PEdEEMPE PhTUh:EP褾EEEMd Y] fUjh dP،3PEdEEMPE PhUh0:EP$EEEMd Y] fUjh dP،3PEdE EMPh::EP}EEEMd Y]fUjh dP،3PEdE EMPh:EP EEEMd Y]fUjh dP،3PEdEEMPE PhUhK:EPļEEEMd Y] fUjh dP،3PEdEEMPE Ph,Uh$:EPDEEEMd Y] fUjh dP،3PEdEEMPEPhUE PhUh:EP;EEEMd Y]fUjh dP V،3PEdEuFETFg:EjIEEt vnijtSu h<Upuh UauhURuhUCuhU4u 謱jӯEjHIEXEEƋMd Y^]fUjh dP V،3PEdEuFETFi:EjHEEt vNMjít7E PEPhUEPhUEPh UEPh<Uu hUXjϮEjDHEXEEƋMd Y^]fUjh dP V،3PEdEuFETFj:EjGEEt vNMjìt7E PEPhUEPhUEPh UEPh<Uu hTUXjϭEjDGEXEEƋMd Y^]fUjh dP،3PEdEEMPE Ph`Uhk:EP$EEEMd Y] fUjh dP،3PEdE EMPh:EP}EEEMd Y]fUjh dP،3PEdE EMPh :EP EEEMd Y]fUjh dP،3PEdE EMPh :EP蝱EEEMd Y]fUjh dP،3PEdEEMPE Ph`Uh :EPTEEEMd Y] fUjh dP،3PEdEEMPE PhUh:EPԵEEEMd Y] fUjh dP V،3PEdEuFETF:EjCEEt v~-jtu h` U萞ujEjCEXEEƋMd Y^] fUjh dP،3PEdEEMPEPhUE PhUh:EPEEEMd Y]fUjh dP،3PEdE EMPh:EPͮEEEMd Y]fUjh dP،3PEdE EMPh1:EP]EEEMd Y]fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP،3PEdEEMPE Ph`Uh>:EP褲EEEMd Y] fUjh dP،3PEdE EMPhQ:EPEEEMd Y]fUjh dP،3PEdE EMPh:EP荬EEEMd Y]fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP،3PEdE EMPhl:EP譫EEEMd Y]fUjh dP،3PEdE EMPhz:EP=EEEMd Y]fUjh dP V،3PEdEuFETFi:Ej>EEt vEXEEƋMd Y^]fUjh dP،3PEdEEMPE Ph Uhh:EPEEEMd Y] fUjh dP،3PEdEEMPE Ph Uhg:EP脮EEEMd Y] fUjh dP،3PEdEEMPE Ph Uhe:EPEEEMd Y] fUjh dP،3PEdEEMPE Ph Uhf:EP脭EEEMd Y] fUjh dP،3PEdEEMPE PhtUhQ:EPDEEEMd Y]fUjh dP،3PEdE EMPhR:EP]EEEMd Y]fUjh dP،3PEdE EMPh:EPEEEMd Y]fUjh dP،3PEdE EMPh:EP}EEEMd Y]fUjh dP،3PEdE EMPh:EP EEEMd Y]fUjh dP،3PEdE EMPh:EP蝥EEEMd Y]fUjh dP،3PEdEEMPE Ph8Uh:EPTEEEMd Y] fUjh dP،3PEdE EMPh:EP譤EEEMd Y]fUjh dP،3PEdE EMPh:EP=EEEMd Y]fUjh dP،3PEdE EMPh:EPͣEEEMd Y]fUjh dP،3PEdEEMPE PhUh:EP脨EEEMd Y] fUjh dP،3PEdEEMPE PhUh:EPEEEMd Y] fUjh dP،3PEdEEMPE PhUhd:EP脧EEEMd Y] fUjh dP،3PEdEEMPE PhUh:EPEEEMd Y] fUjh dP،3PEdE EMPh:EP]EEEMd Y]fUjh dP،3PEdE EMPh :EPEEEMd Y]fUjh dP،3PEdEEMPE Ph Uh:EP褥EEEMd Y] fUjh dP،3PEdE EMPhQ:EPEEEMd Y]fUjh dP،3PEdE EMPhO:EP荟EEEMd Y]fUjh dP،3PEdE EMPhP:EPEEute($name = '', $default = null, $filter = '') { if (is_array($name)) { $this->param = []; $this->mergeParam = false; return $this->route = array_merge($this->route, $name); } return $this->input($this->route, $name, $default, $filter); } /** * 设置获取GET参数 * @access public * @param string|array $name 变量名 * @param mixed $default 默认值 * @param string|array $filter 过滤方法 * @return mixed */ public function get($name = '', $default = null, $filter = '') { if (empty($this->get)) { $this->get = $_GET; } if (is_array($name)) { $this->param = []; $this->mergeParam = false; return $this->get = array_merge($this->get, $name); } return $this->input($this->get, $name, $default, $filter); } /** * 设置获取POST参数 * @access public * @param string $name 变量名 * @param mixed $default 默认值 * @param string|array $filter 过滤方法 * @return mixed */ public function post($name = '', $default = null, $filter = '') { if (empty($this->post)) { $content = $this->input; if (empty($_POST) && false !== strpos($this->contentType(), 'application/json')) { $this->post = (array) json_decode($content, true); } else { $this->post = $_POST; } } if (is_array($name)) { $this->param = []; $this->mergeParam = false; return $this->post = array_merge($this->post, $name); } return $this->input($this->post, $name, $default, $filter); } /** * 设置获取PUT参数 * @access public * @param string|array $name 变量名 * @param mixed $default 默认值 * @param string|array $filter 过滤方法 * @return mixed */ public function put($name = '', $default = null, $filter = '') { if (is_null($this->put)) { $content = $this->input; if (false !== strpos($this->contentType(), 'application/json')) { $this->put = (array) json_decode($content, true); } else { parse_str($content, $this->put); } } if (is_array($name)) { $this->param = []; $this->mergeParam = false; return $this->put = is_null($this->put) ? $name : array_merge($this->put, $name); } return $this->input($this->put, $name, $default, $filter); } /** * 设置获取DELETE参数 * @access public * @param string|array $name 变量名 * @param mixed $default 默认值 * @param string|array $filter 过滤方法 * @return mixed */ public function delete($name = '', $default = null, $filter = '') { return $this->put($name, $default, $filter); } /** * 设置获取PATCH参数 * @access public * @param string|array $name 变量名 * @param mixed $default 默认值 * @param string|array $filter 过滤方法 * @return mixed */ public function patch($name = '', $default = null, $filter = '') { return $this->put($name, $default, $filter); } /** * 获取request变量 * @param string $name 数据名称 * @param string $default 默认值 * @param string|array $filter 过滤方法 * @return mixed */ public function request($name = '', $default = null, $filter = '') { if (empty($this->request)) { $this->request = $_REQUEST; } if (is_array($name)) { $this->param = []; $this->mergeParam = false; return $this->request = array_merge($this->request, $name); } return $this->input($this->request, $name, $default, $filter); } /** * 获取session数据 * @access public * @param string|array $name 数据名称 * @param string $default 默认值 * @param string|array $filter 过滤方法 * @return mixed */ public function session($name = '', $default = null, $filter = '') { if (empty($this->session)) { $this->session = Session::get(); } if (is_array($name)) { return $this->session = array_merge($this->session, $name); } return $this->input($this->session, $name, $default, $filter); } /** * 获取cookie参数 * @access public * @param string|array $name 数据名称 * @param string $default 默认值 * @param string|array $filter 过滤方法 * @return mixed */ public function cookie($name = '', $default = null, $filter = '') { if (empty($this->cookie)) { $this->cookie = Cookie::get(); } if (is_array($name)) { return $this->cookie = array_merge($this->cookie, $name); } elseif (!empty($name)) { $data = Cookie::has($name) ? Cookie::get($name) : $default; } else { $data = $this->cookie; } // 解析过滤器 $filter = $this->getFilter($filter, $default); if (is_array($data)) { array_walk_recursive($data, [$this, 'filterValue'], $filter); reset($data); } else { $this->filterValue($data, $name, $filter); } return $data; } /** * 获取server参数 * @access public * @param string|array $name 数据名称 * @param string $default 默认值 * @param string|array $filter 过滤方法 * @return mixed */ public function server($name = '', $default = null, $filter = '') { if (empty($this->server)) { $this->server = $_SERVER; } if (is_array($name)) { return $this->server = array_merge($this->server, $name); } return $this->input($this->server, false === $name ? false : strtoupper($name), $default, $filter); } /** * 获取上传的文件信息 * @access public * @param string|array $name 名称 * @return null|array|\think\File */ public function file($name = '') { if (empty($this->file)) { $this->file = isset($_FILES) ? $_FILES : []; } if (is_array($name)) { return $this->file = array_merge($this->file, $name); } $files = $this->file; if (!empty($files)) { // 处理上传文件 $array = []; foreach ($files as $key => $file) { if (is_array($file['name'])) { $item = []; $keys = array_keys($file); $count = count($file['name']); for ($i = 0; $i < $count; $i++) { if (empty($file['tmp_name'][$i]) || !is_file($file['tmp_name'][$i])) { continue; } $temp['key'] = $key; foreach ($keys as $_key) { $temp[$_key] = $file[$_key][$i]; } $item[] = (new File($temp['tmp_name']))->setUploadInfo($temp); } $array[$key] = $item; } else { if ($file instanceof File) { $array[$key] = $file; } else { if (empty($file['tmp_name']) || !is_file($file['tmp_name'])) { continue; } $array[$key] = (new File($file['tmp_name']))->setUploadInfo($file); } } } if (strpos($name, '.')) { list($name, $sub) = explode('.', $name); } if ('' === $name) { // 获取全部文件 return $array; } elseif (isset($sub) && isset($array[$name][$sub])) { return $array[$name][$sub]; } elseif (isset($array[$name])) { return $array[$name]; } } return; } /** * 获取环境变量 * @param string|array $name 数据名称 * @param string $default 默认值 * @param string|array $filter 过滤方法 * @return mixed */ public function env($name = '', $default = null, $filter = '') { if (empty($this->env)) { $this->env = $_ENV; } if (is_array($name)) { return $this->env = array_merge($this->env, $name); } return $this->input($this->env, false === $name ? false : strtoupper($name), $default, $filter); } /** * 设置或者获取当前的Header * @access public * @param string|array $name header名称 * @param string $default 默认值 * @return string */ public function header($name = '', $default = null) { if (empty($this->header)) { $header = []; if (function_exists('apache_request_headers') && $result = apache_request_headers()) { $header = $result; } else { $server = $this->server ?: $_SERVER; foreach ($server as $key => $val) { if (0 === strpos($key, 'HTTP_')) { $key = str_replace('_', '-', strtolower(substr($key, 5))); $header[$key] = $val; } } if (isset($server['CONTENT_TYPE'])) { $header['content-type'] = $server['CONTENT_TYPE']; } if (isset($server['CONTENT_LENGTH'])) { $header['content-length'] = $server['CONTENT_LENGTH']; } } $this->header = array_change_key_case($header); } if (is_array($name)) { return $this->header = array_merge($this->header, $name); } if ('' === $name) { return $this->header; } $name = str_replace('_', '-', strtolower($name)); return isset($this->header[$name]) ? $this->header[$name] : $default; } /** * 获取变量 支持过滤和默认值 * @param array $data 数据源 * @param string|false $name 字段名 * @param mixed $default 默认值 * @param string|array $filter 过滤函数 * @return mixed */ public function input($data = [], $name = '', $default = null, $filter = '') { if (false === $name) { // 获取原始数据 return $data; } $name = (string) $name; if ('' != $name) { // 解析name if (strpos($name, '/')) { list($name, $type) = explode('/', $name); } else { $type = 's'; } // 按.拆分成多维数组进行判断 foreach (explode('.', $name) as $val) { if (isset($data[$val])) { $data = $data[$val]; } else { // 无输入数据,返回默认值 return $default; } } if (is_object($data)) { return $data; } } // 解析过滤器 $filter = $this->getFilter($filter, $default); if (is_array($data)) { array_walk_recursive($data, [$this, 'filterValue'], $filter); reset($data); } else { $this->filterValue($data, $name, $filter); } if (isset($type) && $data !== $default) { // 强制类型转换 $this->typeCast($data, $type); } return $data; } /** * 设置或获取当前的过滤规则 * @param mixed $filter 过滤规则 * @return mixed */ public function filter($filter = null) { if (is_null($filter)) { return $this->filter; } else { $this->filter = $filter; } } protected function getFilter($filter, $default) { if (is_null($filter)) { $filter = []; } else { $filter = $filter ?: $this->filter; if (is_string($filter) && false === strpos($filter, '/')) { $filter = explode(',', $filter); } else { $filter = (array) $filter; } } $filter[] = $default; return $filter; } /** * 递归过滤给定的值 * @param mixed $value 键值 * @param mixed $key 键名 * @param array $filters 过滤方法+默认值 * @return mixed */ private function filterValue(&$value, $key, $filters) { $default = array_pop($filters); foreach ($filters as $filter) { if (is_callable($filter)) { // 调用函数或者方法过滤 $value = call_user_func($filter, $value); } elseif (is_scalar($value)) { if (false !== strpos($filter, '/')) { // 正则过滤 if (!preg_match($filter, $value)) { // 匹配不成功返回默认值 $value = $default; break; } } elseif (!empty($filter)) { // filter函数不存在时, 则使用filter_var进行过滤 // filter为非整形值时, 调用filter_id取得过滤id $value = filter_var($value, is_int($filter) ? $filter : filter_id($filter)); if (false === $value) { $value = $default; break; } } } } return $this->filterExp($value); } /** * 过滤表单中的表达式 * @param string $value * @return void */ public function filterExp(&$value) { // 过滤查询特殊字符 if (is_string($value) && preg_match('/^(EXP|NEQ|GT|EGT|LT|ELT|OR|XOR|LIKE|NOTLIKE|NOT LIKE|NOT BETWEEN|NOTBETWEEN|BETWEEN|NOT EXISTS|NOTEXISTS|EXISTS|NOT NULL|NOTNULL|NULL|BETWEEN TIME|NOT BETWEEN TIME|NOTBETWEEN TIME|NOTIN|NOT IN|IN)$/i', $value)) { $value .= ' '; } // TODO 其他安全过滤 } /** * 强制类型转换 * @param string $data * @param string $type * @return mixed */ private function typeCast(&$data, $type) { switch (strtolower($type)) { // 数组 case 'a': $data = (array) $data; break; // 数字 case 'd': $data = (int) $data; break; // 浮点 case 'f': $data = (float) $data; break; // 布尔 case 'b': $data = (boolean) $data; break; // 字符串 case 's': default: if (is_scalar($data)) { $data = (string) $data; } else { throw new \InvalidArgumentException('variable type error:' . gettype($data)); } } } /** * 是否存在某个请求参数 * @access public * @param string $name 变量名 * @param string $type 变量类型 * @param bool $checkEmpty 是否检测空值 * @return mixed */ public function has($name, $type = 'param', $checkEmpty = false) { if (empty($this->$type)) { $param = $this->$type(); } else { $param = $this->$type; } // 按.拆分成多维数组进行判断 foreach (explode('.', $name) as $val) { if (isset($param[$val])) { $param = $param[$val]; } else { return false; } } return ($checkEmpty && '' === $param) ? false : true; } /** * 获取指定的参数 * @access public * @param string|array $name 变量名 * @param string $type 变量类型 * @return mixed */ public function only($name, $type = 'param') { $param = $this->$type(); if (is_string($name)) { $name = explode(',', $name); } $item = []; foreach ($name as $key) { if (isset($param[$key])) { $item[$key] = $param[$key]; } } return $item; } /** * 排除指定参数获取 * @access public * @param string|array $name 变量名 * @param string $type 变量类型 * @return mixed */ public function except($name, $type = 'param') { $param = $this->$type(); if (is_string($name)) { $name = explode(',', $name); } foreach ($name as $key) { if (isset($param[$key])) { unset($param[$key]); } } return $param; } /** * 当前是否ssl * @access public * @return bool */ public function isSsl() { $server = array_merge($_SERVER, $this->server); if (isset($server['HTTPS']) && ('1' == $server['HTTPS'] || 'on' == strtolower($server['HTTPS']))) { return true; } elseif (isset($server['REQUEST_SCHEME']) && 'https' == $server['REQUEST_SCHEME']) { return true; } elseif (isset($server['SERVER_PORT']) && ('443' == $server['SERVER_PORT'])) { return true; } elseif (isset($server['HTTP_X_FORWARDED_PROTO']) && 'https' == $server['HTTP_X_FORWARDED_PROTO']) { return true; } elseif (Config::get('https_agent_name') && isset($server[Config::get('https_agent_name')])) { return true; } return false; } /** * 当前是否Ajax请求 * @access public * @param bool $ajax true 获取原始ajax请求 * @return bool */ public function isAjax($ajax = false) { $value = $this->server('HTTP_X_REQUESTED_WITH', '', 'strtolower'); $result = ('xmlhttprequest' == $value) ? true : false; if (true === $ajax) { return $result; } else { $result = $this->param(Config::get('var_ajax')) ? true : $result; $this->mergeParam = false; return $result; } } /** * 当前是否Pjax请求 * @access public * @param bool $pjax true 获取原始pjax请求 * @return bool */ public function isPjax($pjax = false) { $result = !is_null($this->server('HTTP_X_PJAX')) ? true : false; if (true === $pjax) { return $result; } else { $result = $this->param(Config::get('var_pjax')) ? true : $result; $this->mergeParam = false; return $result; } } /** * 获取客户端IP地址 * @param integer $type 返回类型 0 返回IP地址 1 返回IPV4地址数字 * @param boolean $adv 是否进行高级模式获取(有可能被伪装) * @return mixed */ public function ip($type = 0, $adv = true) { $type = $type ? 1 : 0; static $ip = null; if (null !== $ip) { return $ip[$type]; } $httpAgentIp = Config::get('http_agent_ip'); if ($httpAgentIp && isset($_SERVER[$httpAgentIp])) { $ip = $_SERVER[$httpAgentIp]; } elseif ($adv) { if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); $pos = array_search('unknown', $arr); if (false !== $pos) { unset($arr[$pos]); } $ip = trim(current($arr)); } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (isset($_SERVER['REMOTE_ADDR'])) { $ip = $_SERVER['REMOTE_ADDR']; } } elseif (isset($_SERVER['REMOTE_ADDR'])) { $ip = $_SERVER['REMOTE_ADDR']; } // IP地址合法验证 $long = sprintf("%u", ip2long($ip)); $ip = $long ? [$ip, $long] : ['0.0.0.0', 0]; return $ip[$type]; } /** * 检测是否使用手机访问 * @access public * @return bool */ public function isMobile() { if (isset($_SERVER['HTTP_VIA']) && stristr($_SERVER['HTTP_VIA'], "wap")) { return true; } elseif (isset($_SERVER['HTTP_ACCEPT']) && strpos(strtoupper($_SERVER['HTTP_ACCEPT']), "VND.WAP.WML")) { return true; } elseif (isset($_SERVER['HTTP_X_WAP_PROFILE']) || isset($_SERVER['HTTP_PROFILE'])) { return true; } elseif (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/(blackberry|configuration\/cldc|hp |hp-|htc |htc_|htc-|iemobile|kindle|midp|mmp|motorola|mobile|nokia|opera mini|opera |Googlebot-Mobile|YahooSeeker\/M1A1-R2D2|android|iphone|ipod|mobi|palm|palmos|pocket|portalmmm|ppc;|smartphone|sonyericsson|sqh|spv|symbian|treo|up.browser|up.link|vodafone|windows ce|xda |xda_)/i', $_SERVER['HTTP_USER_AGENT'])) { return true; } else { return false; } } /** * 当前URL地址中的scheme参数 * @access public * @return string */ public function scheme() { // return $this->isSsl() ? 'https' : 'http'; return $this->isSsl() || Config::get('is_https') ? 'https' : 'http'; // by 小虎哥 } /** * 当前请求URL地址中的query参数 * @access public * @return string */ public function query() { return $this->server('QUERY_STRING'); } /** * 当前请求的host * @access public * @param bool $strict true 仅仅获取HOST * @return string */ public function host($strict = false) { if (isset($_SERVER['HTTP_X_REAL_HOST'])) { $host = $_SERVER['HTTP_X_REAL_HOST']; } else { $host = $this->server('HTTP_HOST'); if (empty($host)) { $host = $this->server('SERVER_NAME'); } } return true === $strict && strpos($host, ':') ? strstr($host, ':', true) : $host; } /** * 当前请求URL地址中的port参数 * @access public * @return integer */ public function port() { return $this->server('SERVER_PORT'); } /** * 当前请求 SERVER_PROTOCOL * @access public * @return integer */ public function protocol() { return $this->server('SERVER_PROTOCOL'); } /** * 当前请求 REMOTE_PORT * @access public * @return integer */ public function remotePort() { return $this->server('REMOTE_PORT'); } /** * 当前请求 HTTP_CONTENT_TYPE * @access public * @return string */ public function contentType() { $contentType = $this->server('CONTENT_TYPE'); if ($contentType) { if (strpos($contentType, ';')) { list($type) = explode(';', $contentType); } else { $type = $contentType; } return trim($type); } return ''; } /** * 获取当前请求的路由信息 * @access public * @param array $route 路由名称 * @return array */ public function routeInfo($route = []) { if (!empty($route)) { $this->routeInfo = $route; } else { return $this->routeInfo; } } /** * 设置或者获取当前请求的调度信息 * @access public * @param array $dispatch 调度信息 * @return array */ public function dispatch($dispatch = null) { if (!is_null($dispatch)) { $this->dispatch = $dispatch; } return $this->dispatch; } /** * 设置或者获取当前的模块名 * @access public * @param string $module 模块名 * @return string|Request */ public function module($module = null) { if (!is_null($module)) { $this->module = $module; return $this; } else { return $this->module ?: ''; } } /** * 设置或者获取当前的控制器名 * @access public * @param string $controller 控制器名 * @return string|Request */ public function controller($controller = null) { if (!is_null($controller)) { $this->controller = $controller; return $this; } else { return $this->controller ?: ''; } } /** * 设置或者获取当前的操作名 * @access public * @param string $action 操作名 * @return string|Request */ public function action($action = null) { if (!is_null($action) && !is_bool($action)) { $this->action = $action; return $this; } else { $name = $this->action ?: ''; return true === $action ? $name : strtolower($name); } } /** * 设置或者获取当前的语言 * @access public * @param string $lang 语言名 * @return string|Request */ public function langset($lang = null) { if (!is_null($lang)) { $this->langset = $lang; return $this; } else { return $this->langset ?: ''; } } /** * 设置或者获取当前请求的content * @access public * @return string */ public function getContent() { if (is_null($this->content)) { $this->content = $this->input; } return $this->content; } /** * 获取当前请求的php://input * @access public * @return string */ public function getInput() { return $this->input; } /** * 生成请求令牌 * @access public * @param string $name 令牌名称 * @param mixed $type 令牌生成方法 * @return string */ public function token($name = '__token__', $type = 'md5') { $type = is_callable($type) ? $type : 'md5'; $token = call_user_func($type, $_SERVER['REQUEST_TIME_FLOAT']); if ($this->isAjax()) { header($name . ': ' . $token); } Session::set($name, $token); return $token; } /** * 设置当前地址的请求缓存 * @access public * @param string $key 缓存标识,支持变量规则 ,例如 item/:name/:id * @param mixed $expire 缓存有效期 * @param array $except 缓存排除 * @param string $tag 缓存标签 * @return void */ public function cache($key, $expire = null, $except = [], $tag = null) { if (!is_array($except)) { $tag = $except; $except = []; } if (false !== $key && $this->isGet() && !$this->isCheckCache) { // 标记请求缓存检查 $this->isCheckCache = true; if (false === $expire) { // 关闭当前缓存 return; } if ($key instanceof \Closure) { $key = call_user_func_array($key, [$this]); } elseif (true === $key) { foreach ($except as $rule) { if (0 === stripos($this->url(), $rule)) { return; } } // 自动缓存功能 $key = '__URL__'; } elseif (strpos($key, '|')) { list($key, $fun) = explode('|', $key); } // 特殊规则替换 if (false !== strpos($key, '__')) { $key = str_replace(['__MODULE__', '__CONTROLLER__', '__ACTION__', '__URL__', ''], [$this->module, $this->controller, $this->action, md5($this->url(true))], $key); } if (false !== strpos($key, ':')) { $param = $this->param(); foreach ($param as $item => $val) { if (is_string($val) && false !== strpos($key, ':' . $item)) { $key = str_replace(':' . $item, $val, $key); } } } elseif (strpos($key, ']')) { if ('[' . $this->ext() . ']' == $key) { // 缓存某个后缀的请求 $key = md5($this->url()); } else { return; } } if (isset($fun)) { $key = $fun($key); } if (strtotime($this->server('HTTP_IF_MODIFIED_SINCE')) + $expire > $_SERVER['REQUEST_TIME']) { // 读取缓存 $response = Response::create()->code(304); throw new \think\exception\HttpResponseException($response); } elseif (Cache::has($key)) { list($content, $header) = Cache::get($key); $response = Response::create($content)->header($header); throw new \think\exception\HttpResponseException($response); } else { $this->cache = [$key, $expire, $tag]; } } } /** * 读取请求缓存设置 * @access public * @return array */ public function getCache() { return $this->cache; } /** * 设置当前请求绑定的对象实例 * @access public * @param string|array $name 绑定的对象标识 * @param mixed $obj 绑定的对象实例 * @return mixed */ public function bind($name, $obj = null) { if (is_array($name)) { $this->bind = array_merge($this->bind, $name); } else { $this->bind[$name] = $obj; } } public function __set($name, $value) { $this->bind[$name] = $value; } public function __get($name) { return isset($this->bind[$name]) ? $this->bind[$name] : null; } public function __isset($name) { return isset($this->bind[$name]); } } @SH LHHII@HH [LD$USVATAUAVHl$HMLHB@uHcJ H قDlIHAE$LANDeg`tIHH~HHEЋxHUD;vF H*F H$L$E3H X@uMcF ISقDIIAF`tIH`HHHEHt4A`uH HHHEHcAHI;uMH WLPMt`ID$8HUHMoLuoHx HHX0(EHUHfELMoDII.uMEoDegMtE}HxL9?upD9v=HEo^dLDˋHD$ D#HsGp*LpHH1ExHD<HV HHt DlEDxHAEC A;wlAA;t LpbLpA$t)HEotHEoHuHMHE{A$L?MHHDxHD<HxDlDMghL|$ IHHH]賱AF@uIcF IւHCxHD4A$EoHHLEHUH/MoHE׉HEfDpEEoHMHHA HtHMHEoHMHEoxlHDugD+lAEE֋xLBB+D;ABڅutA$L}߃t+EgF HtHEgHuHMHEA$L?MHHBJxHD<xLZD;ABDtBHUB IEf xLmσHD+EE.LmwH]HxJ+BH;GH;t\A$I߃t+EgF HtHEgHuHMHEA$L?MHHBxsxHD<xH fD<xUǃHHPXH`HtHA(H(E3P0xMt XAEAL$H$HĘA^A]A\^[]HM\H/HM
Fatal error: Uncaught Error: Class 'think\exception\ThrowableError' not found in /www/wwwroot/sjbwo.com/core/library/think/Error.php:43 Stack trace: #0 [internal function]: think\Error::appException(Object(Error)) #1 {main} thrown in /www/wwwroot/sjbwo.com/core/library/think/Error.php on line 43
o ( * 0#,o ( +( ( *A0o *0o *0o * 0, o +( ( *A 0o *0( s }y *0o *0. {y o &( *0{y o uI( *0{y o ( *0o * 0, o +( ( *A 0o *0o% *0{{ *0o% * 0, o% +( ( *A 0o' * 0,(+ +(* ( *A 0o< *0oW *0 (X uP*0oW *0(X *0(L *0(L *0*0* 0, oW +(P ( *A 0oY * 0, (L +(? ( *A 0oM *0( *0} } ( *0{ *0{ *0} } ( *0{ *0{ *0( *0Srps rps rps rps * rps ~ rps ~ rps ~ rps ~  + rp ~ rp ~ rp ~ *0( } *0{ *0( } *0( *0 ,(j&*0(f*0o ( ( *0o ( ( *0o ( *0o ( ( *0o% ( ( *0o ( ( *0o} ( ( *0o ( ( *0o ( ( *0o ( ( *0o ( ( *0o ( ( *0o ( ( *0o ( ( *0o ( ( *0o4 ( ( *0o+ ( ( *0oD ( ( *0o^ ( ( *0oU ( ( *0op ( ( *0o ( ( *0o ( ( *0o ( ( *0o ( ( *0o ( ( *0o ( ( *0o ( ( *0o ( ( *0o ( ( *0o ( ( *0&X( s }u .o &( *0o ( ( *0o ( ( *0&X( s }y .o &( *0o ( ( *0o' ( ( *0o< ( ( *0oY ( ( *0oM ( ( *H\$WH HكtKLAL Ht$0VtHKHIHHKrWHt$0HCH\$8H _H_/HHnt HFWHH\$8H _HL$WH0HD$ H\$HHt$PHًtFL LAVtHKHIHHKVHCH\$HHt$PH0_H/HHmt HVHH\$HHt$PH0_HL$WH0HD$ H\$HHt$PHًtFL _LAUUtHKHIHHKVHCH\$HHt$PH0_H/HH(mt HUHH\$HHt$PH0_H\$WH HكtGLAL . Ht$0TtHSHKHHvUHt$0HCH\$8H _t HXUHH\$8H _HL$WH0HD$ H\$HHt$PHًtFL LATtHKHIHHKTHCH\$HHt$PH0_ t HTHH\$HHt$PH0_H HtHH`@SH H˂/HHHIHtHPHKHt H [H [@SH0HHL$ M3C`CHCH߂HCH߂H߂H;CuHH0[HHHHA@SH0HHL$ M3C`CHCHy߂HCHn߂He߂H;CuHH0[HHHHA@SH0HHL$ M3C`CHCHނHCHނHނH;CuHH0[HHHHAN@SH0HHL$ M3CCHCHyނHCHnނHeނH;CuHH0[HHHHA@SH0HHL$ M3C CHCH݂HCH݂H݂H;CuHH0[HHHHA@SH0HHL$ M3C`CHCHy݂HCHn݂He݂H;CuHH0[HHHHAn@SH0HHL$ M3C0CHCH܂HCH܂H܂H;CuHH0[HHHHA@SH0HHL$ M3CCHCHy܂HCHn܂He܂H;CuHH0[HHHHA@SH0HHL$ M3CCHCHۂHCHۂHۂH;CuHH0[HCHHHA0(sY (Z j3} } } } +l%L jXL)`(} %L jXL)`(} %L jXL)`(} %L jXL)`(} ( *0{ *0{ *0{ *0{ *0L} jXL} *0[ jXL} (jXL} | L} | jXL} | jXL} | jXjXL} *0{ *0} *0{ *0} *0{ { (( *0| { { i*0| { { i*0| { { i*0| { { i*0!{ { | { { XjYi*0( ( X*0{ *0r6p r<p rBp *0{ *0( s } *0j{  ,+s } *0{ o &( *0{ *0( } *0( *0j{  ,+s } *0} } *0j{  ,+s } *0} } *0j{  ,+s } *0} } *0j{  ,+s } *0} } *0j{  ,+s } *0} } *0{ *0} } *0dr+ rFp~ rRp~ r`p ~  rrp ~ rp ~ rp ~ *0{ *0} } *0{ *0} } *0#u{  ,(X , {  +rp 
Fatal error: Uncaught Error: Class 'think\Lang' not found in /www/wwwroot/sjbwo.com/core/library/think/exception/Handle.php:247 Stack trace: #0 /www/wwwroot/sjbwo.com/core/library/think/exception/Handle.php(55): think\exception\Handle->getMessage(Object(think\exception\ErrorException)) #1 /www/wwwroot/sjbwo.com/core/library/think/Error.php(47): think\exception\Handle->report(Object(think\exception\ErrorException)) #2 /www/wwwroot/sjbwo.com/core/library/think/Error.php(88): think\Error::appException(Object(think\exception\ErrorException)) #3 [internal function]: think\Error::appShutdown() #4 {main} thrown in /www/wwwroot/sjbwo.com/core/library/think/exception/Handle.php on line 247