mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
Merge branch 'master' of https://github.com/top-think/framework
This commit is contained in:
@@ -257,7 +257,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前包含协议的域名
|
||||
* 设置或获取当前包含协议的域名
|
||||
* @access public
|
||||
* @param string $domain 域名
|
||||
* @return string
|
||||
@@ -274,7 +274,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前完整URL 包括QUERY_STRING
|
||||
* 设置或获取当前完整URL 包括QUERY_STRING
|
||||
* @access public
|
||||
* @param string|true $url URL地址 true 带域名获取
|
||||
* @return string
|
||||
@@ -301,7 +301,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前URL 不含QUERY_STRING
|
||||
* 设置或获取当前URL 不含QUERY_STRING
|
||||
* @access public
|
||||
* @param string $url URL地址
|
||||
* @return string
|
||||
@@ -319,7 +319,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前执行的文件 SCRIPT_NAME
|
||||
* 设置或获取当前执行的文件 SCRIPT_NAME
|
||||
* @access public
|
||||
* @param string $file 当前执行的文件
|
||||
* @return string
|
||||
@@ -351,7 +351,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取URL访问根地址
|
||||
* 设置或获取URL访问根地址
|
||||
* @access public
|
||||
* @param string $url URL地址
|
||||
* @return string
|
||||
@@ -455,7 +455,7 @@ class Request
|
||||
*/
|
||||
public function type()
|
||||
{
|
||||
$accept = isset($this->server['HTTP_ACCEPT']) ? $this->server['HTTP_ACCEPT'] : $_SERVER['HTTP_ACCEPT'];
|
||||
$accept = $this->server('HTTP_ACCEPT');
|
||||
if (empty($accept)) {
|
||||
return false;
|
||||
}
|
||||
@@ -602,7 +602,7 @@ class Request
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置获取获取当前请求的参数
|
||||
* 获取获取当前请求的参数
|
||||
* @access public
|
||||
* @param string|array $name 变量名
|
||||
* @param mixed $default 默认值
|
||||
|
||||
@@ -63,7 +63,7 @@ class File
|
||||
$current_uri = "cmd:" . implode(' ', $_SERVER['argv']);
|
||||
}
|
||||
|
||||
$runtime = number_format(microtime(true) - THINK_START_TIME, 10);
|
||||
$runtime = round(microtime(true) - THINK_START_TIME, 10);
|
||||
$reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '∞';
|
||||
$time_str = ' [运行时间:' . number_format($runtime, 6) . 's][吞吐率:' . $reqs . 'req/s]';
|
||||
$memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2);
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
namespace think\log\driver;
|
||||
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* github: https://github.com/luofei614/SocketLog
|
||||
* @author luofei614<weibo.com/luofei614>
|
||||
@@ -65,7 +67,7 @@ class Socket
|
||||
}
|
||||
$trace = [];
|
||||
if (App::$debug) {
|
||||
$runtime = number_format(microtime(true) - THINK_START_TIME, 10);
|
||||
$runtime = round(microtime(true) - THINK_START_TIME, 10);
|
||||
$reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '∞';
|
||||
$time_str = ' [运行时间:' . number_format($runtime, 6) . 's][吞吐率:' . $reqs . 'req/s]';
|
||||
$memory_use = number_format((memory_get_usage() - THINK_START_MEM) / 1024, 2);
|
||||
|
||||
@@ -79,7 +79,7 @@ class Memcache extends SessionHandler
|
||||
*/
|
||||
public function read($sessID)
|
||||
{
|
||||
return $this->handler->get($this->config['session_name'] . $sessID);
|
||||
return (string) $this->handler->get($this->config['session_name'] . $sessID);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -87,7 +87,7 @@ class Memcached extends SessionHandler
|
||||
*/
|
||||
public function read($sessID)
|
||||
{
|
||||
return $this->handler->get($this->config['session_name'] . $sessID);
|
||||
return (string) $this->handler->get($this->config['session_name'] . $sessID);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -81,11 +81,11 @@ class Redis extends SessionHandler
|
||||
* 读取Session
|
||||
* @access public
|
||||
* @param string $sessID
|
||||
* @return bool|string
|
||||
* @return string
|
||||
*/
|
||||
public function read($sessID)
|
||||
{
|
||||
return $this->handler->get($this->config['session_name'] . $sessID);
|
||||
return (string) $this->handler->get($this->config['session_name'] . $sessID);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user