├── .env.example ├── .gitignore ├── .travis.yml ├── LICENSE.txt ├── README.md ├── app ├── .htaccess ├── AppService.php ├── BaseController.php ├── ExceptionHandle.php ├── Request.php ├── common.php ├── controller │ ├── Auth.php │ ├── Index.php │ ├── Tweet.php │ └── User.php ├── event.php ├── middleware.php ├── model │ ├── Follower.php │ ├── Tweet.php │ └── User.php ├── provider.php ├── service.php └── validate │ ├── Auth.php │ └── Tweet.php ├── composer.json ├── composer.lock ├── config ├── app.php ├── cache.php ├── console.php ├── cookie.php ├── database.php ├── filesystem.php ├── jwt.php ├── lang.php ├── log.php ├── middleware.php ├── route.php ├── session.php ├── trace.php └── view.php ├── database └── migrations │ ├── 20200827035529_users.php │ ├── 20200902035529_tweets.php │ └── 20200906035529_followers.php ├── db └── tp6.db ├── extend └── .gitignore ├── public ├── .htaccess ├── favicon.ico ├── index.php ├── robots.txt ├── router.php └── static │ └── .gitignore ├── route └── app.php ├── runtime └── .gitignore ├── think └── view └── README.md /.env.example: -------------------------------------------------------------------------------- 1 | APP_DEBUG = true 2 | 3 | [APP] 4 | DEFAULT_TIMEZONE = Asia/Shanghai 5 | 6 | [DATABASE] 7 | TYPE = sqlite 8 | HOSTNAME = 127.0.0.1 9 | DATABASE = 10 | USERNAME = username 11 | PASSWORD = password 12 | HOSTPORT = 3306 13 | CHARSET = utf8 14 | DEBUG = true 15 | 16 | [LANG] 17 | default_lang = zh-cn 18 | 19 | [JWT] 20 | SECRET = 21 | TTL = 1209600 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /.vscode 3 | /vendor 4 | *.log 5 | .env -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 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 43 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 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. 33 | 34 | 35 | ============ 36 | Copyright 2020 AGD 37 | 38 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 41 | 42 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ThinkPHP6 Primer 前后端分离实战入门 [TP6-P01] 后端源码 2 | 3 | 在线阅读:https://www.kancloud.cn/agdholo/tp6-p01 -------------------------------------------------------------------------------- /app/.htaccess: -------------------------------------------------------------------------------- 1 | deny from all -------------------------------------------------------------------------------- /app/AppService.php: -------------------------------------------------------------------------------- 1 | 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 | } 95 | -------------------------------------------------------------------------------- /app/ExceptionHandle.php: -------------------------------------------------------------------------------- 1 | '请先登录' 25 | ], 401); 26 | } 27 | } 28 | 29 | public function login() 30 | { 31 | $requestData = Request::post(); 32 | 33 | $user = User::where('email', $requestData['email'])->find(); 34 | 35 | if ($user !== null && password_verify($requestData['password'], $user->password)) { 36 | return json([ 37 | 'id' => $user->id, 38 | 'name' => $user->name, 39 | 'email' => $user->email, 40 | 'token' => JWTAuth::builder(['id' => $user->id]), 41 | 'ttl' => env('JWT_TTL') 42 | ]); 43 | } else { 44 | return json( 45 | [ 46 | 'message' => '授权错误,请检查邮件地址或密码' 47 | ], 48 | 401 49 | ); 50 | } 51 | } 52 | 53 | public function sign() 54 | { 55 | $requestData = Request::post(); 56 | 57 | try { 58 | validate(validateAuth::class)->batch(true)->check($requestData); 59 | 60 | $create = User::create($requestData); 61 | $data = User::find($create->id); 62 | 63 | return json([ 64 | 'id' => $data->id, 65 | 'name' => $data->name, 66 | 'email' => $data->email, 67 | 'token' => JWTAuth::builder(['id' => $data->id]), 68 | 'ttl' => env('JWT_TTL') 69 | ]); 70 | 71 | return json($data); 72 | } catch (ValidateException $e) { 73 | return json( 74 | [ 75 | 'message' => $e->getError() 76 | ], 77 | 400 78 | ); 79 | } 80 | } 81 | 82 | public function logout() 83 | { 84 | $authorization = Request::header('Authorization'); 85 | $token = explode('Bearer ', $authorization)[1]; 86 | 87 | try { 88 | JWTAuth::invalidate($token); 89 | JWTAuth::validate($token); 90 | 91 | return json([ 92 | 'message' => '登出成功' 93 | ]); 94 | } catch (Exception $e) { 95 | return json([ 96 | 'message' => '登出失败,请检查 token 有效情况' 97 | ], 403); 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /app/controller/Index.php: -------------------------------------------------------------------------------- 1 | *{ 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 }

:)

ThinkPHP V' . \think\facade\App::version() . '
14载初心不改 - 你值得信赖的PHP框架

[ V6.0 版本由 亿速云 独家赞助发布 ]
'; 11 | } 12 | 13 | public function hello() 14 | { 15 | $data = ['TP6-P01' => 'API Server']; 16 | return json($data); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/controller/Tweet.php: -------------------------------------------------------------------------------- 1 | [ 17 | // index,read 方法除外 18 | 'except' => ['index', 'read'] 19 | ], 20 | ]; 21 | 22 | /** 23 | * 显示资源列表 24 | * 25 | * @return \think\Response 26 | */ 27 | public function index(Request $request) 28 | { 29 | if ($request->param('all_tweets')) 30 | return json(TweetModel::with(['user'])->order('created_at desc')->select()); 31 | 32 | // 关注用户 33 | $authID = JWTAuth::auth()['id'] . ''; 34 | 35 | $data = User::with(['followers', 'followings', 'tweets' => function ($query) { 36 | $query->order('created_at desc'); 37 | }])->find($authID); 38 | 39 | $followers_ids = $data->followers->column('id'); 40 | 41 | $ids = [...$followers_ids, $authID]; 42 | 43 | // 使用预加载的方法返回所有关联推文 44 | $data = TweetModel::with(['user'])->whereIn('user_id', $ids)->order('created_at desc')->select(); 45 | return json($data); 46 | } 47 | 48 | /** 49 | * 保存新建的资源 50 | * 51 | * @param \think\Request $request 52 | * @return \think\Response 53 | */ 54 | public function save(Request $request) 55 | { 56 | // 获取当前用户 ID 57 | $authID = JWTAuth::auth()['id'] . ''; 58 | 59 | // 将当前 ID 与用户一起插入 60 | TweetModel::create([ 61 | 'content' => $request->param('content'), 62 | 'user_id' => intval($authID) 63 | ]); 64 | 65 | // 使用预加载的方法返回所有关联推文 66 | $data = TweetModel::with(['user'])->order('created_at desc')->select(); 67 | return json($data); 68 | } 69 | 70 | /** 71 | * 显示指定的资源 72 | * 73 | * @param int $id 74 | * @return \think\Response 75 | */ 76 | public function read($id) 77 | { 78 | // 79 | } 80 | 81 | /** 82 | * 保存更新的资源 83 | * 84 | * @param \think\Request $request 85 | * @param int $id 86 | * @return \think\Response 87 | */ 88 | public function update(Request $request, $id) 89 | { 90 | // 91 | } 92 | 93 | /** 94 | * 删除指定资源 95 | * 96 | * @param int $id 97 | * @return \think\Response 98 | */ 99 | public function delete($id) 100 | { 101 | // 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /app/controller/User.php: -------------------------------------------------------------------------------- 1 | [ 16 | 'except' => ['index', 'read'] 17 | ], 18 | ]; 19 | 20 | /** 21 | * 显示资源列表 22 | * 23 | * @return \think\Response 24 | */ 25 | public function index() 26 | { 27 | // 28 | } 29 | 30 | /** 31 | * 保存新建的资源 32 | * 33 | * @param \think\Request $request 34 | * @return \think\Response 35 | */ 36 | public function save(Request $request) 37 | { 38 | // 39 | } 40 | 41 | /** 42 | * 显示指定的资源 43 | * 44 | * @param int $id 45 | * @return \think\Response 46 | */ 47 | public function read($id) 48 | { 49 | $data = UserModel::with(['followers', 'followings', 'tweets' => function ($query) { 50 | $query->order('created_at desc'); 51 | }])->find($id); 52 | 53 | // 正在关注他的用户 ID 54 | if ($data->followings) { 55 | $following_ids = $data->followings->column('id'); 56 | 57 | // 查询当前登入用户是否已经关注 58 | $authID = JWTAuth::auth()['id'] . ''; 59 | $match = array_search($authID, $following_ids); 60 | $is_following = $match === 0 ? true : false; 61 | } 62 | 63 | return json([ 64 | 'is_following' => $is_following ?? false, 65 | 'data' => $data, 66 | ]); 67 | } 68 | 69 | /** 70 | * 保存更新的资源 71 | * 72 | * @param \think\Request $request 73 | * @param int $id 74 | * @return \think\Response 75 | */ 76 | public function update(Request $request, $id) 77 | { 78 | $authID = JWTAuth::auth()['id']; 79 | 80 | if ($authID != $id) { 81 | return json([ 82 | "message" => "非法请求" 83 | ], 401); 84 | } 85 | 86 | UserModel::update([ 87 | "id" => $id, 88 | "name" => $request->param('name') 89 | ]); 90 | 91 | $data = UserModel::find($id); 92 | return json($data); 93 | } 94 | 95 | /** 96 | * 删除指定资源 97 | * 98 | * @param int $id 99 | * @return \think\Response 100 | */ 101 | public function delete($id) 102 | { 103 | // 104 | } 105 | 106 | // 关注用户 107 | public function follow(Request $request) 108 | { 109 | $follow_id = $request->param('follow_id'); 110 | 111 | $user = $this->follow_data($request); 112 | $user->followers()->attach($follow_id); 113 | 114 | return $this->read($follow_id); 115 | } 116 | 117 | // 取消关注用户 118 | public function unfollow(Request $request) 119 | { 120 | $follow_id = $request->param('follow_id'); 121 | 122 | $user = $this->follow_data($request); 123 | $user->followers()->detach($follow_id); 124 | 125 | return $this->read($follow_id); 126 | } 127 | 128 | protected function follow_data($request) 129 | { 130 | $authID = JWTAuth::auth()['id'] . ''; 131 | $id = intval($authID); 132 | 133 | $user = UserModel::find($id); 134 | return $user; 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /app/event.php: -------------------------------------------------------------------------------- 1 | [ 5 | ], 6 | 7 | 'listen' => [ 8 | 'AppInit' => [], 9 | 'HttpRun' => [], 10 | 'HttpEnd' => [], 11 | 'LogLevel' => [], 12 | 'LogWrite' => [], 13 | ], 14 | 15 | 'subscribe' => [ 16 | ], 17 | ]; 18 | -------------------------------------------------------------------------------- /app/middleware.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/model/User.php: -------------------------------------------------------------------------------- 1 | hasMany(Tweet::class); 37 | } 38 | 39 | // 用户与粉丝多对多关联 40 | public function followers() 41 | { 42 | return $this->belongsToMany(User::class, Follower::class, 'user_id', 'follower_id'); 43 | } 44 | 45 | public function followings() 46 | { 47 | return $this->belongsToMany(User::class, Follower::class, 'follower_id', 'user_id'); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/provider.php: -------------------------------------------------------------------------------- 1 | Request::class, 8 | 'think\exception\Handle' => ExceptionHandle::class, 9 | ]; 10 | -------------------------------------------------------------------------------- /app/service.php: -------------------------------------------------------------------------------- 1 | ['规则1','规则2'...] 13 | * 14 | * @var array 15 | */ 16 | protected $rule = [ 17 | 'email|邮件' => 'require|email|unique:users|max:255', 18 | 'password|密码' => 'require|min:6' 19 | ]; 20 | 21 | /** 22 | * 定义错误信息 23 | * 格式:'字段名.规则名' => '错误信息' 24 | * 25 | * @var array 26 | */ 27 | protected $message = []; 28 | } 29 | -------------------------------------------------------------------------------- /app/validate/Tweet.php: -------------------------------------------------------------------------------- 1 | ['规则1','规则2'...] 13 | * 14 | * @var array 15 | */ 16 | protected $rule = [ 17 | // 推特允许发推文的字数是280 18 | 'content|推文' => 'require|max:280', 19 | ]; 20 | 21 | /** 22 | * 定义错误信息 23 | * 格式:'字段名.规则名' => '错误信息' 24 | * 25 | * @var array 26 | */ 27 | protected $message = []; 28 | } 29 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 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": "http://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.1.0", 24 | "topthink/framework": "^6.0.0", 25 | "topthink/think-orm": "^2.0", 26 | "topthink/think-migration": "^3.0", 27 | "thans/tp-jwt-auth": "^1.1" 28 | }, 29 | "require-dev": { 30 | "symfony/var-dumper": "^4.2", 31 | "topthink/think-trace":"^1.0" 32 | }, 33 | "autoload": { 34 | "psr-4": { 35 | "app\\": "app" 36 | }, 37 | "psr-0": { 38 | "": "extend/" 39 | } 40 | }, 41 | "config": { 42 | "preferred-install": "dist" 43 | }, 44 | "scripts": { 45 | "post-autoload-dump": [ 46 | "@php think service:discover", 47 | "@php think vendor:publish" 48 | ] 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 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": "a00600c5351eccef707d37bdc5593b35", 8 | "packages": [ 9 | { 10 | "name": "lcobucci/jwt", 11 | "version": "3.3.3", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/lcobucci/jwt.git", 15 | "reference": "c1123697f6a2ec29162b82f170dd4a491f524773" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/lcobucci/jwt/zipball/c1123697f6a2ec29162b82f170dd4a491f524773", 20 | "reference": "c1123697f6a2ec29162b82f170dd4a491f524773", 21 | "shasum": "", 22 | "mirrors": [ 23 | { 24 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 25 | "preferred": true 26 | } 27 | ] 28 | }, 29 | "require": { 30 | "ext-mbstring": "*", 31 | "ext-openssl": "*", 32 | "php": "^5.6 || ^7.0" 33 | }, 34 | "require-dev": { 35 | "mikey179/vfsstream": "~1.5", 36 | "phpmd/phpmd": "~2.2", 37 | "phpunit/php-invoker": "~1.1", 38 | "phpunit/phpunit": "^5.7 || ^7.3", 39 | "squizlabs/php_codesniffer": "~2.3" 40 | }, 41 | "type": "library", 42 | "extra": { 43 | "branch-alias": { 44 | "dev-master": "3.1-dev" 45 | } 46 | }, 47 | "autoload": { 48 | "psr-4": { 49 | "Lcobucci\\JWT\\": "src" 50 | } 51 | }, 52 | "notification-url": "https://packagist.org/downloads/", 53 | "license": [ 54 | "BSD-3-Clause" 55 | ], 56 | "authors": [ 57 | { 58 | "name": "Luís Otávio Cobucci Oblonczyk", 59 | "email": "lcobucci@gmail.com", 60 | "role": "Developer" 61 | } 62 | ], 63 | "description": "A simple library to work with JSON Web Token and JSON Web Signature", 64 | "keywords": [ 65 | "JWS", 66 | "jwt" 67 | ], 68 | "funding": [ 69 | { 70 | "url": "https://github.com/lcobucci", 71 | "type": "github" 72 | }, 73 | { 74 | "url": "https://www.patreon.com/lcobucci", 75 | "type": "patreon" 76 | } 77 | ], 78 | "time": "2020-08-20T13:22:28+00:00" 79 | }, 80 | { 81 | "name": "league/flysystem", 82 | "version": "1.1.3", 83 | "source": { 84 | "type": "git", 85 | "url": "https://github.com/thephpleague/flysystem.git", 86 | "reference": "9be3b16c877d477357c015cec057548cf9b2a14a" 87 | }, 88 | "dist": { 89 | "type": "zip", 90 | "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a", 91 | "reference": "9be3b16c877d477357c015cec057548cf9b2a14a", 92 | "shasum": "", 93 | "mirrors": [ 94 | { 95 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 96 | "preferred": true 97 | } 98 | ] 99 | }, 100 | "require": { 101 | "ext-fileinfo": "*", 102 | "league/mime-type-detection": "^1.3", 103 | "php": "^7.2.5 || ^8.0" 104 | }, 105 | "conflict": { 106 | "league/flysystem-sftp": "<1.0.6" 107 | }, 108 | "require-dev": { 109 | "phpspec/prophecy": "^1.11.1", 110 | "phpunit/phpunit": "^8.5.8" 111 | }, 112 | "suggest": { 113 | "ext-fileinfo": "Required for MimeType", 114 | "ext-ftp": "Allows you to use FTP server storage", 115 | "ext-openssl": "Allows you to use FTPS server storage", 116 | "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", 117 | "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", 118 | "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", 119 | "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", 120 | "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", 121 | "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", 122 | "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", 123 | "league/flysystem-webdav": "Allows you to use WebDAV storage", 124 | "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", 125 | "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", 126 | "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" 127 | }, 128 | "type": "library", 129 | "extra": { 130 | "branch-alias": { 131 | "dev-master": "1.1-dev" 132 | } 133 | }, 134 | "autoload": { 135 | "psr-4": { 136 | "League\\Flysystem\\": "src/" 137 | } 138 | }, 139 | "notification-url": "https://packagist.org/downloads/", 140 | "license": [ 141 | "MIT" 142 | ], 143 | "authors": [ 144 | { 145 | "name": "Frank de Jonge", 146 | "email": "info@frenky.net" 147 | } 148 | ], 149 | "description": "Filesystem abstraction: Many filesystems, one API.", 150 | "keywords": [ 151 | "Cloud Files", 152 | "WebDAV", 153 | "abstraction", 154 | "aws", 155 | "cloud", 156 | "copy.com", 157 | "dropbox", 158 | "file systems", 159 | "files", 160 | "filesystem", 161 | "filesystems", 162 | "ftp", 163 | "rackspace", 164 | "remote", 165 | "s3", 166 | "sftp", 167 | "storage" 168 | ], 169 | "funding": [ 170 | { 171 | "url": "https://offset.earth/frankdejonge", 172 | "type": "other" 173 | } 174 | ], 175 | "time": "2020-08-23T07:39:11+00:00" 176 | }, 177 | { 178 | "name": "league/flysystem-cached-adapter", 179 | "version": "1.1.0", 180 | "source": { 181 | "type": "git", 182 | "url": "https://github.com/thephpleague/flysystem-cached-adapter.git", 183 | "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff" 184 | }, 185 | "dist": { 186 | "type": "zip", 187 | "url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/d1925efb2207ac4be3ad0c40b8277175f99ffaff", 188 | "reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff", 189 | "shasum": "", 190 | "mirrors": [ 191 | { 192 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 193 | "preferred": true 194 | } 195 | ] 196 | }, 197 | "require": { 198 | "league/flysystem": "~1.0", 199 | "psr/cache": "^1.0.0" 200 | }, 201 | "require-dev": { 202 | "mockery/mockery": "~0.9", 203 | "phpspec/phpspec": "^3.4", 204 | "phpunit/phpunit": "^5.7", 205 | "predis/predis": "~1.0", 206 | "tedivm/stash": "~0.12" 207 | }, 208 | "suggest": { 209 | "ext-phpredis": "Pure C implemented extension for PHP" 210 | }, 211 | "type": "library", 212 | "autoload": { 213 | "psr-4": { 214 | "League\\Flysystem\\Cached\\": "src/" 215 | } 216 | }, 217 | "notification-url": "https://packagist.org/downloads/", 218 | "license": [ 219 | "MIT" 220 | ], 221 | "authors": [ 222 | { 223 | "name": "frankdejonge", 224 | "email": "info@frenky.net" 225 | } 226 | ], 227 | "description": "An adapter decorator to enable meta-data caching.", 228 | "time": "2020-07-25T15:56:04+00:00" 229 | }, 230 | { 231 | "name": "league/mime-type-detection", 232 | "version": "1.4.0", 233 | "source": { 234 | "type": "git", 235 | "url": "https://github.com/thephpleague/mime-type-detection.git", 236 | "reference": "fda190b62b962d96a069fcc414d781db66d65b69" 237 | }, 238 | "dist": { 239 | "type": "zip", 240 | "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/fda190b62b962d96a069fcc414d781db66d65b69", 241 | "reference": "fda190b62b962d96a069fcc414d781db66d65b69", 242 | "shasum": "", 243 | "mirrors": [ 244 | { 245 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 246 | "preferred": true 247 | } 248 | ] 249 | }, 250 | "require": { 251 | "ext-fileinfo": "*", 252 | "php": "^7.2 || ^8.0" 253 | }, 254 | "require-dev": { 255 | "phpstan/phpstan": "^0.12.36", 256 | "phpunit/phpunit": "^8.5.8" 257 | }, 258 | "type": "library", 259 | "autoload": { 260 | "psr-4": { 261 | "League\\MimeTypeDetection\\": "src" 262 | } 263 | }, 264 | "notification-url": "https://packagist.org/downloads/", 265 | "license": [ 266 | "MIT" 267 | ], 268 | "authors": [ 269 | { 270 | "name": "Frank de Jonge", 271 | "email": "info@frankdejonge.nl" 272 | } 273 | ], 274 | "description": "Mime-type detection for Flysystem", 275 | "funding": [ 276 | { 277 | "url": "https://github.com/frankdejonge", 278 | "type": "github" 279 | }, 280 | { 281 | "url": "https://tidelift.com/funding/github/packagist/league/flysystem", 282 | "type": "tidelift" 283 | } 284 | ], 285 | "time": "2020-08-09T10:34:01+00:00" 286 | }, 287 | { 288 | "name": "opis/closure", 289 | "version": "3.5.6", 290 | "source": { 291 | "type": "git", 292 | "url": "https://github.com/opis/closure.git", 293 | "reference": "e8d34df855b0a0549a300cb8cb4db472556e8aa9" 294 | }, 295 | "dist": { 296 | "type": "zip", 297 | "url": "https://api.github.com/repos/opis/closure/zipball/e8d34df855b0a0549a300cb8cb4db472556e8aa9", 298 | "reference": "e8d34df855b0a0549a300cb8cb4db472556e8aa9", 299 | "shasum": "", 300 | "mirrors": [ 301 | { 302 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 303 | "preferred": true 304 | } 305 | ] 306 | }, 307 | "require": { 308 | "php": "^5.4 || ^7.0" 309 | }, 310 | "require-dev": { 311 | "jeremeamia/superclosure": "^2.0", 312 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 313 | }, 314 | "type": "library", 315 | "extra": { 316 | "branch-alias": { 317 | "dev-master": "3.5.x-dev" 318 | } 319 | }, 320 | "autoload": { 321 | "psr-4": { 322 | "Opis\\Closure\\": "src/" 323 | }, 324 | "files": [ 325 | "functions.php" 326 | ] 327 | }, 328 | "notification-url": "https://packagist.org/downloads/", 329 | "license": [ 330 | "MIT" 331 | ], 332 | "authors": [ 333 | { 334 | "name": "Marius Sarca", 335 | "email": "marius.sarca@gmail.com" 336 | }, 337 | { 338 | "name": "Sorin Sarca", 339 | "email": "sarca_sorin@hotmail.com" 340 | } 341 | ], 342 | "description": "A library that can be used to serialize closures (anonymous functions) and arbitrary objects.", 343 | "homepage": "https://opis.io/closure", 344 | "keywords": [ 345 | "anonymous functions", 346 | "closure", 347 | "function", 348 | "serializable", 349 | "serialization", 350 | "serialize" 351 | ], 352 | "time": "2020-08-11T08:46:50+00:00" 353 | }, 354 | { 355 | "name": "psr/cache", 356 | "version": "1.0.1", 357 | "source": { 358 | "type": "git", 359 | "url": "https://github.com/php-fig/cache.git", 360 | "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" 361 | }, 362 | "dist": { 363 | "type": "zip", 364 | "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", 365 | "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", 366 | "shasum": "", 367 | "mirrors": [ 368 | { 369 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 370 | "preferred": true 371 | } 372 | ] 373 | }, 374 | "require": { 375 | "php": ">=5.3.0" 376 | }, 377 | "type": "library", 378 | "extra": { 379 | "branch-alias": { 380 | "dev-master": "1.0.x-dev" 381 | } 382 | }, 383 | "autoload": { 384 | "psr-4": { 385 | "Psr\\Cache\\": "src/" 386 | } 387 | }, 388 | "notification-url": "https://packagist.org/downloads/", 389 | "license": [ 390 | "MIT" 391 | ], 392 | "authors": [ 393 | { 394 | "name": "PHP-FIG", 395 | "homepage": "http://www.php-fig.org/" 396 | } 397 | ], 398 | "description": "Common interface for caching libraries", 399 | "keywords": [ 400 | "cache", 401 | "psr", 402 | "psr-6" 403 | ], 404 | "time": "2016-08-06T20:24:11+00:00" 405 | }, 406 | { 407 | "name": "psr/container", 408 | "version": "1.0.0", 409 | "source": { 410 | "type": "git", 411 | "url": "https://github.com/php-fig/container.git", 412 | "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" 413 | }, 414 | "dist": { 415 | "type": "zip", 416 | "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 417 | "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", 418 | "shasum": "", 419 | "mirrors": [ 420 | { 421 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 422 | "preferred": true 423 | } 424 | ] 425 | }, 426 | "require": { 427 | "php": ">=5.3.0" 428 | }, 429 | "type": "library", 430 | "extra": { 431 | "branch-alias": { 432 | "dev-master": "1.0.x-dev" 433 | } 434 | }, 435 | "autoload": { 436 | "psr-4": { 437 | "Psr\\Container\\": "src/" 438 | } 439 | }, 440 | "notification-url": "https://packagist.org/downloads/", 441 | "license": [ 442 | "MIT" 443 | ], 444 | "authors": [ 445 | { 446 | "name": "PHP-FIG", 447 | "homepage": "http://www.php-fig.org/" 448 | } 449 | ], 450 | "description": "Common Container Interface (PHP FIG PSR-11)", 451 | "homepage": "https://github.com/php-fig/container", 452 | "keywords": [ 453 | "PSR-11", 454 | "container", 455 | "container-interface", 456 | "container-interop", 457 | "psr" 458 | ], 459 | "time": "2017-02-14T16:28:37+00:00" 460 | }, 461 | { 462 | "name": "psr/log", 463 | "version": "1.1.3", 464 | "source": { 465 | "type": "git", 466 | "url": "https://github.com/php-fig/log.git", 467 | "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" 468 | }, 469 | "dist": { 470 | "type": "zip", 471 | "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", 472 | "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", 473 | "shasum": "", 474 | "mirrors": [ 475 | { 476 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 477 | "preferred": true 478 | } 479 | ] 480 | }, 481 | "require": { 482 | "php": ">=5.3.0" 483 | }, 484 | "type": "library", 485 | "extra": { 486 | "branch-alias": { 487 | "dev-master": "1.1.x-dev" 488 | } 489 | }, 490 | "autoload": { 491 | "psr-4": { 492 | "Psr\\Log\\": "Psr/Log/" 493 | } 494 | }, 495 | "notification-url": "https://packagist.org/downloads/", 496 | "license": [ 497 | "MIT" 498 | ], 499 | "authors": [ 500 | { 501 | "name": "PHP-FIG", 502 | "homepage": "http://www.php-fig.org/" 503 | } 504 | ], 505 | "description": "Common interface for logging libraries", 506 | "homepage": "https://github.com/php-fig/log", 507 | "keywords": [ 508 | "log", 509 | "psr", 510 | "psr-3" 511 | ], 512 | "time": "2020-03-23T09:12:05+00:00" 513 | }, 514 | { 515 | "name": "psr/simple-cache", 516 | "version": "1.0.1", 517 | "source": { 518 | "type": "git", 519 | "url": "https://github.com/php-fig/simple-cache.git", 520 | "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" 521 | }, 522 | "dist": { 523 | "type": "zip", 524 | "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 525 | "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", 526 | "shasum": "", 527 | "mirrors": [ 528 | { 529 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 530 | "preferred": true 531 | } 532 | ] 533 | }, 534 | "require": { 535 | "php": ">=5.3.0" 536 | }, 537 | "type": "library", 538 | "extra": { 539 | "branch-alias": { 540 | "dev-master": "1.0.x-dev" 541 | } 542 | }, 543 | "autoload": { 544 | "psr-4": { 545 | "Psr\\SimpleCache\\": "src/" 546 | } 547 | }, 548 | "notification-url": "https://packagist.org/downloads/", 549 | "license": [ 550 | "MIT" 551 | ], 552 | "authors": [ 553 | { 554 | "name": "PHP-FIG", 555 | "homepage": "http://www.php-fig.org/" 556 | } 557 | ], 558 | "description": "Common interfaces for simple caching", 559 | "keywords": [ 560 | "cache", 561 | "caching", 562 | "psr", 563 | "psr-16", 564 | "simple-cache" 565 | ], 566 | "time": "2017-10-23T01:57:42+00:00" 567 | }, 568 | { 569 | "name": "thans/tp-jwt-auth", 570 | "version": "v1.1", 571 | "source": { 572 | "type": "git", 573 | "url": "https://github.com/QThans/jwt-auth.git", 574 | "reference": "1dd7937317faf4958b16d4c11f4e04cfd3e33a43" 575 | }, 576 | "dist": { 577 | "type": "zip", 578 | "url": "https://api.github.com/repos/QThans/jwt-auth/zipball/1dd7937317faf4958b16d4c11f4e04cfd3e33a43", 579 | "reference": "1dd7937317faf4958b16d4c11f4e04cfd3e33a43", 580 | "shasum": "", 581 | "mirrors": [ 582 | { 583 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 584 | "preferred": true 585 | } 586 | ] 587 | }, 588 | "require": { 589 | "lcobucci/jwt": "^3.3", 590 | "php": "^7.0", 591 | "topthink/framework": "^5.1.10 || ^6.0.0" 592 | }, 593 | "type": "library", 594 | "extra": { 595 | "think": { 596 | "services": [ 597 | "thans\\jwt\\Service" 598 | ], 599 | "config": { 600 | "jwt": "config/config.php" 601 | } 602 | } 603 | }, 604 | "autoload": { 605 | "psr-4": { 606 | "thans\\jwt\\": "src" 607 | }, 608 | "files": [ 609 | "src/helper.php" 610 | ] 611 | }, 612 | "notification-url": "https://packagist.org/downloads/", 613 | "license": [ 614 | "MIT" 615 | ], 616 | "authors": [ 617 | { 618 | "name": "Thans", 619 | "email": "360641274@qq.com" 620 | } 621 | ], 622 | "description": "thinkphp jwt auth composer", 623 | "time": "2020-04-28T08:38:24+00:00" 624 | }, 625 | { 626 | "name": "topthink/framework", 627 | "version": "v6.0.3", 628 | "source": { 629 | "type": "git", 630 | "url": "https://github.com/top-think/framework.git", 631 | "reference": "b4046fb21e6163ba23a792b694162693dbe71b4b" 632 | }, 633 | "dist": { 634 | "type": "zip", 635 | "url": "https://api.github.com/repos/top-think/framework/zipball/b4046fb21e6163ba23a792b694162693dbe71b4b", 636 | "reference": "b4046fb21e6163ba23a792b694162693dbe71b4b", 637 | "shasum": "", 638 | "mirrors": [ 639 | { 640 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 641 | "preferred": true 642 | } 643 | ] 644 | }, 645 | "require": { 646 | "ext-json": "*", 647 | "ext-mbstring": "*", 648 | "league/flysystem": "^1.0", 649 | "league/flysystem-cached-adapter": "^1.0", 650 | "opis/closure": "^3.1", 651 | "php": ">=7.1.0", 652 | "psr/container": "~1.0", 653 | "psr/log": "~1.0", 654 | "psr/simple-cache": "^1.0", 655 | "topthink/think-helper": "^3.1.1", 656 | "topthink/think-orm": "^2.0" 657 | }, 658 | "require-dev": { 659 | "mikey179/vfsstream": "^1.6", 660 | "mockery/mockery": "^1.2", 661 | "phpunit/phpunit": "^7.0" 662 | }, 663 | "type": "library", 664 | "autoload": { 665 | "files": [], 666 | "psr-4": { 667 | "think\\": "src/think/" 668 | } 669 | }, 670 | "notification-url": "https://packagist.org/downloads/", 671 | "license": [ 672 | "Apache-2.0" 673 | ], 674 | "authors": [ 675 | { 676 | "name": "liu21st", 677 | "email": "liu21st@gmail.com" 678 | }, 679 | { 680 | "name": "yunwuxin", 681 | "email": "448901948@qq.com" 682 | } 683 | ], 684 | "description": "The ThinkPHP Framework.", 685 | "homepage": "http://thinkphp.cn/", 686 | "keywords": [ 687 | "framework", 688 | "orm", 689 | "thinkphp" 690 | ], 691 | "time": "2020-06-26T16:03:10+00:00" 692 | }, 693 | { 694 | "name": "topthink/think-helper", 695 | "version": "v3.1.4", 696 | "source": { 697 | "type": "git", 698 | "url": "https://github.com/top-think/think-helper.git", 699 | "reference": "c28d37743bda4a0455286ca85b17b5791d626e10" 700 | }, 701 | "dist": { 702 | "type": "zip", 703 | "url": "https://api.github.com/repos/top-think/think-helper/zipball/c28d37743bda4a0455286ca85b17b5791d626e10", 704 | "reference": "c28d37743bda4a0455286ca85b17b5791d626e10", 705 | "shasum": "", 706 | "mirrors": [ 707 | { 708 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 709 | "preferred": true 710 | } 711 | ] 712 | }, 713 | "require": { 714 | "php": ">=7.1.0" 715 | }, 716 | "type": "library", 717 | "autoload": { 718 | "psr-4": { 719 | "think\\": "src" 720 | }, 721 | "files": [ 722 | "src/helper.php" 723 | ] 724 | }, 725 | "notification-url": "https://packagist.org/downloads/", 726 | "license": [ 727 | "Apache-2.0" 728 | ], 729 | "authors": [ 730 | { 731 | "name": "yunwuxin", 732 | "email": "448901948@qq.com" 733 | } 734 | ], 735 | "description": "The ThinkPHP6 Helper Package", 736 | "time": "2019-11-08T08:01:10+00:00" 737 | }, 738 | { 739 | "name": "topthink/think-migration", 740 | "version": "v3.0.2", 741 | "source": { 742 | "type": "git", 743 | "url": "https://github.com/top-think/think-migration.git", 744 | "reference": "e8b3396505617732a57309d2818d70ffe187385c" 745 | }, 746 | "dist": { 747 | "type": "zip", 748 | "url": "https://api.github.com/repos/top-think/think-migration/zipball/e8b3396505617732a57309d2818d70ffe187385c", 749 | "reference": "e8b3396505617732a57309d2818d70ffe187385c", 750 | "shasum": "", 751 | "mirrors": [ 752 | { 753 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 754 | "preferred": true 755 | } 756 | ] 757 | }, 758 | "require": { 759 | "topthink/framework": "^6.0.0", 760 | "topthink/think-helper": "^3.0.3" 761 | }, 762 | "require-dev": { 763 | "fzaninotto/faker": "^1.8" 764 | }, 765 | "suggest": { 766 | "fzaninotto/faker": "Required to use the factory builder (^1.8)." 767 | }, 768 | "type": "library", 769 | "extra": { 770 | "think": { 771 | "services": [ 772 | "think\\migration\\Service" 773 | ] 774 | } 775 | }, 776 | "autoload": { 777 | "psr-4": { 778 | "Phinx\\": "phinx/src/Phinx", 779 | "think\\migration\\": "src" 780 | } 781 | }, 782 | "notification-url": "https://packagist.org/downloads/", 783 | "license": [ 784 | "Apache-2.0" 785 | ], 786 | "authors": [ 787 | { 788 | "name": "yunwuxin", 789 | "email": "448901948@qq.com" 790 | } 791 | ], 792 | "time": "2019-06-17T10:13:39+00:00" 793 | }, 794 | { 795 | "name": "topthink/think-orm", 796 | "version": "v2.0.33", 797 | "source": { 798 | "type": "git", 799 | "url": "https://github.com/top-think/think-orm.git", 800 | "reference": "35ca511a1e4d671b39f7afb4c887703c16ef6957" 801 | }, 802 | "dist": { 803 | "type": "zip", 804 | "url": "https://api.github.com/repos/top-think/think-orm/zipball/35ca511a1e4d671b39f7afb4c887703c16ef6957", 805 | "reference": "35ca511a1e4d671b39f7afb4c887703c16ef6957", 806 | "shasum": "", 807 | "mirrors": [ 808 | { 809 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 810 | "preferred": true 811 | } 812 | ] 813 | }, 814 | "require": { 815 | "ext-json": "*", 816 | "php": ">=7.1.0", 817 | "psr/log": "~1.0", 818 | "psr/simple-cache": "^1.0", 819 | "topthink/think-helper": "^3.1" 820 | }, 821 | "type": "library", 822 | "autoload": { 823 | "psr-4": { 824 | "think\\": "src" 825 | }, 826 | "files": [] 827 | }, 828 | "notification-url": "https://packagist.org/downloads/", 829 | "license": [ 830 | "Apache-2.0" 831 | ], 832 | "authors": [ 833 | { 834 | "name": "liu21st", 835 | "email": "liu21st@gmail.com" 836 | } 837 | ], 838 | "description": "think orm", 839 | "keywords": [ 840 | "database", 841 | "orm" 842 | ], 843 | "time": "2020-06-22T14:57:28+00:00" 844 | } 845 | ], 846 | "packages-dev": [ 847 | { 848 | "name": "symfony/polyfill-mbstring", 849 | "version": "v1.18.1", 850 | "source": { 851 | "type": "git", 852 | "url": "https://github.com/symfony/polyfill-mbstring.git", 853 | "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" 854 | }, 855 | "dist": { 856 | "type": "zip", 857 | "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", 858 | "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", 859 | "shasum": "", 860 | "mirrors": [ 861 | { 862 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 863 | "preferred": true 864 | } 865 | ] 866 | }, 867 | "require": { 868 | "php": ">=5.3.3" 869 | }, 870 | "suggest": { 871 | "ext-mbstring": "For best performance" 872 | }, 873 | "type": "library", 874 | "extra": { 875 | "branch-alias": { 876 | "dev-master": "1.18-dev" 877 | }, 878 | "thanks": { 879 | "name": "symfony/polyfill", 880 | "url": "https://github.com/symfony/polyfill" 881 | } 882 | }, 883 | "autoload": { 884 | "psr-4": { 885 | "Symfony\\Polyfill\\Mbstring\\": "" 886 | }, 887 | "files": [ 888 | "bootstrap.php" 889 | ] 890 | }, 891 | "notification-url": "https://packagist.org/downloads/", 892 | "license": [ 893 | "MIT" 894 | ], 895 | "authors": [ 896 | { 897 | "name": "Nicolas Grekas", 898 | "email": "p@tchwork.com" 899 | }, 900 | { 901 | "name": "Symfony Community", 902 | "homepage": "https://symfony.com/contributors" 903 | } 904 | ], 905 | "description": "Symfony polyfill for the Mbstring extension", 906 | "homepage": "https://symfony.com", 907 | "keywords": [ 908 | "compatibility", 909 | "mbstring", 910 | "polyfill", 911 | "portable", 912 | "shim" 913 | ], 914 | "funding": [ 915 | { 916 | "url": "https://symfony.com/sponsor", 917 | "type": "custom" 918 | }, 919 | { 920 | "url": "https://github.com/fabpot", 921 | "type": "github" 922 | }, 923 | { 924 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 925 | "type": "tidelift" 926 | } 927 | ], 928 | "time": "2020-07-14T12:35:20+00:00" 929 | }, 930 | { 931 | "name": "symfony/polyfill-php72", 932 | "version": "v1.18.1", 933 | "source": { 934 | "type": "git", 935 | "url": "https://github.com/symfony/polyfill-php72.git", 936 | "reference": "639447d008615574653fb3bc60d1986d7172eaae" 937 | }, 938 | "dist": { 939 | "type": "zip", 940 | "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae", 941 | "reference": "639447d008615574653fb3bc60d1986d7172eaae", 942 | "shasum": "", 943 | "mirrors": [ 944 | { 945 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 946 | "preferred": true 947 | } 948 | ] 949 | }, 950 | "require": { 951 | "php": ">=5.3.3" 952 | }, 953 | "type": "library", 954 | "extra": { 955 | "branch-alias": { 956 | "dev-master": "1.18-dev" 957 | }, 958 | "thanks": { 959 | "name": "symfony/polyfill", 960 | "url": "https://github.com/symfony/polyfill" 961 | } 962 | }, 963 | "autoload": { 964 | "psr-4": { 965 | "Symfony\\Polyfill\\Php72\\": "" 966 | }, 967 | "files": [ 968 | "bootstrap.php" 969 | ] 970 | }, 971 | "notification-url": "https://packagist.org/downloads/", 972 | "license": [ 973 | "MIT" 974 | ], 975 | "authors": [ 976 | { 977 | "name": "Nicolas Grekas", 978 | "email": "p@tchwork.com" 979 | }, 980 | { 981 | "name": "Symfony Community", 982 | "homepage": "https://symfony.com/contributors" 983 | } 984 | ], 985 | "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", 986 | "homepage": "https://symfony.com", 987 | "keywords": [ 988 | "compatibility", 989 | "polyfill", 990 | "portable", 991 | "shim" 992 | ], 993 | "funding": [ 994 | { 995 | "url": "https://symfony.com/sponsor", 996 | "type": "custom" 997 | }, 998 | { 999 | "url": "https://github.com/fabpot", 1000 | "type": "github" 1001 | }, 1002 | { 1003 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1004 | "type": "tidelift" 1005 | } 1006 | ], 1007 | "time": "2020-07-14T12:35:20+00:00" 1008 | }, 1009 | { 1010 | "name": "symfony/polyfill-php80", 1011 | "version": "v1.18.1", 1012 | "source": { 1013 | "type": "git", 1014 | "url": "https://github.com/symfony/polyfill-php80.git", 1015 | "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981" 1016 | }, 1017 | "dist": { 1018 | "type": "zip", 1019 | "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981", 1020 | "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981", 1021 | "shasum": "", 1022 | "mirrors": [ 1023 | { 1024 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1025 | "preferred": true 1026 | } 1027 | ] 1028 | }, 1029 | "require": { 1030 | "php": ">=7.0.8" 1031 | }, 1032 | "type": "library", 1033 | "extra": { 1034 | "branch-alias": { 1035 | "dev-master": "1.18-dev" 1036 | }, 1037 | "thanks": { 1038 | "name": "symfony/polyfill", 1039 | "url": "https://github.com/symfony/polyfill" 1040 | } 1041 | }, 1042 | "autoload": { 1043 | "psr-4": { 1044 | "Symfony\\Polyfill\\Php80\\": "" 1045 | }, 1046 | "files": [ 1047 | "bootstrap.php" 1048 | ], 1049 | "classmap": [ 1050 | "Resources/stubs" 1051 | ] 1052 | }, 1053 | "notification-url": "https://packagist.org/downloads/", 1054 | "license": [ 1055 | "MIT" 1056 | ], 1057 | "authors": [ 1058 | { 1059 | "name": "Ion Bazan", 1060 | "email": "ion.bazan@gmail.com" 1061 | }, 1062 | { 1063 | "name": "Nicolas Grekas", 1064 | "email": "p@tchwork.com" 1065 | }, 1066 | { 1067 | "name": "Symfony Community", 1068 | "homepage": "https://symfony.com/contributors" 1069 | } 1070 | ], 1071 | "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", 1072 | "homepage": "https://symfony.com", 1073 | "keywords": [ 1074 | "compatibility", 1075 | "polyfill", 1076 | "portable", 1077 | "shim" 1078 | ], 1079 | "funding": [ 1080 | { 1081 | "url": "https://symfony.com/sponsor", 1082 | "type": "custom" 1083 | }, 1084 | { 1085 | "url": "https://github.com/fabpot", 1086 | "type": "github" 1087 | }, 1088 | { 1089 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1090 | "type": "tidelift" 1091 | } 1092 | ], 1093 | "time": "2020-07-14T12:35:20+00:00" 1094 | }, 1095 | { 1096 | "name": "symfony/var-dumper", 1097 | "version": "v4.4.11", 1098 | "source": { 1099 | "type": "git", 1100 | "url": "https://github.com/symfony/var-dumper.git", 1101 | "reference": "2125805a1a4e57f2340bc566c3013ca94d2722dc" 1102 | }, 1103 | "dist": { 1104 | "type": "zip", 1105 | "url": "https://api.github.com/repos/symfony/var-dumper/zipball/2125805a1a4e57f2340bc566c3013ca94d2722dc", 1106 | "reference": "2125805a1a4e57f2340bc566c3013ca94d2722dc", 1107 | "shasum": "", 1108 | "mirrors": [ 1109 | { 1110 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1111 | "preferred": true 1112 | } 1113 | ] 1114 | }, 1115 | "require": { 1116 | "php": ">=7.1.3", 1117 | "symfony/polyfill-mbstring": "~1.0", 1118 | "symfony/polyfill-php72": "~1.5", 1119 | "symfony/polyfill-php80": "^1.15" 1120 | }, 1121 | "conflict": { 1122 | "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", 1123 | "symfony/console": "<3.4" 1124 | }, 1125 | "require-dev": { 1126 | "ext-iconv": "*", 1127 | "symfony/console": "^3.4|^4.0|^5.0", 1128 | "symfony/process": "^4.4|^5.0", 1129 | "twig/twig": "^1.34|^2.4|^3.0" 1130 | }, 1131 | "suggest": { 1132 | "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", 1133 | "ext-intl": "To show region name in time zone dump", 1134 | "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" 1135 | }, 1136 | "bin": [ 1137 | "Resources/bin/var-dump-server" 1138 | ], 1139 | "type": "library", 1140 | "extra": { 1141 | "branch-alias": { 1142 | "dev-master": "4.4-dev" 1143 | } 1144 | }, 1145 | "autoload": { 1146 | "files": [ 1147 | "Resources/functions/dump.php" 1148 | ], 1149 | "psr-4": { 1150 | "Symfony\\Component\\VarDumper\\": "" 1151 | }, 1152 | "exclude-from-classmap": [ 1153 | "/Tests/" 1154 | ] 1155 | }, 1156 | "notification-url": "https://packagist.org/downloads/", 1157 | "license": [ 1158 | "MIT" 1159 | ], 1160 | "authors": [ 1161 | { 1162 | "name": "Nicolas Grekas", 1163 | "email": "p@tchwork.com" 1164 | }, 1165 | { 1166 | "name": "Symfony Community", 1167 | "homepage": "https://symfony.com/contributors" 1168 | } 1169 | ], 1170 | "description": "Symfony mechanism for exploring and dumping PHP variables", 1171 | "homepage": "https://symfony.com", 1172 | "keywords": [ 1173 | "debug", 1174 | "dump" 1175 | ], 1176 | "funding": [ 1177 | { 1178 | "url": "https://symfony.com/sponsor", 1179 | "type": "custom" 1180 | }, 1181 | { 1182 | "url": "https://github.com/fabpot", 1183 | "type": "github" 1184 | }, 1185 | { 1186 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1187 | "type": "tidelift" 1188 | } 1189 | ], 1190 | "time": "2020-06-24T13:34:53+00:00" 1191 | }, 1192 | { 1193 | "name": "topthink/think-trace", 1194 | "version": "v1.3", 1195 | "source": { 1196 | "type": "git", 1197 | "url": "https://github.com/top-think/think-trace.git", 1198 | "reference": "d8da2e39df268ab8775013de699f0c3012e51318" 1199 | }, 1200 | "dist": { 1201 | "type": "zip", 1202 | "url": "https://api.github.com/repos/top-think/think-trace/zipball/d8da2e39df268ab8775013de699f0c3012e51318", 1203 | "reference": "d8da2e39df268ab8775013de699f0c3012e51318", 1204 | "shasum": "", 1205 | "mirrors": [ 1206 | { 1207 | "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", 1208 | "preferred": true 1209 | } 1210 | ] 1211 | }, 1212 | "require": { 1213 | "php": ">=7.1.0", 1214 | "topthink/framework": "^6.0.0" 1215 | }, 1216 | "type": "library", 1217 | "extra": { 1218 | "think": { 1219 | "services": [ 1220 | "think\\trace\\Service" 1221 | ], 1222 | "config": { 1223 | "trace": "src/config.php" 1224 | } 1225 | } 1226 | }, 1227 | "autoload": { 1228 | "psr-4": { 1229 | "think\\trace\\": "src" 1230 | } 1231 | }, 1232 | "notification-url": "https://packagist.org/downloads/", 1233 | "license": [ 1234 | "Apache-2.0" 1235 | ], 1236 | "authors": [ 1237 | { 1238 | "name": "liu21st", 1239 | "email": "liu21st@gmail.com" 1240 | } 1241 | ], 1242 | "description": "thinkphp debug trace", 1243 | "time": "2020-03-18T07:59:53+00:00" 1244 | } 1245 | ], 1246 | "aliases": [], 1247 | "minimum-stability": "stable", 1248 | "stability-flags": [], 1249 | "prefer-stable": false, 1250 | "prefer-lowest": false, 1251 | "platform": { 1252 | "php": ">=7.1.0" 1253 | }, 1254 | "platform-dev": [], 1255 | "plugin-api-version": "1.1.0" 1256 | } 1257 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | 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 | ]; 33 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | 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 | ]; 30 | -------------------------------------------------------------------------------- /config/console.php: -------------------------------------------------------------------------------- 1 | [ 8 | ], 9 | ]; 10 | -------------------------------------------------------------------------------- /config/cookie.php: -------------------------------------------------------------------------------- 1 | 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 | ]; 19 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | 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 | // 数据库连接配置信息 19 | 'connections' => [ 20 | 'mysql' => [ 21 | // 数据库类型 22 | 'type' => env('database.type', 'mysql'), 23 | // 服务器地址 24 | 'hostname' => env('database.hostname', '127.0.0.1'), 25 | // 数据库名 26 | 'database' => env('database.database', ''), 27 | // 用户名 28 | 'username' => env('database.username', 'root'), 29 | // 密码 30 | 'password' => env('database.password', ''), 31 | // 端口 32 | 'hostport' => env('database.hostport', '3306'), 33 | // 数据库连接参数 34 | 'params' => [], 35 | // 数据库编码默认采用utf8 36 | 'charset' => env('database.charset', 'utf8'), 37 | // 数据库表前缀 38 | 'prefix' => env('database.prefix', ''), 39 | 40 | // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) 41 | 'deploy' => 0, 42 | // 数据库读写是否分离 主从式有效 43 | 'rw_separate' => false, 44 | // 读写分离后 主服务器数量 45 | 'master_num' => 1, 46 | // 指定从服务器序号 47 | 'slave_no' => '', 48 | // 是否严格检查字段是否存在 49 | 'fields_strict' => true, 50 | // 是否需要断线重连 51 | 'break_reconnect' => false, 52 | // 监听SQL 53 | 'trigger_sql' => env('app_debug', true), 54 | // 开启字段缓存 55 | 'fields_cache' => false, 56 | // 字段缓存路径 57 | 'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR, 58 | ], 59 | 60 | // 更多的数据库配置信息 61 | ], 62 | ]; 63 | -------------------------------------------------------------------------------- /config/filesystem.php: -------------------------------------------------------------------------------- 1 | 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 | ]; 25 | -------------------------------------------------------------------------------- /config/jwt.php: -------------------------------------------------------------------------------- 1 | env('JWT_SECRET'), 6 | //Asymmetric key 7 | 'public_key' => env('JWT_PUBLIC_KEY'), 8 | 'private_key' => env('JWT_PRIVATE_KEY'), 9 | 'password' => env('JWT_PASSWORD'), 10 | //JWT time to live 11 | 'ttl' => env('JWT_TTL', 60), 12 | //Refresh time to live 13 | 'refresh_ttl' => env('JWT_REFRESH_TTL', 20160), 14 | //JWT hashing algorithm 15 | 'algo' => env('JWT_ALGO', 'HS256'), 16 | 17 | 'blacklist_storage' => thans\jwt\provider\storage\Tp5::class, 18 | ]; 19 | -------------------------------------------------------------------------------- /config/lang.php: -------------------------------------------------------------------------------- 1 | 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 | // 扩展语言包 18 | 'extend_list' => [], 19 | // Accept-Language转义为对应语言包名称 20 | 'accept_language' => [ 21 | 'zh-hans-cn' => 'zh-cn', 22 | ], 23 | // 是否支持语言分组 24 | 'allow_group' => false, 25 | ]; 26 | -------------------------------------------------------------------------------- /config/log.php: -------------------------------------------------------------------------------- 1 | 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 | ]; 46 | -------------------------------------------------------------------------------- /config/middleware.php: -------------------------------------------------------------------------------- 1 | [], 6 | // 优先级设置,此数组中的中间件会按照数组中的顺序优先执行 7 | 'priority' => [], 8 | ]; 9 | -------------------------------------------------------------------------------- /config/route.php: -------------------------------------------------------------------------------- 1 | '/', 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 | ]; 46 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | '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 | ]; 20 | -------------------------------------------------------------------------------- /config/trace.php: -------------------------------------------------------------------------------- 1 | 'Html', 8 | // 读取的日志通道名 9 | 'channel' => '', 10 | ]; 11 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | '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 | ]; 26 | -------------------------------------------------------------------------------- /database/migrations/20200827035529_users.php: -------------------------------------------------------------------------------- 1 | table('users'); 13 | $table->addColumn('name', 'string') 14 | ->addColumn('email', 'string') 15 | ->addColumn('password', 'string') 16 | ->addColumn('avatar', 'string', ['null' => true, 'default'=>NULL, 'comment'=>'用户头像']) 17 | ->addColumn('god', 'boolean', ['default'=>FALSE, 'comment'=>'管理员']) 18 | ->addTimestamps('created_at', 'updated_at') 19 | ->addIndex('email', ['unique' => true]) 20 | ->create(); 21 | } 22 | /** 23 | * Migrate Down. 24 | */ 25 | public function down() 26 | { 27 | $this->dropTable('users'); 28 | } 29 | } -------------------------------------------------------------------------------- /database/migrations/20200902035529_tweets.php: -------------------------------------------------------------------------------- 1 | table('tweets'); 13 | $table->addColumn('content', 'text') 14 | ->addColumn('user_id', 'integer') 15 | // 统计点赞总数 16 | ->addColumn('likes', 'integer') 17 | // 统计转发总数 18 | ->addColumn('retweets', 'integer') 19 | ->addTimestamps('created_at', 'updated_at') 20 | ->create(); 21 | } 22 | /** 23 | * Migrate Down. 24 | */ 25 | public function down() 26 | { 27 | $this->dropTable('tweets'); 28 | } 29 | } -------------------------------------------------------------------------------- /database/migrations/20200906035529_followers.php: -------------------------------------------------------------------------------- 1 | table('followers'); 13 | $table->addColumn('follower_id', 'integer') 14 | ->addColumn('user_id', 'integer') 15 | ->addTimestamps('created_at', 'updated_at') 16 | ->create(); 17 | } 18 | /** 19 | * Migrate Down. 20 | */ 21 | public function down() 22 | { 23 | $this->dropTable('followers'); 24 | } 25 | } -------------------------------------------------------------------------------- /db/tp6.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AGDholo/tp6-p01-backend-code/923194aead53bb78c5ca1ce69362cb91d6917ce4/db/tp6.db -------------------------------------------------------------------------------- /extend/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 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 | 9 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AGDholo/tp6-p01-backend-code/923194aead53bb78c5ca1ce69362cb91d6917ce4/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 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); 25 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/router.php: -------------------------------------------------------------------------------- 1 | 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 | } 20 | -------------------------------------------------------------------------------- /public/static/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /route/app.php: -------------------------------------------------------------------------------- 1 | console->run(); -------------------------------------------------------------------------------- /view/README.md: -------------------------------------------------------------------------------- 1 | 如果不使用模板,可以删除该目录 --------------------------------------------------------------------------------