Browse Source

first commit

Your Name 6 months ago
commit
28ab5511b5

+ 1
- 0
.example.env View File

@@ -0,0 +1 @@
1
+APP_DEBUG = true

[APP]
DEFAULT_TIMEZONE = Asia/Shanghai

[DATABASE]
TYPE = mysql
HOSTNAME = 127.0.0.1
DATABASE = test
USERNAME = username
PASSWORD = password
HOSTPORT = 3306
CHARSET = utf8
DEBUG = true

[LANG]
default_lang = zh-cn

+ 5
- 0
.gitignore View File

@@ -0,0 +1,5 @@
1
+/.idea
2
+/.vscode
3
+/vendor
4
+*.log
5
+.env

+ 42
- 0
.travis.yml View File

@@ -0,0 +1,42 @@
1
+sudo: false
2
+
3
+language: php
4
+
5
+branches:
6
+  only:
7
+    - stable
8
+
9
+cache:
10
+  directories:
11
+    - $HOME/.composer/cache
12
+
13
+before_install:
14
+  - composer self-update
15
+
16
+install:
17
+  - composer install --no-dev --no-interaction --ignore-platform-reqs
18
+  - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Core.zip .
19
+  - composer require --update-no-dev --no-interaction "topthink/think-image:^1.0"
20
+  - composer require --update-no-dev --no-interaction "topthink/think-migration:^1.0"
21
+  - composer require --update-no-dev --no-interaction "topthink/think-captcha:^1.0"
22
+  - composer require --update-no-dev --no-interaction "topthink/think-mongo:^1.0"
23
+  - composer require --update-no-dev --no-interaction "topthink/think-worker:^1.0"
24
+  - composer require --update-no-dev --no-interaction "topthink/think-helper:^1.0"
25
+  - composer require --update-no-dev --no-interaction "topthink/think-queue:^1.0"
26
+  - composer require --update-no-dev --no-interaction "topthink/think-angular:^1.0"
27
+  - composer require --dev --update-no-dev --no-interaction "topthink/think-testing:^1.0"
28
+  - zip -r --exclude='*.git*' --exclude='*.zip' --exclude='*.travis.yml' ThinkPHP_Full.zip .
29
+
30
+script:
31
+  - php think unit
32
+
33
+deploy:
34
+  provider: releases
35
+  api_key:
36
+    secure: TSF6bnl2JYN72UQOORAJYL+CqIryP2gHVKt6grfveQ7d9rleAEoxlq6PWxbvTI4jZ5nrPpUcBUpWIJHNgVcs+bzLFtyh5THaLqm39uCgBbrW7M8rI26L8sBh/6nsdtGgdeQrO/cLu31QoTzbwuz1WfAVoCdCkOSZeXyT/CclH99qV6RYyQYqaD2wpRjrhA5O4fSsEkiPVuk0GaOogFlrQHx+C+lHnf6pa1KxEoN1A0UxxVfGX6K4y5g4WQDO5zT4bLeubkWOXK0G51XSvACDOZVIyLdjApaOFTwamPcD3S1tfvuxRWWvsCD5ljFvb2kSmx5BIBNwN80MzuBmrGIC27XLGOxyMerwKxB6DskNUO9PflKHDPI61DRq0FTy1fv70SFMSiAtUv9aJRT41NQh9iJJ0vC8dl+xcxrWIjU1GG6+l/ZcRqVx9V1VuGQsLKndGhja7SQ+X1slHl76fRq223sMOql7MFCd0vvvxVQ2V39CcFKao/LB1aPH3VhODDEyxwx6aXoTznvC/QPepgWsHOWQzKj9ftsgDbsNiyFlXL4cu8DWUty6rQy8zT2b4O8b1xjcwSUCsy+auEjBamzQkMJFNlZAIUrukL/NbUhQU37TAbwsFyz7X0E/u/VMle/nBCNAzgkMwAUjiHM6FqrKKBRWFbPrSIixjfjkCnrMEPw=
37
+  file:
38
+    - ThinkPHP_Core.zip
39
+    - ThinkPHP_Full.zip
40
+  skip_cleanup: true
41
+  on:
42
+    tags: true

+ 32
- 0
LICENSE.txt View File

@@ -0,0 +1,32 @@
1
+
2
+ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
3
+版权所有Copyright © 2006-2016 by ThinkPHP (http://thinkphp.cn)
4
+All rights reserved。
5
+ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
6
+
7
+Apache Licence是著名的非盈利开源组织Apache采用的协议。
8
+该协议和BSD类似,鼓励代码共享和尊重原作者的著作权,
9
+允许代码修改,再作为开源或商业软件发布。需要满足
10
+的条件: 
11
+1. 需要给代码的用户一份Apache Licence ;
12
+2. 如果你修改了代码,需要在被修改的文件中说明;
13
+3. 在延伸的代码中(修改和有源代码衍生的代码中)需要
14
+带有原来代码中的协议,商标,专利声明和其他原来作者规
15
+定需要包含的说明;
16
+4. 如果再发布的产品中包含一个Notice文件,则在Notice文
17
+件中需要带有本协议内容。你可以在Notice中增加自己的
18
+许可,但不可以表现为对Apache Licence构成更改。 
19
+具体的协议参考:http://www.apache.org/licenses/LICENSE-2.0
20
+
21
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
+POSSIBILITY OF SUCH DAMAGE.

+ 56
- 0
README.md View File

@@ -0,0 +1,56 @@
1
+ThinkPHP 6.0
2
+===============
3
+
4
+> 运行环境要求PHP7.2+,兼容PHP8.1
5
+
6
+[官方应用服务市场](https://market.topthink.com) | [`ThinkAPI`——官方统一API服务](https://docs.topthink.com/think-api)
7
+
8
+ThinkPHPV6.0版本由[亿速云](https://www.yisu.com/)独家赞助发布。
9
+
10
+## 主要新特性
11
+
12
+* 采用`PHP7`强类型(严格模式)
13
+* 支持更多的`PSR`规范
14
+* 原生多应用支持
15
+* 更强大和易用的查询
16
+* 全新的事件系统
17
+* 模型事件和数据库事件统一纳入事件系统
18
+* 模板引擎分离出核心
19
+* 内部功能中间件化
20
+* SESSION/Cookie机制改进
21
+* 对Swoole以及协程支持改进
22
+* 对IDE更加友好
23
+* 统一和精简大量用法
24
+
25
+## 安装
26
+
27
+~~~
28
+composer create-project topthink/think tp 6.0.*
29
+~~~
30
+
31
+如果需要更新框架使用
32
+~~~
33
+composer update topthink/framework
34
+~~~
35
+
36
+## 文档
37
+
38
+[完全开发手册](https://www.kancloud.cn/manual/thinkphp6_0/content)
39
+
40
+## 参与开发
41
+
42
+请参阅 [ThinkPHP 核心框架包](https://github.com/top-think/framework)。
43
+
44
+## 版权信息
45
+
46
+ThinkPHP遵循Apache2开源协议发布,并提供免费使用。
47
+
48
+本项目包含的第三方源码和二进制文件之版权信息另行标注。
49
+
50
+版权所有Copyright © 2006-2021 by ThinkPHP (http://thinkphp.cn)
51
+
52
+All rights reserved。
53
+
54
+ThinkPHP® 商标和著作权所有者为上海顶想信息科技有限公司。
55
+
56
+更多细节参阅 [LICENSE.txt](LICENSE.txt)

+ 1
- 0
app/.htaccess View File

@@ -0,0 +1 @@
1
+deny from all

+ 22
- 0
app/AppService.php View File

@@ -0,0 +1,22 @@
1
+<?php
2
+declare (strict_types = 1);
3
+
4
+namespace app;
5
+
6
+use think\Service;
7
+
8
+/**
9
+ * 应用服务类
10
+ */
11
+class AppService extends Service
12
+{
13
+    public function register()
14
+    {
15
+        // 服务注册
16
+    }
17
+
18
+    public function boot()
19
+    {
20
+        // 服务启动
21
+    }
22
+}

+ 94
- 0
app/BaseController.php View File

@@ -0,0 +1,94 @@
1
+<?php
2
+declare (strict_types = 1);
3
+
4
+namespace app;
5
+
6
+use think\App;
7
+use think\exception\ValidateException;
8
+use think\Validate;
9
+
10
+/**
11
+ * 控制器基础类
12
+ */
13
+abstract class BaseController
14
+{
15
+    /**
16
+     * Request实例
17
+     * @var \think\Request
18
+     */
19
+    protected $request;
20
+
21
+    /**
22
+     * 应用实例
23
+     * @var \think\App
24
+     */
25
+    protected $app;
26
+
27
+    /**
28
+     * 是否批量验证
29
+     * @var bool
30
+     */
31
+    protected $batchValidate = false;
32
+
33
+    /**
34
+     * 控制器中间件
35
+     * @var array
36
+     */
37
+    protected $middleware = [];
38
+
39
+    /**
40
+     * 构造方法
41
+     * @access public
42
+     * @param  App  $app  应用对象
43
+     */
44
+    public function __construct(App $app)
45
+    {
46
+        $this->app     = $app;
47
+        $this->request = $this->app->request;
48
+
49
+        // 控制器初始化
50
+        $this->initialize();
51
+    }
52
+
53
+    // 初始化
54
+    protected function initialize()
55
+    {}
56
+
57
+    /**
58
+     * 验证数据
59
+     * @access protected
60
+     * @param  array        $data     数据
61
+     * @param  string|array $validate 验证器名或者验证规则数组
62
+     * @param  array        $message  提示信息
63
+     * @param  bool         $batch    是否批量验证
64
+     * @return array|string|true
65
+     * @throws ValidateException
66
+     */
67
+    protected function validate(array $data, $validate, array $message = [], bool $batch = false)
68
+    {
69
+        if (is_array($validate)) {
70
+            $v = new Validate();
71
+            $v->rule($validate);
72
+        } else {
73
+            if (strpos($validate, '.')) {
74
+                // 支持场景
75
+                [$validate, $scene] = explode('.', $validate);
76
+            }
77
+            $class = false !== strpos($validate, '\\') ? $validate : $this->app->parseClass('validate', $validate);
78
+            $v     = new $class();
79
+            if (!empty($scene)) {
80
+                $v->scene($scene);
81
+            }
82
+        }
83
+
84
+        $v->message($message);
85
+
86
+        // 是否批量验证
87
+        if ($batch || $this->batchValidate) {
88
+            $v->batch(true);
89
+        }
90
+
91
+        return $v->failException(true)->check($data);
92
+    }
93
+
94
+}

+ 58
- 0
app/ExceptionHandle.php View File

@@ -0,0 +1,58 @@
1
+<?php
2
+namespace app;
3
+
4
+use think\db\exception\DataNotFoundException;
5
+use think\db\exception\ModelNotFoundException;
6
+use think\exception\Handle;
7
+use think\exception\HttpException;
8
+use think\exception\HttpResponseException;
9
+use think\exception\ValidateException;
10
+use think\Response;
11
+use Throwable;
12
+
13
+/**
14
+ * 应用异常处理类
15
+ */
16
+class ExceptionHandle extends Handle
17
+{
18
+    /**
19
+     * 不需要记录信息(日志)的异常类列表
20
+     * @var array
21
+     */
22
+    protected $ignoreReport = [
23
+        HttpException::class,
24
+        HttpResponseException::class,
25
+        ModelNotFoundException::class,
26
+        DataNotFoundException::class,
27
+        ValidateException::class,
28
+    ];
29
+
30
+    /**
31
+     * 记录异常信息(包括日志或者其它方式记录)
32
+     *
33
+     * @access public
34
+     * @param  Throwable $exception
35
+     * @return void
36
+     */
37
+    public function report(Throwable $exception): void
38
+    {
39
+        // 使用内置的方式记录异常日志
40
+        parent::report($exception);
41
+    }
42
+
43
+    /**
44
+     * Render an exception into an HTTP response.
45
+     *
46
+     * @access public
47
+     * @param \think\Request   $request
48
+     * @param Throwable $e
49
+     * @return Response
50
+     */
51
+    public function render($request, Throwable $e): Response
52
+    {
53
+        // 添加自定义异常处理机制
54
+
55
+        // 其他错误交给系统处理
56
+        return parent::render($request, $e);
57
+    }
58
+}

+ 8
- 0
app/Request.php View File

@@ -0,0 +1,8 @@
1
+<?php
2
+namespace app;
3
+
4
+// 应用请求对象类
5
+class Request extends \think\Request
6
+{
7
+
8
+}

+ 2
- 0
app/common.php View File

@@ -0,0 +1,2 @@
1
+<?php
2
+// 应用公共文件

+ 17
- 0
app/controller/Index.php View File

@@ -0,0 +1,17 @@
1
+<?php
2
+namespace app\controller;
3
+
4
+use app\BaseController;
5
+
6
+class Index extends BaseController
7
+{
8
+    public function index()
9
+    {
10
+        return '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} a{color:#2E5CD5;cursor: pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }</style><div style="padding: 24px 48px;"> <h1>:) </h1><p> ThinkPHP V' . \think\facade\App::version() . '<br/><span style="font-size:30px;">16载初心不改 - 你值得信赖的PHP框架</span></p><span style="font-size:25px;">[ V6.0 版本由 <a href="https://www.yisu.com/" target="yisu">亿速云</a> 独家赞助发布 ]</span></div><script type="text/javascript" src="https://e.topthink.com/Public/static/client.js"></script><think id="ee9b1aa918103c4fc"></think>';
11
+    }
12
+
13
+    public function hello($name = 'ThinkPHP6')
14
+    {
15
+        return 'hello,' . $name;
16
+    }
17
+}

+ 17
- 0
app/event.php View File

@@ -0,0 +1,17 @@
1
+<?php
2
+// 事件定义文件
3
+return [
4
+    'bind'      => [
5
+    ],
6
+
7
+    'listen'    => [
8
+        'AppInit'  => [],
9
+        'HttpRun'  => [],
10
+        'HttpEnd'  => [],
11
+        'LogLevel' => [],
12
+        'LogWrite' => [],
13
+    ],
14
+
15
+    'subscribe' => [
16
+    ],
17
+];

+ 10
- 0
app/middleware.php View File

@@ -0,0 +1,10 @@
1
+<?php
2
+// 全局中间件定义文件
3
+return [
4
+    // 全局请求缓存
5
+    // \think\middleware\CheckRequestCache::class,
6
+    // 多语言加载
7
+    // \think\middleware\LoadLangPack::class,
8
+    // Session初始化
9
+    // \think\middleware\SessionInit::class
10
+];

+ 9
- 0
app/provider.php View File

@@ -0,0 +1,9 @@
1
+<?php
2
+use app\ExceptionHandle;
3
+use app\Request;
4
+
5
+// 容器Provider定义文件
6
+return [
7
+    'think\Request'          => Request::class,
8
+    'think\exception\Handle' => ExceptionHandle::class,
9
+];

+ 9
- 0
app/service.php View File

@@ -0,0 +1,9 @@
1
+<?php
2
+
3
+use app\AppService;
4
+
5
+// 系统服务定义文件
6
+// 服务在完成全局初始化之后执行
7
+return [
8
+    AppService::class,
9
+];

+ 48
- 0
composer.json View File

@@ -0,0 +1,48 @@
1
+{
2
+    "name": "topthink/think",
3
+    "description": "the new thinkphp framework",
4
+    "type": "project",
5
+    "keywords": [
6
+        "framework",
7
+        "thinkphp",
8
+        "ORM"
9
+    ],
10
+    "homepage": "https://www.thinkphp.cn/",
11
+    "license": "Apache-2.0",
12
+    "authors": [
13
+        {
14
+            "name": "liu21st",
15
+            "email": "liu21st@gmail.com"
16
+        },
17
+        {
18
+            "name": "yunwuxin",
19
+            "email": "448901948@qq.com"
20
+        }        
21
+    ],
22
+    "require": {
23
+        "php": ">=7.2.5",
24
+        "topthink/framework": "^6.0.0",
25
+        "topthink/think-orm": "^2.0"
26
+    },
27
+    "require-dev": {
28
+        "symfony/var-dumper": "^4.2",
29
+        "topthink/think-trace":"^1.0"
30
+    },
31
+    "autoload": {
32
+        "psr-4": {
33
+            "app\\": "app"
34
+        },
35
+        "psr-0": {
36
+            "": "extend/"
37
+        }
38
+    },
39
+    "config": {
40
+        "preferred-install": "dist"
41
+    },
42
+    "scripts": {
43
+        "post-autoload-dump": [
44
+          "@php think service:discover",
45
+          "@php think vendor:publish"
46
+        ]
47
+    }
48
+}

+ 763
- 0
composer.lock View File

@@ -0,0 +1,763 @@
1
+{
2
+    "_readme": [
3
+        "This file locks the dependencies of your project to a known state",
4
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5
+        "This file is @generated automatically"
6
+    ],
7
+    "content-hash": "972d5f37c97d6a688bc084d56a25d074",
8
+    "packages": [
9
+        {
10
+            "name": "psr/container",
11
+            "version": "1.1.2",
12
+            "source": {
13
+                "type": "git",
14
+                "url": "https://github.com/php-fig/container.git",
15
+                "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
16
+            },
17
+            "dist": {
18
+                "type": "zip",
19
+                "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
20
+                "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
21
+                "shasum": ""
22
+            },
23
+            "require": {
24
+                "php": ">=7.4.0"
25
+            },
26
+            "type": "library",
27
+            "autoload": {
28
+                "psr-4": {
29
+                    "Psr\\Container\\": "src/"
30
+                }
31
+            },
32
+            "notification-url": "https://packagist.org/downloads/",
33
+            "license": [
34
+                "MIT"
35
+            ],
36
+            "authors": [
37
+                {
38
+                    "name": "PHP-FIG",
39
+                    "homepage": "https://www.php-fig.org/"
40
+                }
41
+            ],
42
+            "description": "Common Container Interface (PHP FIG PSR-11)",
43
+            "homepage": "https://github.com/php-fig/container",
44
+            "keywords": [
45
+                "PSR-11",
46
+                "container",
47
+                "container-interface",
48
+                "container-interop",
49
+                "psr"
50
+            ],
51
+            "support": {
52
+                "issues": "https://github.com/php-fig/container/issues",
53
+                "source": "https://github.com/php-fig/container/tree/1.1.2"
54
+            },
55
+            "time": "2021-11-05T16:50:12+00:00"
56
+        },
57
+        {
58
+            "name": "psr/http-message",
59
+            "version": "1.1",
60
+            "source": {
61
+                "type": "git",
62
+                "url": "https://github.com/php-fig/http-message.git",
63
+                "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
64
+            },
65
+            "dist": {
66
+                "type": "zip",
67
+                "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
68
+                "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
69
+                "shasum": ""
70
+            },
71
+            "require": {
72
+                "php": "^7.2 || ^8.0"
73
+            },
74
+            "type": "library",
75
+            "extra": {
76
+                "branch-alias": {
77
+                    "dev-master": "1.1.x-dev"
78
+                }
79
+            },
80
+            "autoload": {
81
+                "psr-4": {
82
+                    "Psr\\Http\\Message\\": "src/"
83
+                }
84
+            },
85
+            "notification-url": "https://packagist.org/downloads/",
86
+            "license": [
87
+                "MIT"
88
+            ],
89
+            "authors": [
90
+                {
91
+                    "name": "PHP-FIG",
92
+                    "homepage": "http://www.php-fig.org/"
93
+                }
94
+            ],
95
+            "description": "Common interface for HTTP messages",
96
+            "homepage": "https://github.com/php-fig/http-message",
97
+            "keywords": [
98
+                "http",
99
+                "http-message",
100
+                "psr",
101
+                "psr-7",
102
+                "request",
103
+                "response"
104
+            ],
105
+            "support": {
106
+                "source": "https://github.com/php-fig/http-message/tree/1.1"
107
+            },
108
+            "time": "2023-04-04T09:50:52+00:00"
109
+        },
110
+        {
111
+            "name": "psr/log",
112
+            "version": "1.1.4",
113
+            "source": {
114
+                "type": "git",
115
+                "url": "https://github.com/php-fig/log.git",
116
+                "reference": "d49695b909c3b7628b6289db5479a1c204601f11"
117
+            },
118
+            "dist": {
119
+                "type": "zip",
120
+                "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
121
+                "reference": "d49695b909c3b7628b6289db5479a1c204601f11",
122
+                "shasum": ""
123
+            },
124
+            "require": {
125
+                "php": ">=5.3.0"
126
+            },
127
+            "type": "library",
128
+            "extra": {
129
+                "branch-alias": {
130
+                    "dev-master": "1.1.x-dev"
131
+                }
132
+            },
133
+            "autoload": {
134
+                "psr-4": {
135
+                    "Psr\\Log\\": "Psr/Log/"
136
+                }
137
+            },
138
+            "notification-url": "https://packagist.org/downloads/",
139
+            "license": [
140
+                "MIT"
141
+            ],
142
+            "authors": [
143
+                {
144
+                    "name": "PHP-FIG",
145
+                    "homepage": "https://www.php-fig.org/"
146
+                }
147
+            ],
148
+            "description": "Common interface for logging libraries",
149
+            "homepage": "https://github.com/php-fig/log",
150
+            "keywords": [
151
+                "log",
152
+                "psr",
153
+                "psr-3"
154
+            ],
155
+            "support": {
156
+                "source": "https://github.com/php-fig/log/tree/1.1.4"
157
+            },
158
+            "time": "2021-05-03T11:20:27+00:00"
159
+        },
160
+        {
161
+            "name": "psr/simple-cache",
162
+            "version": "1.0.1",
163
+            "source": {
164
+                "type": "git",
165
+                "url": "https://github.com/php-fig/simple-cache.git",
166
+                "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
167
+            },
168
+            "dist": {
169
+                "type": "zip",
170
+                "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
171
+                "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
172
+                "shasum": ""
173
+            },
174
+            "require": {
175
+                "php": ">=5.3.0"
176
+            },
177
+            "type": "library",
178
+            "extra": {
179
+                "branch-alias": {
180
+                    "dev-master": "1.0.x-dev"
181
+                }
182
+            },
183
+            "autoload": {
184
+                "psr-4": {
185
+                    "Psr\\SimpleCache\\": "src/"
186
+                }
187
+            },
188
+            "notification-url": "https://packagist.org/downloads/",
189
+            "license": [
190
+                "MIT"
191
+            ],
192
+            "authors": [
193
+                {
194
+                    "name": "PHP-FIG",
195
+                    "homepage": "http://www.php-fig.org/"
196
+                }
197
+            ],
198
+            "description": "Common interfaces for simple caching",
199
+            "keywords": [
200
+                "cache",
201
+                "caching",
202
+                "psr",
203
+                "psr-16",
204
+                "simple-cache"
205
+            ],
206
+            "support": {
207
+                "source": "https://github.com/php-fig/simple-cache/tree/master"
208
+            },
209
+            "time": "2017-10-23T01:57:42+00:00"
210
+        },
211
+        {
212
+            "name": "topthink/framework",
213
+            "version": "v6.1.4",
214
+            "source": {
215
+                "type": "git",
216
+                "url": "https://github.com/top-think/framework.git",
217
+                "reference": "66eb9cf4d627df12911344cd328faf9bb596bf2c"
218
+            },
219
+            "dist": {
220
+                "type": "zip",
221
+                "url": "https://api.github.com/repos/top-think/framework/zipball/66eb9cf4d627df12911344cd328faf9bb596bf2c",
222
+                "reference": "66eb9cf4d627df12911344cd328faf9bb596bf2c",
223
+                "shasum": ""
224
+            },
225
+            "require": {
226
+                "ext-json": "*",
227
+                "ext-mbstring": "*",
228
+                "php": ">=7.2.5",
229
+                "psr/container": "~1.0",
230
+                "psr/http-message": "^1.0",
231
+                "psr/log": "~1.0",
232
+                "psr/simple-cache": "^1.0",
233
+                "topthink/think-helper": "^3.1.1",
234
+                "topthink/think-orm": "^2.0|^3.0"
235
+            },
236
+            "require-dev": {
237
+                "guzzlehttp/psr7": "^2.1.0",
238
+                "mikey179/vfsstream": "^1.6",
239
+                "mockery/mockery": "^1.2",
240
+                "phpunit/phpunit": "^7.0"
241
+            },
242
+            "type": "library",
243
+            "autoload": {
244
+                "files": [],
245
+                "psr-4": {
246
+                    "think\\": "src/think/"
247
+                }
248
+            },
249
+            "notification-url": "https://packagist.org/downloads/",
250
+            "license": [
251
+                "Apache-2.0"
252
+            ],
253
+            "authors": [
254
+                {
255
+                    "name": "liu21st",
256
+                    "email": "liu21st@gmail.com"
257
+                },
258
+                {
259
+                    "name": "yunwuxin",
260
+                    "email": "448901948@qq.com"
261
+                }
262
+            ],
263
+            "description": "The ThinkPHP Framework.",
264
+            "homepage": "http://thinkphp.cn/",
265
+            "keywords": [
266
+                "framework",
267
+                "orm",
268
+                "thinkphp"
269
+            ],
270
+            "support": {
271
+                "issues": "https://github.com/top-think/framework/issues",
272
+                "source": "https://github.com/top-think/framework/tree/v6.1.4"
273
+            },
274
+            "time": "2023-07-11T15:16:03+00:00"
275
+        },
276
+        {
277
+            "name": "topthink/think-helper",
278
+            "version": "v3.1.6",
279
+            "source": {
280
+                "type": "git",
281
+                "url": "https://github.com/top-think/think-helper.git",
282
+                "reference": "769acbe50a4274327162f9c68ec2e89a38eb2aff"
283
+            },
284
+            "dist": {
285
+                "type": "zip",
286
+                "url": "https://api.github.com/repos/top-think/think-helper/zipball/769acbe50a4274327162f9c68ec2e89a38eb2aff",
287
+                "reference": "769acbe50a4274327162f9c68ec2e89a38eb2aff",
288
+                "shasum": ""
289
+            },
290
+            "require": {
291
+                "php": ">=7.1.0"
292
+            },
293
+            "require-dev": {
294
+                "phpunit/phpunit": "^9.5"
295
+            },
296
+            "type": "library",
297
+            "autoload": {
298
+                "files": [
299
+                    "src/helper.php"
300
+                ],
301
+                "psr-4": {
302
+                    "think\\": "src"
303
+                }
304
+            },
305
+            "notification-url": "https://packagist.org/downloads/",
306
+            "license": [
307
+                "Apache-2.0"
308
+            ],
309
+            "authors": [
310
+                {
311
+                    "name": "yunwuxin",
312
+                    "email": "448901948@qq.com"
313
+                }
314
+            ],
315
+            "description": "The ThinkPHP6 Helper Package",
316
+            "support": {
317
+                "issues": "https://github.com/top-think/think-helper/issues",
318
+                "source": "https://github.com/top-think/think-helper/tree/v3.1.6"
319
+            },
320
+            "time": "2021-12-15T04:27:55+00:00"
321
+        },
322
+        {
323
+            "name": "topthink/think-orm",
324
+            "version": "v2.0.61",
325
+            "source": {
326
+                "type": "git",
327
+                "url": "https://github.com/top-think/think-orm.git",
328
+                "reference": "10528ebf4a5106b19c3bac9c6deae7a67ff49de6"
329
+            },
330
+            "dist": {
331
+                "type": "zip",
332
+                "url": "https://api.github.com/repos/top-think/think-orm/zipball/10528ebf4a5106b19c3bac9c6deae7a67ff49de6",
333
+                "reference": "10528ebf4a5106b19c3bac9c6deae7a67ff49de6",
334
+                "shasum": ""
335
+            },
336
+            "require": {
337
+                "ext-json": "*",
338
+                "ext-pdo": "*",
339
+                "php": ">=7.1.0",
340
+                "psr/log": "^1.0|^2.0",
341
+                "psr/simple-cache": "^1.0|^2.0",
342
+                "topthink/think-helper": "^3.1"
343
+            },
344
+            "require-dev": {
345
+                "phpunit/phpunit": "^7|^8|^9.5"
346
+            },
347
+            "type": "library",
348
+            "autoload": {
349
+                "files": [
350
+                    "stubs/load_stubs.php"
351
+                ],
352
+                "psr-4": {
353
+                    "think\\": "src"
354
+                }
355
+            },
356
+            "notification-url": "https://packagist.org/downloads/",
357
+            "license": [
358
+                "Apache-2.0"
359
+            ],
360
+            "authors": [
361
+                {
362
+                    "name": "liu21st",
363
+                    "email": "liu21st@gmail.com"
364
+                }
365
+            ],
366
+            "description": "think orm",
367
+            "keywords": [
368
+                "database",
369
+                "orm"
370
+            ],
371
+            "support": {
372
+                "issues": "https://github.com/top-think/think-orm/issues",
373
+                "source": "https://github.com/top-think/think-orm/tree/v2.0.61"
374
+            },
375
+            "time": "2023-04-20T14:27:51+00:00"
376
+        }
377
+    ],
378
+    "packages-dev": [
379
+        {
380
+            "name": "symfony/polyfill-mbstring",
381
+            "version": "v1.29.0",
382
+            "source": {
383
+                "type": "git",
384
+                "url": "https://github.com/symfony/polyfill-mbstring.git",
385
+                "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec"
386
+            },
387
+            "dist": {
388
+                "type": "zip",
389
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
390
+                "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec",
391
+                "shasum": ""
392
+            },
393
+            "require": {
394
+                "php": ">=7.1"
395
+            },
396
+            "provide": {
397
+                "ext-mbstring": "*"
398
+            },
399
+            "suggest": {
400
+                "ext-mbstring": "For best performance"
401
+            },
402
+            "type": "library",
403
+            "extra": {
404
+                "thanks": {
405
+                    "name": "symfony/polyfill",
406
+                    "url": "https://github.com/symfony/polyfill"
407
+                }
408
+            },
409
+            "autoload": {
410
+                "files": [
411
+                    "bootstrap.php"
412
+                ],
413
+                "psr-4": {
414
+                    "Symfony\\Polyfill\\Mbstring\\": ""
415
+                }
416
+            },
417
+            "notification-url": "https://packagist.org/downloads/",
418
+            "license": [
419
+                "MIT"
420
+            ],
421
+            "authors": [
422
+                {
423
+                    "name": "Nicolas Grekas",
424
+                    "email": "p@tchwork.com"
425
+                },
426
+                {
427
+                    "name": "Symfony Community",
428
+                    "homepage": "https://symfony.com/contributors"
429
+                }
430
+            ],
431
+            "description": "Symfony polyfill for the Mbstring extension",
432
+            "homepage": "https://symfony.com",
433
+            "keywords": [
434
+                "compatibility",
435
+                "mbstring",
436
+                "polyfill",
437
+                "portable",
438
+                "shim"
439
+            ],
440
+            "support": {
441
+                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0"
442
+            },
443
+            "funding": [
444
+                {
445
+                    "url": "https://symfony.com/sponsor",
446
+                    "type": "custom"
447
+                },
448
+                {
449
+                    "url": "https://github.com/fabpot",
450
+                    "type": "github"
451
+                },
452
+                {
453
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
454
+                    "type": "tidelift"
455
+                }
456
+            ],
457
+            "time": "2024-01-29T20:11:03+00:00"
458
+        },
459
+        {
460
+            "name": "symfony/polyfill-php72",
461
+            "version": "v1.29.0",
462
+            "source": {
463
+                "type": "git",
464
+                "url": "https://github.com/symfony/polyfill-php72.git",
465
+                "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25"
466
+            },
467
+            "dist": {
468
+                "type": "zip",
469
+                "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/861391a8da9a04cbad2d232ddd9e4893220d6e25",
470
+                "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25",
471
+                "shasum": ""
472
+            },
473
+            "require": {
474
+                "php": ">=7.1"
475
+            },
476
+            "type": "library",
477
+            "extra": {
478
+                "thanks": {
479
+                    "name": "symfony/polyfill",
480
+                    "url": "https://github.com/symfony/polyfill"
481
+                }
482
+            },
483
+            "autoload": {
484
+                "files": [
485
+                    "bootstrap.php"
486
+                ],
487
+                "psr-4": {
488
+                    "Symfony\\Polyfill\\Php72\\": ""
489
+                }
490
+            },
491
+            "notification-url": "https://packagist.org/downloads/",
492
+            "license": [
493
+                "MIT"
494
+            ],
495
+            "authors": [
496
+                {
497
+                    "name": "Nicolas Grekas",
498
+                    "email": "p@tchwork.com"
499
+                },
500
+                {
501
+                    "name": "Symfony Community",
502
+                    "homepage": "https://symfony.com/contributors"
503
+                }
504
+            ],
505
+            "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
506
+            "homepage": "https://symfony.com",
507
+            "keywords": [
508
+                "compatibility",
509
+                "polyfill",
510
+                "portable",
511
+                "shim"
512
+            ],
513
+            "support": {
514
+                "source": "https://github.com/symfony/polyfill-php72/tree/v1.29.0"
515
+            },
516
+            "funding": [
517
+                {
518
+                    "url": "https://symfony.com/sponsor",
519
+                    "type": "custom"
520
+                },
521
+                {
522
+                    "url": "https://github.com/fabpot",
523
+                    "type": "github"
524
+                },
525
+                {
526
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
527
+                    "type": "tidelift"
528
+                }
529
+            ],
530
+            "time": "2024-01-29T20:11:03+00:00"
531
+        },
532
+        {
533
+            "name": "symfony/polyfill-php80",
534
+            "version": "v1.29.0",
535
+            "source": {
536
+                "type": "git",
537
+                "url": "https://github.com/symfony/polyfill-php80.git",
538
+                "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b"
539
+            },
540
+            "dist": {
541
+                "type": "zip",
542
+                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
543
+                "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b",
544
+                "shasum": ""
545
+            },
546
+            "require": {
547
+                "php": ">=7.1"
548
+            },
549
+            "type": "library",
550
+            "extra": {
551
+                "thanks": {
552
+                    "name": "symfony/polyfill",
553
+                    "url": "https://github.com/symfony/polyfill"
554
+                }
555
+            },
556
+            "autoload": {
557
+                "files": [
558
+                    "bootstrap.php"
559
+                ],
560
+                "psr-4": {
561
+                    "Symfony\\Polyfill\\Php80\\": ""
562
+                },
563
+                "classmap": [
564
+                    "Resources/stubs"
565
+                ]
566
+            },
567
+            "notification-url": "https://packagist.org/downloads/",
568
+            "license": [
569
+                "MIT"
570
+            ],
571
+            "authors": [
572
+                {
573
+                    "name": "Ion Bazan",
574
+                    "email": "ion.bazan@gmail.com"
575
+                },
576
+                {
577
+                    "name": "Nicolas Grekas",
578
+                    "email": "p@tchwork.com"
579
+                },
580
+                {
581
+                    "name": "Symfony Community",
582
+                    "homepage": "https://symfony.com/contributors"
583
+                }
584
+            ],
585
+            "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
586
+            "homepage": "https://symfony.com",
587
+            "keywords": [
588
+                "compatibility",
589
+                "polyfill",
590
+                "portable",
591
+                "shim"
592
+            ],
593
+            "support": {
594
+                "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0"
595
+            },
596
+            "funding": [
597
+                {
598
+                    "url": "https://symfony.com/sponsor",
599
+                    "type": "custom"
600
+                },
601
+                {
602
+                    "url": "https://github.com/fabpot",
603
+                    "type": "github"
604
+                },
605
+                {
606
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
607
+                    "type": "tidelift"
608
+                }
609
+            ],
610
+            "time": "2024-01-29T20:11:03+00:00"
611
+        },
612
+        {
613
+            "name": "symfony/var-dumper",
614
+            "version": "v4.4.47",
615
+            "source": {
616
+                "type": "git",
617
+                "url": "https://github.com/symfony/var-dumper.git",
618
+                "reference": "1069c7a3fca74578022fab6f81643248d02f8e63"
619
+            },
620
+            "dist": {
621
+                "type": "zip",
622
+                "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1069c7a3fca74578022fab6f81643248d02f8e63",
623
+                "reference": "1069c7a3fca74578022fab6f81643248d02f8e63",
624
+                "shasum": ""
625
+            },
626
+            "require": {
627
+                "php": ">=7.1.3",
628
+                "symfony/polyfill-mbstring": "~1.0",
629
+                "symfony/polyfill-php72": "~1.5",
630
+                "symfony/polyfill-php80": "^1.16"
631
+            },
632
+            "conflict": {
633
+                "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
634
+                "symfony/console": "<3.4"
635
+            },
636
+            "require-dev": {
637
+                "ext-iconv": "*",
638
+                "symfony/console": "^3.4|^4.0|^5.0",
639
+                "symfony/process": "^4.4|^5.0",
640
+                "twig/twig": "^1.43|^2.13|^3.0.4"
641
+            },
642
+            "suggest": {
643
+                "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
644
+                "ext-intl": "To show region name in time zone dump",
645
+                "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
646
+            },
647
+            "bin": [
648
+                "Resources/bin/var-dump-server"
649
+            ],
650
+            "type": "library",
651
+            "autoload": {
652
+                "files": [
653
+                    "Resources/functions/dump.php"
654
+                ],
655
+                "psr-4": {
656
+                    "Symfony\\Component\\VarDumper\\": ""
657
+                },
658
+                "exclude-from-classmap": [
659
+                    "/Tests/"
660
+                ]
661
+            },
662
+            "notification-url": "https://packagist.org/downloads/",
663
+            "license": [
664
+                "MIT"
665
+            ],
666
+            "authors": [
667
+                {
668
+                    "name": "Nicolas Grekas",
669
+                    "email": "p@tchwork.com"
670
+                },
671
+                {
672
+                    "name": "Symfony Community",
673
+                    "homepage": "https://symfony.com/contributors"
674
+                }
675
+            ],
676
+            "description": "Provides mechanisms for walking through any arbitrary PHP variable",
677
+            "homepage": "https://symfony.com",
678
+            "keywords": [
679
+                "debug",
680
+                "dump"
681
+            ],
682
+            "support": {
683
+                "source": "https://github.com/symfony/var-dumper/tree/v4.4.47"
684
+            },
685
+            "funding": [
686
+                {
687
+                    "url": "https://symfony.com/sponsor",
688
+                    "type": "custom"
689
+                },
690
+                {
691
+                    "url": "https://github.com/fabpot",
692
+                    "type": "github"
693
+                },
694
+                {
695
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
696
+                    "type": "tidelift"
697
+                }
698
+            ],
699
+            "time": "2022-10-03T15:15:11+00:00"
700
+        },
701
+        {
702
+            "name": "topthink/think-trace",
703
+            "version": "v1.6",
704
+            "source": {
705
+                "type": "git",
706
+                "url": "https://github.com/top-think/think-trace.git",
707
+                "reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142"
708
+            },
709
+            "dist": {
710
+                "type": "zip",
711
+                "url": "https://api.github.com/repos/top-think/think-trace/zipball/136cd5d97e8bdb780e4b5c1637c588ed7ca3e142",
712
+                "reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142",
713
+                "shasum": ""
714
+            },
715
+            "require": {
716
+                "php": ">=7.1.0",
717
+                "topthink/framework": "^6.0|^8.0"
718
+            },
719
+            "type": "library",
720
+            "extra": {
721
+                "think": {
722
+                    "services": [
723
+                        "think\\trace\\Service"
724
+                    ],
725
+                    "config": {
726
+                        "trace": "src/config.php"
727
+                    }
728
+                }
729
+            },
730
+            "autoload": {
731
+                "psr-4": {
732
+                    "think\\trace\\": "src"
733
+                }
734
+            },
735
+            "notification-url": "https://packagist.org/downloads/",
736
+            "license": [
737
+                "Apache-2.0"
738
+            ],
739
+            "authors": [
740
+                {
741
+                    "name": "liu21st",
742
+                    "email": "liu21st@gmail.com"
743
+                }
744
+            ],
745
+            "description": "thinkphp debug trace",
746
+            "support": {
747
+                "issues": "https://github.com/top-think/think-trace/issues",
748
+                "source": "https://github.com/top-think/think-trace/tree/v1.6"
749
+            },
750
+            "time": "2023-02-07T08:36:32+00:00"
751
+        }
752
+    ],
753
+    "aliases": [],
754
+    "minimum-stability": "stable",
755
+    "stability-flags": [],
756
+    "prefer-stable": false,
757
+    "prefer-lowest": false,
758
+    "platform": {
759
+        "php": ">=7.2.5"
760
+    },
761
+    "platform-dev": [],
762
+    "plugin-api-version": "2.2.0"
763
+}

+ 32
- 0
config/app.php View File

@@ -0,0 +1,32 @@
1
+<?php
2
+// +----------------------------------------------------------------------
3
+// | 应用设置
4
+// +----------------------------------------------------------------------
5
+
6
+return [
7
+    // 应用地址
8
+    'app_host'         => env('app.host', ''),
9
+    // 应用的命名空间
10
+    'app_namespace'    => '',
11
+    // 是否启用路由
12
+    'with_route'       => true,
13
+    // 默认应用
14
+    'default_app'      => 'index',
15
+    // 默认时区
16
+    'default_timezone' => 'Asia/Shanghai',
17
+
18
+    // 应用映射(自动多应用模式有效)
19
+    'app_map'          => [],
20
+    // 域名绑定(自动多应用模式有效)
21
+    'domain_bind'      => [],
22
+    // 禁止URL访问的应用列表(自动多应用模式有效)
23
+    'deny_app_list'    => [],
24
+
25
+    // 异常页面的模板文件
26
+    'exception_tmpl'   => app()->getThinkPath() . 'tpl/think_exception.tpl',
27
+
28
+    // 错误显示信息,非调试模式有效
29
+    'error_message'    => '页面错误!请稍后再试~',
30
+    // 显示错误信息
31
+    'show_error_msg'   => false,
32
+];

+ 29
- 0
config/cache.php View File

@@ -0,0 +1,29 @@
1
+<?php
2
+
3
+// +----------------------------------------------------------------------
4
+// | 缓存设置
5
+// +----------------------------------------------------------------------
6
+
7
+return [
8
+    // 默认缓存驱动
9
+    'default' => env('cache.driver', 'file'),
10
+
11
+    // 缓存连接方式配置
12
+    'stores'  => [
13
+        'file' => [
14
+            // 驱动方式
15
+            'type'       => 'File',
16
+            // 缓存保存目录
17
+            'path'       => '',
18
+            // 缓存前缀
19
+            'prefix'     => '',
20
+            // 缓存有效期 0表示永久缓存
21
+            'expire'     => 0,
22
+            // 缓存标签前缀
23
+            'tag_prefix' => 'tag:',
24
+            // 序列化机制 例如 ['serialize', 'unserialize']
25
+            'serialize'  => [],
26
+        ],
27
+        // 更多的缓存连接
28
+    ],
29
+];

+ 9
- 0
config/console.php View File

@@ -0,0 +1,9 @@
1
+<?php
2
+// +----------------------------------------------------------------------
3
+// | 控制台配置
4
+// +----------------------------------------------------------------------
5
+return [
6
+    // 指令定义
7
+    'commands' => [
8
+    ],
9
+];

+ 20
- 0
config/cookie.php View File

@@ -0,0 +1,20 @@
1
+<?php
2
+// +----------------------------------------------------------------------
3
+// | Cookie设置
4
+// +----------------------------------------------------------------------
5
+return [
6
+    // cookie 保存时间
7
+    'expire'    => 0,
8
+    // cookie 保存路径
9
+    'path'      => '/',
10
+    // cookie 有效域名
11
+    'domain'    => '',
12
+    //  cookie 启用安全传输
13
+    'secure'    => false,
14
+    // httponly设置
15
+    'httponly'  => false,
16
+    // 是否使用 setcookie
17
+    'setcookie' => true,
18
+    // samesite 设置,支持 'strict' 'lax'
19
+    'samesite'  => '',
20
+];

+ 63
- 0
config/database.php View File

@@ -0,0 +1,63 @@
1
+<?php
2
+
3
+return [
4
+    // 默认使用的数据库连接配置
5
+    'default'         => env('database.driver', 'mysql'),
6
+
7
+    // 自定义时间查询规则
8
+    'time_query_rule' => [],
9
+
10
+    // 自动写入时间戳字段
11
+    // true为自动识别类型 false关闭
12
+    // 字符串则明确指定时间字段类型 支持 int timestamp datetime date
13
+    'auto_timestamp'  => true,
14
+
15
+    // 时间字段取出后的默认时间格式
16
+    'datetime_format' => 'Y-m-d H:i:s',
17
+
18
+    // 时间字段配置 配置格式:create_time,update_time
19
+    'datetime_field'  => '',
20
+
21
+    // 数据库连接配置信息
22
+    'connections'     => [
23
+        'mysql' => [
24
+            // 数据库类型
25
+            'type'            => env('database.type', 'mysql'),
26
+            // 服务器地址
27
+            'hostname'        => env('database.hostname', '127.0.0.1'),
28
+            // 数据库名
29
+            'database'        => env('database.database', ''),
30
+            // 用户名
31
+            'username'        => env('database.username', 'root'),
32
+            // 密码
33
+            'password'        => env('database.password', ''),
34
+            // 端口
35
+            'hostport'        => env('database.hostport', '3306'),
36
+            // 数据库连接参数
37
+            'params'          => [],
38
+            // 数据库编码默认采用utf8
39
+            'charset'         => env('database.charset', 'utf8'),
40
+            // 数据库表前缀
41
+            'prefix'          => env('database.prefix', ''),
42
+
43
+            // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
44
+            'deploy'          => 0,
45
+            // 数据库读写是否分离 主从式有效
46
+            'rw_separate'     => false,
47
+            // 读写分离后 主服务器数量
48
+            'master_num'      => 1,
49
+            // 指定从服务器序号
50
+            'slave_no'        => '',
51
+            // 是否严格检查字段是否存在
52
+            'fields_strict'   => true,
53
+            // 是否需要断线重连
54
+            'break_reconnect' => false,
55
+            // 监听SQL
56
+            'trigger_sql'     => env('app_debug', true),
57
+            // 开启字段缓存
58
+            'fields_cache'    => false,
59
+        ],
60
+
61
+        // 更多的数据库配置信息
62
+    ],
63
+];

+ 24
- 0
config/filesystem.php View File

@@ -0,0 +1,24 @@
1
+<?php
2
+
3
+return [
4
+    // 默认磁盘
5
+    'default' => env('filesystem.driver', 'local'),
6
+    // 磁盘列表
7
+    'disks'   => [
8
+        'local'  => [
9
+            'type' => 'local',
10
+            'root' => app()->getRuntimePath() . 'storage',
11
+        ],
12
+        'public' => [
13
+            // 磁盘类型
14
+            'type'       => 'local',
15
+            // 磁盘路径
16
+            'root'       => app()->getRootPath() . 'public/storage',
17
+            // 磁盘路径对应的外部URL路径
18
+            'url'        => '/storage',
19
+            // 可见性
20
+            'visibility' => 'public',
21
+        ],
22
+        // 更多的磁盘配置信息
23
+    ],
24
+];

+ 27
- 0
config/lang.php View File

@@ -0,0 +1,27 @@
1
+<?php
2
+// +----------------------------------------------------------------------
3
+// | 多语言设置
4
+// +----------------------------------------------------------------------
5
+
6
+return [
7
+    // 默认语言
8
+    'default_lang'    => env('lang.default_lang', 'zh-cn'),
9
+    // 允许的语言列表
10
+    'allow_lang_list' => [],
11
+    // 多语言自动侦测变量名
12
+    'detect_var'      => 'lang',
13
+    // 是否使用Cookie记录
14
+    'use_cookie'      => true,
15
+    // 多语言cookie变量
16
+    'cookie_var'      => 'think_lang',
17
+    // 多语言header变量
18
+    'header_var'      => 'think-lang',
19
+    // 扩展语言包
20
+    'extend_list'     => [],
21
+    // Accept-Language转义为对应语言包名称
22
+    'accept_language' => [
23
+        'zh-hans-cn' => 'zh-cn',
24
+    ],
25
+    // 是否支持语言分组
26
+    'allow_group'     => false,
27
+];

+ 45
- 0
config/log.php View File

@@ -0,0 +1,45 @@
1
+<?php
2
+
3
+// +----------------------------------------------------------------------
4
+// | 日志设置
5
+// +----------------------------------------------------------------------
6
+return [
7
+    // 默认日志记录通道
8
+    'default'      => env('log.channel', 'file'),
9
+    // 日志记录级别
10
+    'level'        => [],
11
+    // 日志类型记录的通道 ['error'=>'email',...]
12
+    'type_channel' => [],
13
+    // 关闭全局日志写入
14
+    'close'        => false,
15
+    // 全局日志处理 支持闭包
16
+    'processor'    => null,
17
+
18
+    // 日志通道列表
19
+    'channels'     => [
20
+        'file' => [
21
+            // 日志记录方式
22
+            'type'           => 'File',
23
+            // 日志保存目录
24
+            'path'           => '',
25
+            // 单文件日志写入
26
+            'single'         => false,
27
+            // 独立日志级别
28
+            'apart_level'    => [],
29
+            // 最大日志文件数量
30
+            'max_files'      => 0,
31
+            // 使用JSON格式记录
32
+            'json'           => false,
33
+            // 日志处理
34
+            'processor'      => null,
35
+            // 关闭通道日志写入
36
+            'close'          => false,
37
+            // 日志输出格式化
38
+            'format'         => '[%s][%s] %s',
39
+            // 是否实时写入
40
+            'realtime_write' => false,
41
+        ],
42
+        // 其它日志通道配置
43
+    ],
44
+
45
+];

+ 8
- 0
config/middleware.php View File

@@ -0,0 +1,8 @@
1
+<?php
2
+// 中间件配置
3
+return [
4
+    // 别名或分组
5
+    'alias'    => [],
6
+    // 优先级设置,此数组中的中间件会按照数组中的顺序优先执行
7
+    'priority' => [],
8
+];

+ 45
- 0
config/route.php View File

@@ -0,0 +1,45 @@
1
+<?php
2
+// +----------------------------------------------------------------------
3
+// | 路由设置
4
+// +----------------------------------------------------------------------
5
+
6
+return [
7
+    // pathinfo分隔符
8
+    'pathinfo_depr'         => '/',
9
+    // URL伪静态后缀
10
+    'url_html_suffix'       => 'html',
11
+    // URL普通方式参数 用于自动生成
12
+    'url_common_param'      => true,
13
+    // 是否开启路由延迟解析
14
+    'url_lazy_route'        => false,
15
+    // 是否强制使用路由
16
+    'url_route_must'        => false,
17
+    // 合并路由规则
18
+    'route_rule_merge'      => false,
19
+    // 路由是否完全匹配
20
+    'route_complete_match'  => false,
21
+    // 访问控制器层名称
22
+    'controller_layer'      => 'controller',
23
+    // 空控制器名
24
+    'empty_controller'      => 'Error',
25
+    // 是否使用控制器后缀
26
+    'controller_suffix'     => false,
27
+    // 默认的路由变量规则
28
+    'default_route_pattern' => '[\w\.]+',
29
+    // 是否开启请求缓存 true自动缓存 支持设置请求缓存规则
30
+    'request_cache_key'     => false,
31
+    // 请求缓存有效期
32
+    'request_cache_expire'  => null,
33
+    // 全局请求缓存排除规则
34
+    'request_cache_except'  => [],
35
+    // 默认控制器名
36
+    'default_controller'    => 'Index',
37
+    // 默认操作名
38
+    'default_action'        => 'index',
39
+    // 操作方法后缀
40
+    'action_suffix'         => '',
41
+    // 默认JSONP格式返回的处理方法
42
+    'default_jsonp_handler' => 'jsonpReturn',
43
+    // 默认JSONP处理方法
44
+    'var_jsonp_handler'     => 'callback',
45
+];

+ 19
- 0
config/session.php View File

@@ -0,0 +1,19 @@
1
+<?php
2
+// +----------------------------------------------------------------------
3
+// | 会话设置
4
+// +----------------------------------------------------------------------
5
+
6
+return [
7
+    // session name
8
+    'name'           => 'PHPSESSID',
9
+    // SESSION_ID的提交变量,解决flash上传跨域
10
+    'var_session_id' => '',
11
+    // 驱动方式 支持file cache
12
+    'type'           => 'file',
13
+    // 存储连接标识 当type使用cache的时候有效
14
+    'store'          => null,
15
+    // 过期时间
16
+    'expire'         => 1440,
17
+    // 前缀
18
+    'prefix'         => '',
19
+];

+ 25
- 0
config/view.php View File

@@ -0,0 +1,25 @@
1
+<?php
2
+// +----------------------------------------------------------------------
3
+// | 模板设置
4
+// +----------------------------------------------------------------------
5
+
6
+return [
7
+    // 模板引擎类型使用Think
8
+    'type'          => 'Think',
9
+    // 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
10
+    'auto_rule'     => 1,
11
+    // 模板目录名
12
+    'view_dir_name' => 'view',
13
+    // 模板后缀
14
+    'view_suffix'   => 'html',
15
+    // 模板文件名分隔符
16
+    'view_depr'     => DIRECTORY_SEPARATOR,
17
+    // 模板引擎普通标签开始标记
18
+    'tpl_begin'     => '{',
19
+    // 模板引擎普通标签结束标记
20
+    'tpl_end'       => '}',
21
+    // 标签库标签开始标记
22
+    'taglib_begin'  => '{',
23
+    // 标签库标签结束标记
24
+    'taglib_end'    => '}',
25
+];

+ 2
- 0
extend/.gitignore View File

@@ -0,0 +1,2 @@
1
+*
2
+!.gitignore

+ 8
- 0
public/.htaccess View File

@@ -0,0 +1,8 @@
1
+<IfModule mod_rewrite.c>
2
+  Options +FollowSymlinks -Multiviews
3
+  RewriteEngine On
4
+
5
+  RewriteCond %{REQUEST_FILENAME} !-d
6
+  RewriteCond %{REQUEST_FILENAME} !-f
7
+  RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
8
+</IfModule>

BIN
public/favicon.ico View File


+ 24
- 0
public/index.php View File

@@ -0,0 +1,24 @@
1
+<?php
2
+// +----------------------------------------------------------------------
3
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
4
+// +----------------------------------------------------------------------
5
+// | Copyright (c) 2006-2019 http://thinkphp.cn All rights reserved.
6
+// +----------------------------------------------------------------------
7
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
8
+// +----------------------------------------------------------------------
9
+// | Author: liu21st <liu21st@gmail.com>
10
+// +----------------------------------------------------------------------
11
+
12
+// [ 应用入口文件 ]
13
+namespace think;
14
+
15
+require __DIR__ . '/../vendor/autoload.php';
16
+
17
+// 执行HTTP应用并响应
18
+$http = (new App())->http;
19
+
20
+$response = $http->run();
21
+
22
+$response->send();
23
+
24
+$http->end($response);

+ 2
- 0
public/robots.txt View File

@@ -0,0 +1,2 @@
1
+User-agent: *
2
+Disallow:

+ 19
- 0
public/router.php View File

@@ -0,0 +1,19 @@
1
+<?php
2
+// +----------------------------------------------------------------------
3
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
4
+// +----------------------------------------------------------------------
5
+// | Copyright (c) 2006~2019 http://thinkphp.cn All rights reserved.
6
+// +----------------------------------------------------------------------
7
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
8
+// +----------------------------------------------------------------------
9
+// | Author: liu21st <liu21st@gmail.com>
10
+// +----------------------------------------------------------------------
11
+// $Id$
12
+
13
+if (is_file($_SERVER["DOCUMENT_ROOT"] . $_SERVER["SCRIPT_NAME"])) {
14
+    return false;
15
+} else {
16
+    $_SERVER["SCRIPT_FILENAME"] = __DIR__ . '/index.php';
17
+
18
+    require __DIR__ . "/index.php";
19
+}

+ 2
- 0
public/static/.gitignore View File

@@ -0,0 +1,2 @@
1
+*
2
+!.gitignore

+ 17
- 0
route/app.php View File

@@ -0,0 +1,17 @@
1
+<?php
2
+// +----------------------------------------------------------------------
3
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
4
+// +----------------------------------------------------------------------
5
+// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
6
+// +----------------------------------------------------------------------
7
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
8
+// +----------------------------------------------------------------------
9
+// | Author: liu21st <liu21st@gmail.com>
10
+// +----------------------------------------------------------------------
11
+use think\facade\Route;
12
+
13
+Route::get('think', function () {
14
+    return 'hello,ThinkPHP6!';
15
+});
16
+
17
+Route::get('hello/:name', 'index/hello');

+ 2
- 0
runtime/.gitignore View File

@@ -0,0 +1,2 @@
1
+*
2
+!.gitignore

+ 10
- 0
think View File

@@ -0,0 +1,10 @@
1
+#!/usr/bin/env php
2
+<?php
3
+namespace think;
4
+
5
+// 命令行入口文件
6
+// 加载基础文件
7
+require __DIR__ . '/vendor/autoload.php';
8
+
9
+// 应用初始化
10
+(new App())->console->run();

+ 1
- 0
view/README.md View File

@@ -0,0 +1 @@
1
+如果不使用模板,可以删除该目录

Loading…
Cancel
Save