Skip to content

Commit

Permalink
Merge branch '6.0' of https://github.com/top-think/framework into 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Jul 16, 2021
2 parents e371405 + 5d503d6 commit 4b9bd66
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/think/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public function trigger($event, $params = null, bool $once = false)
$listeners = $this->listener[$event] ?? [];

if (strpos($event, '.')) {
[$prefix, $event] = explode($event, '.', 2);
[$prefix, $event] = explode('.', $event, 2);
if (isset($this->listener[$prefix . '.*'])) {
$listeners = array_merge($listeners, $this->listener[$prefix . '.*']);
}
Expand Down
9 changes: 5 additions & 4 deletions src/think/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@ public function subDomain(): string
$rootDomain = $this->rootDomain();

if ($rootDomain) {
$this->subDomain = rtrim(stristr($this->host(), $rootDomain, true), '.');
$sub = stristr($this->host(), $rootDomain, true);
$this->subDomain = $sub ? rtrim($sub, '.') : '';
} else {
$this->subDomain = '';
}
Expand Down Expand Up @@ -1307,12 +1308,12 @@ protected function filterData($data, $filter, $name, $default)

/**
* 强制类型转换
* @access public
* @access protected
* @param mixed $data
* @param string $type
* @return mixed
*/
private function typeCast(&$data, string $type)
protected function typeCast(&$data, string $type)
{
switch (strtolower($type)) {
// 数组
Expand Down Expand Up @@ -1344,7 +1345,7 @@ private function typeCast(&$data, string $type)

/**
* 获取数据
* @access public
* @access protected
* @param array $data 数据源
* @param string $name 字段名
* @param mixed $default 默认值
Expand Down
2 changes: 1 addition & 1 deletion src/think/console/command/RunServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function execute(Input $input, Output $output)
escapeshellarg($root . DIRECTORY_SEPARATOR . 'router.php')
);

$output->writeln(sprintf('ThinkPHP Development server is started On <http://%s:%s/>', '0.0.0.0' == $host ? '127.0.0.1' : $host, $port));
$output->writeln(sprintf('ThinkPHP Development server is started On <http://%s:%s/>', $host, $port));
$output->writeln(sprintf('You can exit with <info>`CTRL-C`</info>'));
$output->writeln(sprintf('Document root is: %s', $root));
passthru($command);
Expand Down
2 changes: 1 addition & 1 deletion src/think/facade/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
* @method static RuleItem redirect(string $rule, string $route = '', int $status = 301) 注册重定向路由
* @method static \think\Route rest(string|array $name, array|bool $resource = []) rest方法定义和修改
* @method static array|null getRest(string $name = null) 获取rest方法定义的参数
* @method static RuleItem miss(string|Closure $route, string $method = '*') 注册未匹配路由规则后的处理
* @method static RuleItem miss(string|\Closure $route, string $method = '*') 注册未匹配路由规则后的处理
* @method static Response dispatch(\think\Request $request, Closure|bool $withRoute = true) 路由调度
* @method static Dispatch|false check() 检测URL路由
* @method static Dispatch url(string $url) 默认URL解析
Expand Down

0 comments on commit 4b9bd66

Please sign in to comment.