升级到5.1.28版本

This commit is contained in:
巴掌 committed 2018-11-01 09:01:46 +08:00
1 parent 4bc2bfa35a
commit 81d9f5e5e5
23 files changed
+321 -150

No files matched your search

+3 -1
View File
@@ -1,6 +1,6 @@
![](http://www.thinkphp.cn/Uploads/editor/2016-06-23/576b4732a6e04.png)
ThinkPHP 5.1 —— 12载初心,你值得信赖的PHP框架
ThinkPHP 5.1(LTS) —— 12载初心,你值得信赖的PHP框架
===============
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/top-think/framework/badges/quality-score.png?b=5.1)](https://scrutinizer-ci.com/g/top-think/framework/?branch=5.1)
@@ -27,6 +27,7 @@ ThinkPHP5.1对底层架构做了进一步的改进,减少依赖,其主要特
+ 中间件支持(`V5.1.6+`)
+ 支持`Swoole`/`Workerman`运行(`V5.1.18+`)
官方已经正式宣布`5.1.27`版本为LTS版本。
### 废除的功能:
@@ -36,6 +37,7 @@ ThinkPHP5.1对底层架构做了进一步的改进,减少依赖,其主要特
> ThinkPHP5.1的运行环境要求PHP5.6+。
## 安装
使用composer安装
+1 -1
View File
@@ -20,7 +20,7 @@ use think\route\Dispatch;
*/
class App extends Container
{
const VERSION = '5.1.27 LTS';
const VERSION = '5.1.28 LTS';
/**
* 当前模块路径
+30 -29
View File
@@ -67,35 +67,6 @@ class Controller
// 控制器初始化
$this->initialize();
// 控制器中间件
if ($this->middleware) {
foreach ($this->middleware as $key => $val) {
if (!is_int($key)) {
$only = $except = null;
if (isset($val['only'])) {
$only = array_map(function ($item) {
return strtolower($item);
}, $val['only']);
} elseif (isset($val['except'])) {
$except = array_map(function ($item) {
return strtolower($item);
}, $val['except']);
}
if (isset($only) && !in_array($this->request->action(), $only)) {
continue;
} elseif (isset($except) && in_array($this->request->action(), $except)) {
continue;
} else {
$val = $key;
}
}
$this->app['middleware']->controller($val);
}
}
// 前置操作方法 即将废弃
foreach ((array) $this->beforeActionList as $method => $options) {
is_numeric($method) ?
@@ -108,6 +79,36 @@ class Controller
protected function initialize()
{}
// 注册控制器中间件
public function registerMiddleware()
{
foreach ($this->middleware as $key => $val) {
if (!is_int($key)) {
$only = $except = null;
if (isset($val['only'])) {
$only = array_map(function ($item) {
return strtolower($item);
}, $val['only']);
} elseif (isset($val['except'])) {
$except = array_map(function ($item) {
return strtolower($item);
}, $val['except']);
}
if (isset($only) && !in_array($this->request->action(), $only)) {
continue;
} elseif (isset($except) && in_array($this->request->action(), $except)) {
continue;
} else {
$val = $key;
}
}
$this->app['middleware']->controller($val);
}
}
/**
* 前置操作
* @access protected
Loaded 3 of 23 files, more files were not shown because too many files have changed in this diff. Show more