From 0b79c6d52c5ed6e2bfbbd56b529b2edae015f1ba Mon Sep 17 00:00:00 2001 From: taoser Date: Wed, 4 Aug 2021 18:44:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=A1=86=E6=9E=B6=E6=A0=B8?= =?UTF-8?q?=E5=BF=83=EF=BC=8C=E6=96=B0=E5=A2=9E=E6=B3=A8=E5=86=8C=E5=8F=91?= =?UTF-8?q?=E5=B8=96=E8=AF=84=E8=AE=BA=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +- app/admin/controller/Set.php | 47 +++++- app/admin/view/set/system/website.html | 90 +++++++++-- app/common/model/Article.php | 6 +- app/common/model/User.php | 4 +- app/index/controller/Article.php | 16 +- app/index/controller/Login.php | 32 ++-- composer.lock | 118 +++++++------- config/taoler.php | 7 +- vendor/composer/InstalledVersions.php | 54 +++---- vendor/composer/installed.json | 146 ++++++++++-------- vendor/composer/installed.php | 54 +++---- .../php-jwt/.github/actions/entrypoint.sh | 18 --- .../php-jwt/.github/workflows/tests.yml | 77 --------- vendor/firebase/php-jwt/README.md | 37 +++++ vendor/firebase/php-jwt/composer.json | 3 + vendor/firebase/php-jwt/src/JWK.php | 2 +- vendor/firebase/php-jwt/src/JWT.php | 44 ++++-- vendor/league/flysystem/composer.json | 1 - .../flysystem/src/CorruptedPathDetected.php | 17 ++ vendor/league/flysystem/src/Filesystem.php | 13 +- vendor/league/flysystem/src/MountManager.php | 2 - .../flysystem/src/Plugin/GetWithMetadata.php | 4 +- .../league/flysystem/src/Plugin/ListPaths.php | 2 +- .../league/flysystem/src/Plugin/ListWith.php | 6 +- vendor/league/flysystem/src/Util.php | 19 +-- vendor/phpmailer/phpmailer/SECURITY.md | 5 + vendor/phpmailer/phpmailer/VERSION | 2 +- .../phpmailer/language/phpmailer.lang-ar.php | 3 +- vendor/phpmailer/phpmailer/src/PHPMailer.php | 42 +++-- vendor/phpmailer/phpmailer/src/POP3.php | 2 +- vendor/phpmailer/phpmailer/src/SMTP.php | 3 +- vendor/services.php | 2 +- vendor/symfony/polyfill-mbstring/Mbstring.php | 11 +- vendor/symfony/polyfill-php80/README.md | 2 +- vendor/symfony/polyfill-php80/bootstrap.php | 6 +- .../symfony/var-dumper/Caster/ClassStub.php | 4 +- .../var-dumper/Caster/ExceptionCaster.php | 4 +- vendor/symfony/var-dumper/Caster/LinkStub.php | 10 +- .../var-dumper/Caster/MemcachedCaster.php | 2 +- .../var-dumper/Caster/ReflectionCaster.php | 6 +- .../var-dumper/Caster/ResourceCaster.php | 2 +- .../symfony/var-dumper/Caster/SplCaster.php | 2 +- .../var-dumper/Cloner/AbstractCloner.php | 2 +- vendor/symfony/var-dumper/Cloner/Data.php | 9 ++ .../Command/Descriptor/CliDescriptor.php | 2 +- .../Command/Descriptor/HtmlDescriptor.php | 2 +- .../var-dumper/Dumper/AbstractDumper.php | 2 +- .../symfony/var-dumper/Dumper/CliDumper.php | 6 +- .../ContextProvider/SourceContextProvider.php | 4 +- .../symfony/var-dumper/Dumper/HtmlDumper.php | 6 +- .../symfony/var-dumper/Server/Connection.php | 4 +- .../symfony/var-dumper/Server/DumpServer.php | 2 +- vendor/symfony/var-dumper/composer.json | 2 +- vendor/topthink/framework/.travis.yml | 2 +- vendor/topthink/framework/composer.json | 4 +- vendor/topthink/framework/src/think/App.php | 2 +- vendor/topthink/framework/src/think/Event.php | 9 ++ .../topthink/framework/src/think/Request.php | 14 +- .../src/think/console/command/RunServer.php | 2 +- .../framework/src/think/facade/Route.php | 2 +- .../src/think/service/ModelService.php | 6 + .../topthink/think-helper/src/Collection.php | 20 ++- vendor/topthink/think-orm/src/DbManager.php | 2 +- vendor/topthink/think-orm/src/Paginator.php | 2 +- .../topthink/think-orm/src/db/BaseQuery.php | 6 +- vendor/topthink/think-orm/src/db/Builder.php | 4 +- .../think-orm/src/db/PDOConnection.php | 49 +++--- .../src/db/concern/ResultOperation.php | 12 +- .../src/db/exception/DbEventException.php | 19 +++ .../topthink/think-orm/src/model/Relation.php | 22 +++ .../think-orm/src/model/concern/Attribute.php | 4 +- .../src/model/concern/ModelEvent.php | 2 +- .../src/model/concern/SoftDelete.php | 12 +- .../think-orm/src/model/concern/TimeStamp.php | 15 ++ .../think-orm/src/model/concern/Virtual.php | 90 +++++++++++ .../src/model/relation/BelongsToMany.php | 7 +- .../think-orm/src/model/relation/HasMany.php | 4 + .../src/model/relation/HasManyThrough.php | 7 +- .../src/model/relation/MorphToMany.php | 7 +- .../think-orm/src/model/relation/OneToOne.php | 2 + 81 files changed, 831 insertions(+), 468 deletions(-) delete mode 100644 vendor/firebase/php-jwt/.github/actions/entrypoint.sh delete mode 100644 vendor/firebase/php-jwt/.github/workflows/tests.yml create mode 100644 vendor/league/flysystem/src/CorruptedPathDetected.php create mode 100644 vendor/topthink/think-orm/src/db/exception/DbEventException.php create mode 100644 vendor/topthink/think-orm/src/model/concern/Virtual.php diff --git a/README.md b/README.md index 989b57e..2ed05c5 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ * 后台:http://adm.aieok.com:888 * 账号:test * 密码:test123 - * 版本:TaoLer 1.7.28 - * 日期:2021.8.03 + * 版本:TaoLer 1.8.1 + * 日期:2021.8.4 #### 项目地址 diff --git a/app/admin/controller/Set.php b/app/admin/controller/Set.php index a9632fb..334508b 100644 --- a/app/admin/controller/Set.php +++ b/app/admin/controller/Set.php @@ -2,13 +2,14 @@ namespace app\admin\controller; use app\common\controller\AdminController; +use think\exception\ValidateException; use think\facade\View; use think\facade\Request; use think\facade\Db; +use think\facade\Cache; +use think\facade\Config; use app\admin\model\System; use app\admin\model\MailServer; -use think\facade\Config; -use think\exception\ValidateException; use taoler\com\Files; use taoler\com\Api; use app\common\lib\SetConf; @@ -25,7 +26,8 @@ class Set extends AdminController { $mailserver = MailServer::find(1); $template = Files::getDirName('../view'); - View::assign(['sysInfo'=>$this->sysInfo,'mailserver'=>$mailserver,'template'=>$template]); + $email = Db::name('admin')->where('id',1)->value('email'); + View::assign(['sysInfo'=>$this->sysInfo,'mailserver'=>$mailserver,'template'=>$template,'email'=>$email]); return View::fetch('set/system/website'); } @@ -67,6 +69,42 @@ class Set extends AdminController } } } + + public function sendMailCode() + { + if(Request::isPost()){ + $email = Request::param('email'); + $code = mt_rand('1111','9999'); + Cache::set('test_code',$code,600); + $result = mailto($email,'邮箱服务配置','Hi亲爱的管理员:
您正在配置您站点的邮箱服务,配置成功后,可以收到来自网站的发帖,评论等即时信息。请在10分钟内把激活码填入激活码框内,您的激活码为:'.$code); + if($result){ + $res = ['code'=>0,'msg'=>'请去邮箱获取测试码']; + }else{ + $res = ['code'=>-1,'msg'=>'邮箱配置错误或无服务能力,请排查!']; + } + } + return json($res); + } + + public function activeMailServer() + { + if(Request::isPost()){ + $eCode = Request::param('code'); + $sCode = Cache::get('test_code'); + if($eCode == $sCode){ + $result = Db::name('mail_server')->update(['id'=>1,'active'=>1]); + if($result){ + $res = ['code'=>0,'msg'=>'邮箱服务激活成功']; + } else { + $res = ['code'=>-1,'msg'=>'激活服务出错!']; + } + }else{ + $res = ['code'=>-1,'msg'=>'激活码错误!!!']; + } + } + return json($res); + } + /**配置设置 * parem $id */ @@ -75,6 +113,9 @@ class Set extends AdminController $conf = Config::get('taoler.config'); if(Request::isPost()){ $data = Request::param(); + if(!isset($data['regist_check'])) $data['regist_check'] =1; + if(!isset($data['posts_check'])) $data['posts_check'] =1; + if(!isset($data['commnets_check'])) $data['commnets_check'] =1; foreach($conf as $c=>$f){ if(array_key_exists($c,$data)){ diff --git a/app/admin/view/set/system/website.html b/app/admin/view/set/system/website.html index bebf721..a1736e9 100644 --- a/app/admin/view/set/system/website.html +++ b/app/admin/view/set/system/website.html @@ -169,23 +169,65 @@ + {//邮箱发送测试} +
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+ {if($mailserver.active == 1)}
-
是否显示发帖及评论等邮件提醒(需先配置邮箱服务)
+
发帖及评论等邮件提醒(邮箱服务未激活无法设置)
-
+ {/if} +
+ +
+ +
+
注册是否需要审核
+
+
+ +
+ +
+
发帖是否需要审核
+
+
+ +
+ +
+
评论是否需要审核
+
+
是否显示列表及详情所属分类
-
+
@@ -252,24 +294,48 @@ } } }); - + //网站配置 form.on('submit(set_system_config)', function(data){ var field = data.field; $.post("{:url('admin/set/config')}",field,function(res){ if(res.code == 0){ - layer.msg(res.msg,{ - icon:6, - tiye:2000 + layer.msg(res.msg,{icon:6,tiye:2000 },function(){ location.reload(); }); } else { - layer.open({ - title:"设置失败", - content:res.msg, - icon:5, - anim:6 + layer.open({title:"设置失败",content:res.msg,icon:5,anim:6}); + } + }); + return false; + }); + //邮箱发送测试码 + form.on('submit(test_system_email)', function(data){ + var field = data.field; + $.post("{:url('admin/set/sendMailCode')}",field,function(res){ + if(res.code == 0){ + layer.msg(res.msg,{icon:6,tiye:2000 + },function(){ + location.reload(); }); + } else { + layer.open({title:"设置失败",content:res.msg,icon:5,anim:6}); + } + }); + return false; + }); + + //邮箱激活 + form.on('submit(active_system_email)', function(data){ + var field = data.field; + $.post("{:url('admin/set/activeMailServer')}",field,function(res){ + if(res.code == 0){ + layer.msg(res.msg,{icon:6,tiye:2000 + },function(){ + location.reload(); + }); + } else { + layer.open({title:"设置失败",content:res.msg,icon:5,anim:6}); } }); return false; diff --git a/app/common/model/Article.php b/app/common/model/Article.php index 9a59042..80fb622 100644 --- a/app/common/model/Article.php +++ b/app/common/model/Article.php @@ -6,6 +6,7 @@ namespace app\common\model; use think\Model; use think\model\concern\SoftDelete; use think\facade\Cache; +use think\facade\Config; class Article extends Model { @@ -56,10 +57,11 @@ class Article extends Model */ public function add(array $data) { + $data['status'] = Config::get('taoler.config.posts_check'); + $msg = $data['status'] ? '发布成功' : '发布成功,请等待审核'; $result = $this->save($data); - if($result) { - return 1; + return ['code'=>1,'msg'=>$msg]; } else { return 'add_error'; } diff --git a/app/common/model/User.php b/app/common/model/User.php index 35c6dfd..be5eed6 100644 --- a/app/common/model/User.php +++ b/app/common/model/User.php @@ -111,9 +111,11 @@ class User extends Model $data['create_time'] = time(); $salt = substr(md5($data['create_time']),-6); $data['password'] = substr_replace(md5($data['password']),$salt,0,6); + $data['status'] = Config::get('taoler.config.regist_check'); + $msg = $data['status'] ? '注册成功请登录' : '注册成功,请等待审核'; $result = $this->save($data); if ($result) { - return 1; + return ['code'=>1,'msg'=>$msg]; } else{ return '注册失败'; } diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index cde7cca..37e1f17 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -119,6 +119,8 @@ class Article extends BaseController if(empty($data['content'])){ return json(['code'=>0, 'msg'=>'评论不能为空!']); } + $data['status'] = Config::get('taoler.config.commnets_check'); + $msg = $data['status'] ? '留言成功' : '留言成功,请等待审核'; //用户留言存入数据库 if (Comment::create($data)) { @@ -138,7 +140,7 @@ class Article extends BaseController $data = ['title'=>$title,'content'=>'评论通知','link'=>$link,'user_id'=>$sendId,'type'=>2]; //type=2为评论留言 Message::sendMsg($sendId,$receveId,$data); if(Config::get('taoler.config.email_notice')) mailto($this->showUser(1)['email'],'评论审核通知','Hi亲爱的管理员:
用户'.$this->showUser($this->uid)['name'].'刚刚对 '.$title.' 发表了评论,请尽快处理。'); - $res = ['code'=>0, 'msg'=>'留言成功']; + $res = ['code'=>0, 'msg'=>$msg]; } else { $res = ['code'=>-1, 'msg'=>'留言失败']; } @@ -166,13 +168,17 @@ class Article extends BaseController $article = new ArticleModel(); $result = $article->add($data); - if ($result == 1) { - $aid = Db::name('article')->max('id'); - $link = (string)url('article/detail', ['id' => $aid]); + if ($result['code'] == 1) { + if(Config::get('taoler.config.posts_check')){ + $aid = Db::name('article')->max('id'); + $link = (string)url('article/detail', ['id' => $aid]); + }else{ + $link = (string)url('index/'); + } //清除文章tag缓存 Cache::tag('tagArtDetail')->clear(); if(Config::get('taoler.config.email_notice')) mailto($this->showUser(1)['email'],'发帖审核通知','Hi亲爱的管理员:
用户'.$this->showUser($this->uid)['name'].'刚刚发表了 '.$data['title'].' 新的帖子,请尽快处理。'); - $res = Msgres::success('add_success', $link); + $res = Msgres::success($result['msg'], $link); } else { $res = Msgres::error('add_error'); } diff --git a/app/index/controller/Login.php b/app/index/controller/Login.php index ec4f49a..e12d2a7 100644 --- a/app/index/controller/Login.php +++ b/app/index/controller/Login.php @@ -92,20 +92,20 @@ class Login extends BaseController if(Request::isAjax()){ $data = Request::only(['name','email','password','repassword','captcha']); - //校验场景中reg的方法数据 - try{ - validate(userValidate::class) - ->scene('Reg') - ->check($data); - } catch (ValidateException $e) { + //校验场景中reg的方法数据 + try{ + validate(userValidate::class) + ->scene('Reg') + ->check($data); + } catch (ValidateException $e) { return json(['code'=>-1,'msg'=>$e->getError()]); - } + } + + $user = new User(); + $result = $user->reg($data); - $user = new User(); - $result = $user->reg($data); - - if ($result == 1) { - $res = ['code'=>0,'msg'=>'注册成功','url'=>(string) url('login/index')]; + if ($result['code'] == 1) { + $res = ['code'=>0,'msg'=>$result['msg'],'url'=>(string) url('login/index')]; if(Config::get('taoler.config.email_notice')) mailto($this->showUser(1)['email'],'注册新用户通知','Hi亲爱的管理员:
新用户 '.$data['name'].' 刚刚注册了新的账号,请尽快处理。'); }else { $res = ['code'=>-1,'msg'=>$result]; @@ -137,7 +137,7 @@ class Login extends BaseController $result = mailto($data['email'],'重置密码','Hi亲爱的'.$user['name'].':
您正在维护您的信息,请在10分钟内验证,您的验证码为:'.$code); if($result){ - Cache::set('repass',1,60); //设置repass标志为1存入Cache + Cache::set('repass','postcode',60); //设置repass标志为1存入Cache $res = ['code'=>0,'msg'=>'验证码已发送成功,请去邮箱查看!','url'=>(string) url('login/postcode')]; } else { $res = ['code'=>-1,'msg'=>'验证码发送失败!']; @@ -153,7 +153,7 @@ class Login extends BaseController //接收验证码 public function postcode() { - if(Cache::get('repass') != 1){ + if(Cache::get('repass') !== 'postcode'){ return redirect((string) url('login/forget')); } if(Request::isAjax()){ @@ -168,7 +168,7 @@ class Login extends BaseController if(Cache::get('code')==$code['code']) { //无任何输入情况下需排除code为0和Cache为0的情况 //Cache::delete('repass'); - Cache::set('repass',2,60); + Cache::set('repass','resetpass',60); $res = ['code'=>0,'msg'=>'验证成功','url'=>(string) url('login/respass')]; } else { $res = ['code'=>-1,'msg'=>'验证码错误或已过期!']; @@ -181,7 +181,7 @@ class Login extends BaseController //忘记密码找回重置 public function respass() { - if(Cache::get('repass') != 2){ + if(Cache::get('repass') !== 'resetpass'){ return redirect((string) url('login/forget')); } if(Request::isAjax()){ diff --git a/composer.lock b/composer.lock index 9712f99..8be5759 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "firebase/php-jwt", - "version": "v5.3.0", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "3c2d70f2e64e2922345e89f2ceae47d2463faae1" + "reference": "d2113d9b2e0e349796e72d2a63cf9319100382d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/3c2d70f2e64e2922345e89f2ceae47d2463faae1", - "reference": "3c2d70f2e64e2922345e89f2ceae47d2463faae1", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/d2113d9b2e0e349796e72d2a63cf9319100382d2", + "reference": "d2113d9b2e0e349796e72d2a63cf9319100382d2", "shasum": "", "mirrors": [ { @@ -32,6 +32,9 @@ "require-dev": { "phpunit/phpunit": ">=4.8 <=9" }, + "suggest": { + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" + }, "type": "library", "autoload": { "psr-4": { @@ -62,22 +65,22 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v5.3.0" + "source": "https://github.com/firebase/php-jwt/tree/v5.4.0" }, - "time": "2021-05-20T17:37:02+00:00" + "time": "2021-06-23T19:00:23+00:00" }, { "name": "league/flysystem", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "9be3b16c877d477357c015cec057548cf9b2a14a" + "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a", - "reference": "9be3b16c877d477357c015cec057548cf9b2a14a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3ad69181b8afed2c9edf7be5a2918144ff4ea32", + "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32", "shasum": "", "mirrors": [ { @@ -99,7 +102,6 @@ "phpunit/phpunit": "^8.5.8" }, "suggest": { - "ext-fileinfo": "Required for MimeType", "ext-ftp": "Allows you to use FTP server storage", "ext-openssl": "Allows you to use FTPS server storage", "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", @@ -157,7 +159,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.x" + "source": "https://github.com/thephpleague/flysystem/tree/1.1.4" }, "funding": [ { @@ -165,7 +167,7 @@ "type": "other" } ], - "time": "2020-08-23T07:39:11+00:00" + "time": "2021-06-23T21:56:05+00:00" }, { "name": "league/flysystem-cached-adapter", @@ -338,16 +340,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.4.1", + "version": "v6.5.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d" + "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9256f12d8fb0cd0500f93b19e18c356906cbed3d", - "reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c", + "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c", "shasum": "", "mirrors": [ { @@ -408,7 +410,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.1" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0" }, "funding": [ { @@ -416,7 +418,7 @@ "type": "github" } ], - "time": "2021-04-29T12:25:04+00:00" + "time": "2021-06-16T14:33:43+00:00" }, { "name": "psr/cache", @@ -701,16 +703,16 @@ }, { "name": "topthink/framework", - "version": "v6.0.8", + "version": "v6.0.9", "source": { "type": "git", "url": "https://github.com/top-think/framework.git", - "reference": "4789343672aef06d571d556da369c0e156609bce" + "reference": "0b5fb453f0e533de3af3a1ab6a202510b61be617" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/framework/zipball/4789343672aef06d571d556da369c0e156609bce", - "reference": "4789343672aef06d571d556da369c0e156609bce", + "url": "https://api.github.com/repos/top-think/framework/zipball/0b5fb453f0e533de3af3a1ab6a202510b61be617", + "reference": "0b5fb453f0e533de3af3a1ab6a202510b61be617", "shasum": "", "mirrors": [ { @@ -722,9 +724,9 @@ "require": { "ext-json": "*", "ext-mbstring": "*", - "league/flysystem": "^1.0", + "league/flysystem": "^1.1.4", "league/flysystem-cached-adapter": "^1.0", - "php": ">=7.1.0", + "php": ">=7.2.5", "psr/container": "~1.0", "psr/log": "~1.0", "psr/simple-cache": "^1.0", @@ -766,9 +768,9 @@ ], "support": { "issues": "https://github.com/top-think/framework/issues", - "source": "https://github.com/top-think/framework/tree/v6.0.8" + "source": "https://github.com/top-think/framework/tree/v6.0.9" }, - "time": "2021-04-27T00:41:08+00:00" + "time": "2021-07-22T03:24:49+00:00" }, { "name": "topthink/think-captcha", @@ -831,16 +833,16 @@ }, { "name": "topthink/think-helper", - "version": "v3.1.4", + "version": "v3.1.5", "source": { "type": "git", "url": "https://github.com/top-think/think-helper.git", - "reference": "c28d37743bda4a0455286ca85b17b5791d626e10" + "reference": "f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-helper/zipball/c28d37743bda4a0455286ca85b17b5791d626e10", - "reference": "c28d37743bda4a0455286ca85b17b5791d626e10", + "url": "https://api.github.com/repos/top-think/think-helper/zipball/f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905", + "reference": "f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905", "shasum": "", "mirrors": [ { @@ -874,9 +876,9 @@ "description": "The ThinkPHP6 Helper Package", "support": { "issues": "https://github.com/top-think/think-helper/issues", - "source": "https://github.com/top-think/think-helper/tree/3.0" + "source": "https://github.com/top-think/think-helper/tree/v3.1.5" }, - "time": "2019-11-08T08:01:10+00:00" + "time": "2021-06-21T06:17:31+00:00" }, { "name": "topthink/think-multi-app", @@ -934,16 +936,16 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.40", + "version": "v2.0.44", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "1119d979b850849f3725856460cf108eec1c3eb8" + "reference": "5d3d5c1ebf8bfccf34bacd90edb42989b16ea409" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/1119d979b850849f3725856460cf108eec1c3eb8", - "reference": "1119d979b850849f3725856460cf108eec1c3eb8", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/5d3d5c1ebf8bfccf34bacd90edb42989b16ea409", + "reference": "5d3d5c1ebf8bfccf34bacd90edb42989b16ea409", "shasum": "", "mirrors": [ { @@ -989,9 +991,9 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.40" + "source": "https://github.com/top-think/think-orm/tree/v2.0.44" }, - "time": "2021-04-19T13:29:37+00:00" + "time": "2021-07-21T02:22:31+00:00" }, { "name": "topthink/think-template", @@ -1204,16 +1206,16 @@ "packages-dev": [ { "name": "symfony/polyfill-mbstring", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "", "mirrors": [ { @@ -1270,7 +1272,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -1286,7 +1288,7 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:27:20+00:00" + "time": "2021-05-27T12:26:48+00:00" }, { "name": "symfony/polyfill-php72", @@ -1372,16 +1374,16 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.23.0", + "version": "v1.23.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "", "mirrors": [ { @@ -1441,7 +1443,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" }, "funding": [ { @@ -1457,20 +1459,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-07-28T13:41:28+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.4.25", + "version": "v4.4.27", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0" + "reference": "391d6d0e7a06ab54eb7c38fab29b8d174471b3ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0", - "reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/391d6d0e7a06ab54eb7c38fab29b8d174471b3ba", + "reference": "391d6d0e7a06ab54eb7c38fab29b8d174471b3ba", "shasum": "", "mirrors": [ { @@ -1483,7 +1485,7 @@ "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php72": "~1.5", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", @@ -1536,7 +1538,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.25" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.27" }, "funding": [ { @@ -1552,7 +1554,7 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:48:32+00:00" + "time": "2021-07-23T15:41:52+00:00" }, { "name": "topthink/think-trace", diff --git a/config/taoler.php b/config/taoler.php index eb342ef..b64d39c 100644 --- a/config/taoler.php +++ b/config/taoler.php @@ -7,16 +7,19 @@ return [ //应用名,此项不可更改 'appname' => 'TaoLer', //版本配置 - 'version' => '1.7.28', + 'version' => '1.8.1', //加盐 'salt' => 'taoler', //数据库备份目录 'databasebackdir' => app()->getRootPath() .'data/', //配置 'config' =>[ - 'email_notice' => 1, + 'email_notice' => 0, 'cate_show' => 0, 'area_show' => 0, + 'regist_check' => 0, + 'posts_check' => 0, + 'commnets_check' => 0, ] diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index 1985619..ad4475a 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -26,21 +26,21 @@ private static $installed = array ( array ( 'firebase/php-jwt' => array ( - 'pretty_version' => 'v5.3.0', - 'version' => '5.3.0.0', + 'pretty_version' => 'v5.4.0', + 'version' => '5.4.0.0', 'aliases' => array ( ), - 'reference' => '3c2d70f2e64e2922345e89f2ceae47d2463faae1', + 'reference' => 'd2113d9b2e0e349796e72d2a63cf9319100382d2', ), 'league/flysystem' => array ( - 'pretty_version' => '1.1.3', - 'version' => '1.1.3.0', + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', 'aliases' => array ( ), - 'reference' => '9be3b16c877d477357c015cec057548cf9b2a14a', + 'reference' => 'f3ad69181b8afed2c9edf7be5a2918144ff4ea32', ), 'league/flysystem-cached-adapter' => array ( @@ -71,12 +71,12 @@ private static $installed = array ( ), 'phpmailer/phpmailer' => array ( - 'pretty_version' => 'v6.4.1', - 'version' => '6.4.1.0', + 'pretty_version' => 'v6.5.0', + 'version' => '6.5.0.0', 'aliases' => array ( ), - 'reference' => '9256f12d8fb0cd0500f93b19e18c356906cbed3d', + 'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c', ), 'psr/cache' => array ( @@ -116,12 +116,12 @@ private static $installed = array ( ), 'symfony/polyfill-mbstring' => array ( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', + 'pretty_version' => 'v1.23.1', + 'version' => '1.23.1.0', 'aliases' => array ( ), - 'reference' => '2df51500adbaebdc4c38dea4c89a2e131c45c8a1', + 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', ), 'symfony/polyfill-php72' => array ( @@ -134,21 +134,21 @@ private static $installed = array ( ), 'symfony/polyfill-php80' => array ( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', + 'pretty_version' => 'v1.23.1', + 'version' => '1.23.1.0', 'aliases' => array ( ), - 'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0', + 'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be', ), 'symfony/var-dumper' => array ( - 'pretty_version' => 'v4.4.25', - 'version' => '4.4.25.0', + 'pretty_version' => 'v4.4.27', + 'version' => '4.4.27.0', 'aliases' => array ( ), - 'reference' => '31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0', + 'reference' => '391d6d0e7a06ab54eb7c38fab29b8d174471b3ba', ), 'taoser/taoler' => array ( @@ -170,12 +170,12 @@ private static $installed = array ( ), 'topthink/framework' => array ( - 'pretty_version' => 'v6.0.8', - 'version' => '6.0.8.0', + 'pretty_version' => 'v6.0.9', + 'version' => '6.0.9.0', 'aliases' => array ( ), - 'reference' => '4789343672aef06d571d556da369c0e156609bce', + 'reference' => '0b5fb453f0e533de3af3a1ab6a202510b61be617', ), 'topthink/think-captcha' => array ( @@ -188,12 +188,12 @@ private static $installed = array ( ), 'topthink/think-helper' => array ( - 'pretty_version' => 'v3.1.4', - 'version' => '3.1.4.0', + 'pretty_version' => 'v3.1.5', + 'version' => '3.1.5.0', 'aliases' => array ( ), - 'reference' => 'c28d37743bda4a0455286ca85b17b5791d626e10', + 'reference' => 'f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905', ), 'topthink/think-multi-app' => array ( @@ -206,12 +206,12 @@ private static $installed = array ( ), 'topthink/think-orm' => array ( - 'pretty_version' => 'v2.0.40', - 'version' => '2.0.40.0', + 'pretty_version' => 'v2.0.44', + 'version' => '2.0.44.0', 'aliases' => array ( ), - 'reference' => '1119d979b850849f3725856460cf108eec1c3eb8', + 'reference' => '5d3d5c1ebf8bfccf34bacd90edb42989b16ea409', ), 'topthink/think-template' => array ( diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 6e955ed..d71fc07 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -2,17 +2,17 @@ "packages": [ { "name": "firebase/php-jwt", - "version": "v5.3.0", - "version_normalized": "5.3.0.0", + "version": "v5.4.0", + "version_normalized": "5.4.0.0", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "3c2d70f2e64e2922345e89f2ceae47d2463faae1" + "reference": "d2113d9b2e0e349796e72d2a63cf9319100382d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/3c2d70f2e64e2922345e89f2ceae47d2463faae1", - "reference": "3c2d70f2e64e2922345e89f2ceae47d2463faae1", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/d2113d9b2e0e349796e72d2a63cf9319100382d2", + "reference": "d2113d9b2e0e349796e72d2a63cf9319100382d2", "shasum": "", "mirrors": [ { @@ -27,7 +27,10 @@ "require-dev": { "phpunit/phpunit": ">=4.8 <=9" }, - "time": "2021-05-20T17:37:02+00:00", + "suggest": { + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" + }, + "time": "2021-06-23T19:00:23+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -59,23 +62,23 @@ ], "support": { "issues": "https://github.com/firebase/php-jwt/issues", - "source": "https://github.com/firebase/php-jwt/tree/v5.3.0" + "source": "https://github.com/firebase/php-jwt/tree/v5.4.0" }, "install-path": "../firebase/php-jwt" }, { "name": "league/flysystem", - "version": "1.1.3", - "version_normalized": "1.1.3.0", + "version": "1.1.4", + "version_normalized": "1.1.4.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "9be3b16c877d477357c015cec057548cf9b2a14a" + "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a", - "reference": "9be3b16c877d477357c015cec057548cf9b2a14a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/f3ad69181b8afed2c9edf7be5a2918144ff4ea32", + "reference": "f3ad69181b8afed2c9edf7be5a2918144ff4ea32", "shasum": "", "mirrors": [ { @@ -97,7 +100,6 @@ "phpunit/phpunit": "^8.5.8" }, "suggest": { - "ext-fileinfo": "Required for MimeType", "ext-ftp": "Allows you to use FTP server storage", "ext-openssl": "Allows you to use FTPS server storage", "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", @@ -112,7 +114,7 @@ "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" }, - "time": "2020-08-23T07:39:11+00:00", + "time": "2021-06-23T21:56:05+00:00", "type": "library", "extra": { "branch-alias": { @@ -155,6 +157,16 @@ "sftp", "storage" ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.1.4" + }, + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ], "install-path": "../league/flysystem" }, { @@ -333,17 +345,17 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.4.1", - "version_normalized": "6.4.1.0", + "version": "v6.5.0", + "version_normalized": "6.5.0.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d" + "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9256f12d8fb0cd0500f93b19e18c356906cbed3d", - "reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c", + "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c", "shasum": "", "mirrors": [ { @@ -374,7 +386,7 @@ "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" }, - "time": "2021-04-29T12:25:04+00:00", + "time": "2021-06-16T14:33:43+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -406,7 +418,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.4.1" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0" }, "funding": [ { @@ -646,17 +658,17 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", + "version": "v1.23.1", + "version_normalized": "1.23.1.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1" + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/2df51500adbaebdc4c38dea4c89a2e131c45c8a1", - "reference": "2df51500adbaebdc4c38dea4c89a2e131c45c8a1", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", + "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", "shasum": "", "mirrors": [ { @@ -671,7 +683,7 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2021-05-27T09:27:20+00:00", + "time": "2021-05-27T12:26:48+00:00", "type": "library", "extra": { "branch-alias": { @@ -715,7 +727,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" }, "funding": [ { @@ -820,17 +832,17 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.23.0", - "version_normalized": "1.23.0.0", + "version": "v1.23.1", + "version_normalized": "1.23.1.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", - "reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", + "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", "shasum": "", "mirrors": [ { @@ -842,7 +854,7 @@ "require": { "php": ">=7.1" }, - "time": "2021-02-19T12:13:01+00:00", + "time": "2021-07-28T13:41:28+00:00", "type": "library", "extra": { "branch-alias": { @@ -892,7 +904,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" }, "funding": [ { @@ -912,17 +924,17 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.25", - "version_normalized": "4.4.25.0", + "version": "v4.4.27", + "version_normalized": "4.4.27.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0" + "reference": "391d6d0e7a06ab54eb7c38fab29b8d174471b3ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0", - "reference": "31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/391d6d0e7a06ab54eb7c38fab29b8d174471b3ba", + "reference": "391d6d0e7a06ab54eb7c38fab29b8d174471b3ba", "shasum": "", "mirrors": [ { @@ -935,7 +947,7 @@ "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php72": "~1.5", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "conflict": { "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", @@ -952,7 +964,7 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2021-05-27T09:48:32+00:00", + "time": "2021-07-23T15:41:52+00:00", "bin": [ "Resources/bin/var-dump-server" ], @@ -990,7 +1002,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.25" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.27" }, "funding": [ { @@ -1068,17 +1080,17 @@ }, { "name": "topthink/framework", - "version": "v6.0.8", - "version_normalized": "6.0.8.0", + "version": "v6.0.9", + "version_normalized": "6.0.9.0", "source": { "type": "git", "url": "https://github.com/top-think/framework.git", - "reference": "4789343672aef06d571d556da369c0e156609bce" + "reference": "0b5fb453f0e533de3af3a1ab6a202510b61be617" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/framework/zipball/4789343672aef06d571d556da369c0e156609bce", - "reference": "4789343672aef06d571d556da369c0e156609bce", + "url": "https://api.github.com/repos/top-think/framework/zipball/0b5fb453f0e533de3af3a1ab6a202510b61be617", + "reference": "0b5fb453f0e533de3af3a1ab6a202510b61be617", "shasum": "", "mirrors": [ { @@ -1090,9 +1102,9 @@ "require": { "ext-json": "*", "ext-mbstring": "*", - "league/flysystem": "^1.0", + "league/flysystem": "^1.1.4", "league/flysystem-cached-adapter": "^1.0", - "php": ">=7.1.0", + "php": ">=7.2.5", "psr/container": "~1.0", "psr/log": "~1.0", "psr/simple-cache": "^1.0", @@ -1104,7 +1116,7 @@ "mockery/mockery": "^1.2", "phpunit/phpunit": "^7.0" }, - "time": "2021-04-27T00:41:08+00:00", + "time": "2021-07-22T03:24:49+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1136,7 +1148,7 @@ ], "support": { "issues": "https://github.com/top-think/framework/issues", - "source": "https://github.com/top-think/framework/tree/v6.0.8" + "source": "https://github.com/top-think/framework/tree/v6.0.9" }, "install-path": "../topthink/framework" }, @@ -1200,17 +1212,17 @@ }, { "name": "topthink/think-helper", - "version": "v3.1.4", - "version_normalized": "3.1.4.0", + "version": "v3.1.5", + "version_normalized": "3.1.5.0", "source": { "type": "git", "url": "https://github.com/top-think/think-helper.git", - "reference": "c28d37743bda4a0455286ca85b17b5791d626e10" + "reference": "f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-helper/zipball/c28d37743bda4a0455286ca85b17b5791d626e10", - "reference": "c28d37743bda4a0455286ca85b17b5791d626e10", + "url": "https://api.github.com/repos/top-think/think-helper/zipball/f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905", + "reference": "f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905", "shasum": "", "mirrors": [ { @@ -1222,7 +1234,7 @@ "require": { "php": ">=7.1.0" }, - "time": "2019-11-08T08:01:10+00:00", + "time": "2021-06-21T06:17:31+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1244,6 +1256,10 @@ } ], "description": "The ThinkPHP6 Helper Package", + "support": { + "issues": "https://github.com/top-think/think-helper/issues", + "source": "https://github.com/top-think/think-helper/tree/v3.1.5" + }, "install-path": "../topthink/think-helper" }, { @@ -1301,17 +1317,17 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.40", - "version_normalized": "2.0.40.0", + "version": "v2.0.44", + "version_normalized": "2.0.44.0", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "1119d979b850849f3725856460cf108eec1c3eb8" + "reference": "5d3d5c1ebf8bfccf34bacd90edb42989b16ea409" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/1119d979b850849f3725856460cf108eec1c3eb8", - "reference": "1119d979b850849f3725856460cf108eec1c3eb8", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/5d3d5c1ebf8bfccf34bacd90edb42989b16ea409", + "reference": "5d3d5c1ebf8bfccf34bacd90edb42989b16ea409", "shasum": "", "mirrors": [ { @@ -1331,7 +1347,7 @@ "require-dev": { "phpunit/phpunit": "^7|^8|^9.5" }, - "time": "2021-04-19T13:29:37+00:00", + "time": "2021-07-21T02:22:31+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1359,7 +1375,7 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.40" + "source": "https://github.com/top-think/think-orm/tree/v2.0.44" }, "install-path": "../topthink/think-orm" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index ffafc99..99ac1bb 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -13,21 +13,21 @@ array ( 'firebase/php-jwt' => array ( - 'pretty_version' => 'v5.3.0', - 'version' => '5.3.0.0', + 'pretty_version' => 'v5.4.0', + 'version' => '5.4.0.0', 'aliases' => array ( ), - 'reference' => '3c2d70f2e64e2922345e89f2ceae47d2463faae1', + 'reference' => 'd2113d9b2e0e349796e72d2a63cf9319100382d2', ), 'league/flysystem' => array ( - 'pretty_version' => '1.1.3', - 'version' => '1.1.3.0', + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', 'aliases' => array ( ), - 'reference' => '9be3b16c877d477357c015cec057548cf9b2a14a', + 'reference' => 'f3ad69181b8afed2c9edf7be5a2918144ff4ea32', ), 'league/flysystem-cached-adapter' => array ( @@ -58,12 +58,12 @@ ), 'phpmailer/phpmailer' => array ( - 'pretty_version' => 'v6.4.1', - 'version' => '6.4.1.0', + 'pretty_version' => 'v6.5.0', + 'version' => '6.5.0.0', 'aliases' => array ( ), - 'reference' => '9256f12d8fb0cd0500f93b19e18c356906cbed3d', + 'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c', ), 'psr/cache' => array ( @@ -103,12 +103,12 @@ ), 'symfony/polyfill-mbstring' => array ( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', + 'pretty_version' => 'v1.23.1', + 'version' => '1.23.1.0', 'aliases' => array ( ), - 'reference' => '2df51500adbaebdc4c38dea4c89a2e131c45c8a1', + 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', ), 'symfony/polyfill-php72' => array ( @@ -121,21 +121,21 @@ ), 'symfony/polyfill-php80' => array ( - 'pretty_version' => 'v1.23.0', - 'version' => '1.23.0.0', + 'pretty_version' => 'v1.23.1', + 'version' => '1.23.1.0', 'aliases' => array ( ), - 'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0', + 'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be', ), 'symfony/var-dumper' => array ( - 'pretty_version' => 'v4.4.25', - 'version' => '4.4.25.0', + 'pretty_version' => 'v4.4.27', + 'version' => '4.4.27.0', 'aliases' => array ( ), - 'reference' => '31ea689a8e7d2410016b0d25fc15a1ba05a6e2e0', + 'reference' => '391d6d0e7a06ab54eb7c38fab29b8d174471b3ba', ), 'taoser/taoler' => array ( @@ -157,12 +157,12 @@ ), 'topthink/framework' => array ( - 'pretty_version' => 'v6.0.8', - 'version' => '6.0.8.0', + 'pretty_version' => 'v6.0.9', + 'version' => '6.0.9.0', 'aliases' => array ( ), - 'reference' => '4789343672aef06d571d556da369c0e156609bce', + 'reference' => '0b5fb453f0e533de3af3a1ab6a202510b61be617', ), 'topthink/think-captcha' => array ( @@ -175,12 +175,12 @@ ), 'topthink/think-helper' => array ( - 'pretty_version' => 'v3.1.4', - 'version' => '3.1.4.0', + 'pretty_version' => 'v3.1.5', + 'version' => '3.1.5.0', 'aliases' => array ( ), - 'reference' => 'c28d37743bda4a0455286ca85b17b5791d626e10', + 'reference' => 'f98e3ad44acd27ae85a4d923b1bdfd16c6d8d905', ), 'topthink/think-multi-app' => array ( @@ -193,12 +193,12 @@ ), 'topthink/think-orm' => array ( - 'pretty_version' => 'v2.0.40', - 'version' => '2.0.40.0', + 'pretty_version' => 'v2.0.44', + 'version' => '2.0.44.0', 'aliases' => array ( ), - 'reference' => '1119d979b850849f3725856460cf108eec1c3eb8', + 'reference' => '5d3d5c1ebf8bfccf34bacd90edb42989b16ea409', ), 'topthink/think-template' => array ( diff --git a/vendor/firebase/php-jwt/.github/actions/entrypoint.sh b/vendor/firebase/php-jwt/.github/actions/entrypoint.sh deleted file mode 100644 index ce8379c..0000000 --- a/vendor/firebase/php-jwt/.github/actions/entrypoint.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -l - -apt-get update && \ -apt-get install -y --no-install-recommends \ - git \ - zip \ - curl \ - unzip \ - wget - -curl --silent --show-error https://getcomposer.org/installer | php -php composer.phar self-update - -echo "---Installing dependencies ---" -php composer.phar update - -echo "---Running unit tests ---" -vendor/bin/phpunit diff --git a/vendor/firebase/php-jwt/.github/workflows/tests.yml b/vendor/firebase/php-jwt/.github/workflows/tests.yml deleted file mode 100644 index 343df75..0000000 --- a/vendor/firebase/php-jwt/.github/workflows/tests.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Test Suite -on: - push: - branches: - - master - pull_request: - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - php: [ "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0" ] - name: PHP ${{matrix.php }} Unit Test - steps: - - uses: actions/checkout@v2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - - name: Install Dependencies - uses: nick-invision/retry@v1 - with: - timeout_minutes: 10 - max_attempts: 3 - command: composer install - - name: Run Script - run: vendor/bin/phpunit - - # use dockerfiles for old versions of php (setup-php times out for those). - test_php55: - name: "PHP 5.5 Unit Test" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Run Unit Tests - uses: docker://php:5.5-cli - with: - entrypoint: ./.github/actions/entrypoint.sh - - test_php54: - name: "PHP 5.4 Unit Test" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Run Unit Tests - uses: docker://php:5.4-cli - with: - entrypoint: ./.github/actions/entrypoint.sh - - test_php53: - name: "PHP 5.3 Unit Test" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Run Unit Tests - uses: docker://tomsowerby/php-5.3:cli - with: - entrypoint: ./.github/actions/entrypoint.sh - - style: - runs-on: ubuntu-latest - name: PHP Style Check - steps: - - uses: actions/checkout@v2 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "7.0" - - name: Run Script - run: | - composer require friendsofphp/php-cs-fixer - vendor/bin/php-cs-fixer fix --diff --dry-run . - vendor/bin/php-cs-fixer fix --rules=native_function_invocation --allow-risky=yes --diff src diff --git a/vendor/firebase/php-jwt/README.md b/vendor/firebase/php-jwt/README.md index 66d7d01..a8556aa 100644 --- a/vendor/firebase/php-jwt/README.md +++ b/vendor/firebase/php-jwt/README.md @@ -16,6 +16,13 @@ Use composer to manage your dependencies and download PHP-JWT: composer require firebase/php-jwt ``` +Optionally, install the `paragonie/sodium_compat` package from composer if your +php is < 7.2 or does not have libsodium installed: + +```bash +composer require paragonie/sodium_compat +``` + Example ------- ```php @@ -144,6 +151,36 @@ $decoded = JWT::decode($jwt, $publicKey, array('RS256')); echo "Decode:\n" . print_r((array) $decoded, true) . "\n"; ``` +Example with EdDSA (libsodium and Ed25519 signature) +---------------------------- +```php +use Firebase\JWT\JWT; + +// Public and private keys are expected to be Base64 encoded. The last +// non-empty line is used so that keys can be generated with +// sodium_crypto_sign_keypair(). The secret keys generated by other tools may +// need to be adjusted to match the input expected by libsodium. + +$keyPair = sodium_crypto_sign_keypair(); + +$privateKey = base64_encode(sodium_crypto_sign_secretkey($keyPair)); + +$publicKey = base64_encode(sodium_crypto_sign_publickey($keyPair)); + +$payload = array( + "iss" => "example.org", + "aud" => "example.com", + "iat" => 1356999524, + "nbf" => 1357000000 +); + +$jwt = JWT::encode($payload, $privateKey, 'EdDSA'); +echo "Encode:\n" . print_r($jwt, true) . "\n"; + +$decoded = JWT::decode($jwt, $publicKey, array('EdDSA')); +echo "Decode:\n" . print_r((array) $decoded, true) . "\n"; +```` + Using JWKs ---------- diff --git a/vendor/firebase/php-jwt/composer.json b/vendor/firebase/php-jwt/composer.json index 25d1cfa..6146e2d 100644 --- a/vendor/firebase/php-jwt/composer.json +++ b/vendor/firebase/php-jwt/composer.json @@ -22,6 +22,9 @@ "require": { "php": ">=5.3.0" }, + "suggest": { + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" + }, "autoload": { "psr-4": { "Firebase\\JWT\\": "src" diff --git a/vendor/firebase/php-jwt/src/JWK.php b/vendor/firebase/php-jwt/src/JWK.php index 29dbbac..981a9ba 100644 --- a/vendor/firebase/php-jwt/src/JWK.php +++ b/vendor/firebase/php-jwt/src/JWK.php @@ -71,7 +71,7 @@ class JWK * * @uses createPemFromModulusAndExponent */ - private static function parseKey(array $jwk) + public static function parseKey(array $jwk) { if (empty($jwk)) { throw new InvalidArgumentException('JWK must not be empty'); diff --git a/vendor/firebase/php-jwt/src/JWT.php b/vendor/firebase/php-jwt/src/JWT.php index 4b85699..99d6dcd 100644 --- a/vendor/firebase/php-jwt/src/JWT.php +++ b/vendor/firebase/php-jwt/src/JWT.php @@ -3,6 +3,7 @@ namespace Firebase\JWT; use DomainException; +use Exception; use InvalidArgumentException; use UnexpectedValueException; use DateTime; @@ -50,6 +51,7 @@ class JWT 'RS256' => array('openssl', 'SHA256'), 'RS384' => array('openssl', 'SHA384'), 'RS512' => array('openssl', 'SHA512'), + 'EdDSA' => array('sodium_crypto', 'EdDSA'), ); /** @@ -198,7 +200,7 @@ class JWT * * @return string An encrypted message * - * @throws DomainException Unsupported algorithm was specified + * @throws DomainException Unsupported algorithm or bad key was specified */ public static function sign($msg, $key, $alg = 'HS256') { @@ -214,14 +216,24 @@ class JWT $success = \openssl_sign($msg, $signature, $key, $algorithm); if (!$success) { throw new DomainException("OpenSSL unable to sign data"); - } else { - if ($alg === 'ES256') { - $signature = self::signatureFromDER($signature, 256); - } - if ($alg === 'ES384') { - $signature = self::signatureFromDER($signature, 384); - } - return $signature; + } + if ($alg === 'ES256') { + $signature = self::signatureFromDER($signature, 256); + } elseif ($alg === 'ES384') { + $signature = self::signatureFromDER($signature, 384); + } + return $signature; + case 'sodium_crypto': + if (!function_exists('sodium_crypto_sign_detached')) { + throw new DomainException('libsodium is not available'); + } + try { + // The last non-empty line is used as the key. + $lines = array_filter(explode("\n", $key)); + $key = base64_decode(end($lines)); + return sodium_crypto_sign_detached($msg, $key); + } catch (Exception $e) { + throw new DomainException($e->getMessage(), 0, $e); } } } @@ -237,7 +249,7 @@ class JWT * * @return bool * - * @throws DomainException Invalid Algorithm or OpenSSL failure + * @throws DomainException Invalid Algorithm, bad key, or OpenSSL failure */ private static function verify($msg, $signature, $key, $alg) { @@ -258,6 +270,18 @@ class JWT throw new DomainException( 'OpenSSL error: ' . \openssl_error_string() ); + case 'sodium_crypto': + if (!function_exists('sodium_crypto_sign_verify_detached')) { + throw new DomainException('libsodium is not available'); + } + try { + // The last non-empty line is used as the key. + $lines = array_filter(explode("\n", $key)); + $key = base64_decode(end($lines)); + return sodium_crypto_sign_verify_detached($signature, $msg, $key); + } catch (Exception $e) { + throw new DomainException($e->getMessage(), 0, $e); + } case 'hash_hmac': default: $hash = \hash_hmac($algorithm, $msg, $key, true); diff --git a/vendor/league/flysystem/composer.json b/vendor/league/flysystem/composer.json index bd7434a..32ec81d 100644 --- a/vendor/league/flysystem/composer.json +++ b/vendor/league/flysystem/composer.json @@ -40,7 +40,6 @@ } }, "suggest": { - "ext-fileinfo": "Required for MimeType", "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", diff --git a/vendor/league/flysystem/src/CorruptedPathDetected.php b/vendor/league/flysystem/src/CorruptedPathDetected.php new file mode 100644 index 0000000..81a27e5 --- /dev/null +++ b/vendor/league/flysystem/src/CorruptedPathDetected.php @@ -0,0 +1,17 @@ +language = $PHPMAILER_LANG; - return (bool) $foundlang; //Returns false if language not found + return $foundlang; //Returns false if language not found } /** diff --git a/vendor/phpmailer/phpmailer/src/POP3.php b/vendor/phpmailer/phpmailer/src/POP3.php index a39f480..b38964b 100644 --- a/vendor/phpmailer/phpmailer/src/POP3.php +++ b/vendor/phpmailer/phpmailer/src/POP3.php @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.4.1'; + const VERSION = '6.5.0'; /** * Default POP3 port number. diff --git a/vendor/phpmailer/phpmailer/src/SMTP.php b/vendor/phpmailer/phpmailer/src/SMTP.php index 0e7f53d..a4a91ed 100644 --- a/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/vendor/phpmailer/phpmailer/src/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.4.1'; + const VERSION = '6.5.0'; /** * SMTP line break constant. @@ -186,6 +186,7 @@ class SMTP 'Amazon_SES' => '/[\d]{3} Ok (.*)/', 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', + 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', ]; /** diff --git a/vendor/services.php b/vendor/services.php index 6f4c458..973d5c4 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\captcha\\CaptchaService', diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php index c31611f..b599095 100644 --- a/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -69,14 +69,15 @@ final class Mbstring { public const MB_CASE_FOLD = \PHP_INT_MAX; - private static $encodingList = ['ASCII', 'UTF-8']; - private static $language = 'neutral'; - private static $internalEncoding = 'UTF-8'; - private static $caseFold = [ + private const CASE_FOLD = [ ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], ]; + private static $encodingList = ['ASCII', 'UTF-8']; + private static $language = 'neutral'; + private static $internalEncoding = 'UTF-8'; + public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { @@ -300,7 +301,7 @@ final class Mbstring $map = $upper; } else { if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::$caseFold[0], self::$caseFold[1], $s); + $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); } static $lower = null; diff --git a/vendor/symfony/polyfill-php80/README.md b/vendor/symfony/polyfill-php80/README.md index eaa3050..10b8ee4 100644 --- a/vendor/symfony/polyfill-php80/README.md +++ b/vendor/symfony/polyfill-php80/README.md @@ -16,7 +16,7 @@ This component provides features added to PHP 8.0 core: - [`get_resource_id`](https://php.net/get_resource_id) More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). License ======= diff --git a/vendor/symfony/polyfill-php80/bootstrap.php b/vendor/symfony/polyfill-php80/bootstrap.php index 4f791f9..e5f7dbc 100644 --- a/vendor/symfony/polyfill-php80/bootstrap.php +++ b/vendor/symfony/polyfill-php80/bootstrap.php @@ -26,13 +26,13 @@ if (!function_exists('preg_last_error_msg')) { function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } } if (!function_exists('str_contains')) { - function str_contains(string $haystack, string $needle): bool { return p\Php80::str_contains($haystack, $needle); } + function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } } if (!function_exists('str_starts_with')) { - function str_starts_with(string $haystack, string $needle): bool { return p\Php80::str_starts_with($haystack, $needle); } + function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } } if (!function_exists('str_ends_with')) { - function str_ends_with(string $haystack, string $needle): bool { return p\Php80::str_ends_with($haystack, $needle); } + function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } } if (!function_exists('get_debug_type')) { function get_debug_type($value): string { return p\Php80::get_debug_type($value); } diff --git a/vendor/symfony/var-dumper/Caster/ClassStub.php b/vendor/symfony/var-dumper/Caster/ClassStub.php index 612a7ca..48f8483 100644 --- a/vendor/symfony/var-dumper/Caster/ClassStub.php +++ b/vendor/symfony/var-dumper/Caster/ClassStub.php @@ -55,7 +55,7 @@ class ClassStub extends ConstStub } } - if (false !== strpos($identifier, "@anonymous\0")) { + if (str_contains($identifier, "@anonymous\0")) { $this->value = $identifier = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; }, $identifier); @@ -65,7 +65,7 @@ class ClassStub extends ConstStub $s = ReflectionCaster::castFunctionAbstract($r, [], new Stub(), true, Caster::EXCLUDE_VERBOSE); $s = ReflectionCaster::getSignature($s); - if ('()' === substr($identifier, -2)) { + if (str_ends_with($identifier, '()')) { $this->value = substr_replace($identifier, $s, -2); } else { $this->value .= $s; diff --git a/vendor/symfony/var-dumper/Caster/ExceptionCaster.php b/vendor/symfony/var-dumper/Caster/ExceptionCaster.php index 3ea1752..c29b7df 100644 --- a/vendor/symfony/var-dumper/Caster/ExceptionCaster.php +++ b/vendor/symfony/var-dumper/Caster/ExceptionCaster.php @@ -149,7 +149,7 @@ class ExceptionCaster $f = self::castFrameStub($frame, [], $frame, true); if (isset($f[$prefix.'src'])) { foreach ($f[$prefix.'src']->value as $label => $frame) { - if (0 === strpos($label, "\0~collapse=0")) { + if (str_starts_with($label, "\0~collapse=0")) { if ($collapse) { $label = substr_replace($label, '1', 11, 1); } else { @@ -281,7 +281,7 @@ class ExceptionCaster } unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']); - if (isset($a[Caster::PREFIX_PROTECTED.'message']) && false !== strpos($a[Caster::PREFIX_PROTECTED.'message'], "@anonymous\0")) { + if (isset($a[Caster::PREFIX_PROTECTED.'message']) && str_contains($a[Caster::PREFIX_PROTECTED.'message'], "@anonymous\0")) { $a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; }, $a[Caster::PREFIX_PROTECTED.'message']); diff --git a/vendor/symfony/var-dumper/Caster/LinkStub.php b/vendor/symfony/var-dumper/Caster/LinkStub.php index 6360716..c619d9d 100644 --- a/vendor/symfony/var-dumper/Caster/LinkStub.php +++ b/vendor/symfony/var-dumper/Caster/LinkStub.php @@ -23,7 +23,7 @@ class LinkStub extends ConstStub private static $vendorRoots; private static $composerRoots; - public function __construct($label, int $line = 0, $href = null) + public function __construct(string $label, int $line = 0, string $href = null) { $this->value = $label; @@ -33,12 +33,12 @@ class LinkStub extends ConstStub if (!\is_string($href)) { return; } - if (0 === strpos($href, 'file://')) { + if (str_starts_with($href, 'file://')) { if ($href === $label) { $label = substr($label, 7); } $href = substr($href, 7); - } elseif (false !== strpos($href, '://')) { + } elseif (str_contains($href, '://')) { $this->attr['href'] = $href; return; @@ -69,7 +69,7 @@ class LinkStub extends ConstStub self::$vendorRoots = []; foreach (get_declared_classes() as $class) { - if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) { + if ('C' === $class[0] && str_starts_with($class, 'ComposerAutoloaderInit')) { $r = new \ReflectionClass($class); $v = \dirname($r->getFileName(), 2); if (file_exists($v.'/composer/installed.json')) { @@ -85,7 +85,7 @@ class LinkStub extends ConstStub } foreach (self::$vendorRoots as $root) { - if ($inVendor = 0 === strpos($file, $root)) { + if ($inVendor = str_starts_with($file, $root)) { return $root; } } diff --git a/vendor/symfony/var-dumper/Caster/MemcachedCaster.php b/vendor/symfony/var-dumper/Caster/MemcachedCaster.php index 942eecb..696cef1 100644 --- a/vendor/symfony/var-dumper/Caster/MemcachedCaster.php +++ b/vendor/symfony/var-dumper/Caster/MemcachedCaster.php @@ -71,7 +71,7 @@ class MemcachedCaster $optionConstants = []; foreach ($reflectedMemcached->getConstants() as $constantKey => $value) { - if (0 === strpos($constantKey, 'OPT_')) { + if (str_starts_with($constantKey, 'OPT_')) { $optionConstants[$constantKey] = $value; } } diff --git a/vendor/symfony/var-dumper/Caster/ReflectionCaster.php b/vendor/symfony/var-dumper/Caster/ReflectionCaster.php index 95c1dbf..077df62 100644 --- a/vendor/symfony/var-dumper/Caster/ReflectionCaster.php +++ b/vendor/symfony/var-dumper/Caster/ReflectionCaster.php @@ -42,7 +42,7 @@ class ReflectionCaster $a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter); - if (false === strpos($c->name, '{closure}')) { + if (!str_contains($c->name, '{closure}')) { $stub->class = isset($a[$prefix.'class']) ? $a[$prefix.'class']->value.'::'.$c->name : $c->name; unset($a[$prefix.'class']); } @@ -102,7 +102,7 @@ class ReflectionCaster $prefix.'allowsNull' => $c->allowsNull(), $prefix.'isBuiltin' => $c->isBuiltin(), ]; - } elseif ($c instanceof \ReflectionUnionType) { + } elseif ($c instanceof \ReflectionUnionType || $c instanceof \ReflectionIntersectionType) { $a[$prefix.'allowsNull'] = $c->allowsNull(); self::addMap($a, $c, [ 'types' => 'getTypes', @@ -353,7 +353,7 @@ class ReflectionCaster } elseif (\is_array($v)) { $signature .= $v ? '[…'.\count($v).']' : '[]'; } elseif (\is_string($v)) { - $signature .= 10 > \strlen($v) && false === strpos($v, '\\') ? "'{$v}'" : "'…".\strlen($v)."'"; + $signature .= 10 > \strlen($v) && !str_contains($v, '\\') ? "'{$v}'" : "'…".\strlen($v)."'"; } elseif (\is_bool($v)) { $signature .= $v ? 'true' : 'false'; } else { diff --git a/vendor/symfony/var-dumper/Caster/ResourceCaster.php b/vendor/symfony/var-dumper/Caster/ResourceCaster.php index 5a7c428..a3278a8 100644 --- a/vendor/symfony/var-dumper/Caster/ResourceCaster.php +++ b/vendor/symfony/var-dumper/Caster/ResourceCaster.php @@ -48,7 +48,7 @@ class ResourceCaster public static function castStream($stream, array $a, Stub $stub, $isNested) { $a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested); - if (isset($a['uri'])) { + if ($a['uri'] ?? false) { $a['uri'] = new LinkStub($a['uri']); } diff --git a/vendor/symfony/var-dumper/Caster/SplCaster.php b/vendor/symfony/var-dumper/Caster/SplCaster.php index 5abc51a..be9d66b 100644 --- a/vendor/symfony/var-dumper/Caster/SplCaster.php +++ b/vendor/symfony/var-dumper/Caster/SplCaster.php @@ -129,7 +129,7 @@ class SplCaster } } - if (isset($a[$prefix.'realPath'])) { + if ($a[$prefix.'realPath'] ?? false) { $a[$prefix.'realPath'] = new LinkStub($a[$prefix.'realPath']); } diff --git a/vendor/symfony/var-dumper/Cloner/AbstractCloner.php b/vendor/symfony/var-dumper/Cloner/AbstractCloner.php index 1782379..eeac882 100644 --- a/vendor/symfony/var-dumper/Cloner/AbstractCloner.php +++ b/vendor/symfony/var-dumper/Cloner/AbstractCloner.php @@ -300,7 +300,7 @@ abstract class AbstractCloner implements ClonerInterface $obj = $stub->value; $class = $stub->class; - if (\PHP_VERSION_ID < 80000 ? "\0" === ($class[15] ?? null) : false !== strpos($class, "@anonymous\0")) { + if (\PHP_VERSION_ID < 80000 ? "\0" === ($class[15] ?? null) : str_contains($class, "@anonymous\0")) { $stub->class = get_debug_type($obj); } if (isset($this->classInfo[$class])) { diff --git a/vendor/symfony/var-dumper/Cloner/Data.php b/vendor/symfony/var-dumper/Cloner/Data.php index 21adb23..114bf50 100644 --- a/vendor/symfony/var-dumper/Cloner/Data.php +++ b/vendor/symfony/var-dumper/Cloner/Data.php @@ -155,16 +155,25 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate return $this->__isset($key); } + /** + * @return mixed + */ public function offsetGet($key) { return $this->__get($key); } + /** + * @return void + */ public function offsetSet($key, $value) { throw new \BadMethodCallException(self::class.' objects are immutable.'); } + /** + * @return void + */ public function offsetUnset($key) { throw new \BadMethodCallException(self::class.' objects are immutable.'); diff --git a/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php b/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php index dc77d03..7d9ec0e 100644 --- a/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php +++ b/vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php @@ -42,7 +42,7 @@ class CliDescriptor implements DumpDescriptorInterface $io = $output instanceof SymfonyStyle ? $output : new SymfonyStyle(new ArrayInput([]), $output); $this->dumper->setColors($output->isDecorated()); - $rows = [['date', date('r', $context['timestamp'])]]; + $rows = [['date', date('r', (int) $context['timestamp'])]]; $lastIdentifier = $this->lastIdentifier; $this->lastIdentifier = $clientId; diff --git a/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php b/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php index 35a203b..636b618 100644 --- a/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php +++ b/vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php @@ -94,7 +94,7 @@ HTML private function extractDate(array $context, string $format = 'r'): string { - return date($format, $context['timestamp']); + return date($format, (int) $context['timestamp']); } private function renderTags(array $tags): string diff --git a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php b/vendor/symfony/var-dumper/Dumper/AbstractDumper.php index eea56b5..4ddaf5e 100644 --- a/vendor/symfony/var-dumper/Dumper/AbstractDumper.php +++ b/vendor/symfony/var-dumper/Dumper/AbstractDumper.php @@ -63,7 +63,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface */ public function setOutput($output) { - $prev = null !== $this->outputStream ? $this->outputStream : $this->lineDumper; + $prev = $this->outputStream ?? $this->lineDumper; if (\is_callable($output)) { $this->outputStream = null; diff --git a/vendor/symfony/var-dumper/Dumper/CliDumper.php b/vendor/symfony/var-dumper/Dumper/CliDumper.php index 55484b0..b3d9e25 100644 --- a/vendor/symfony/var-dumper/Dumper/CliDumper.php +++ b/vendor/symfony/var-dumper/Dumper/CliDumper.php @@ -154,7 +154,7 @@ class CliDumper extends AbstractDumper case is_nan($value): $value = 'NAN'; break; default: $value = (string) $value; - if (false === strpos($value, $this->decimalPoint)) { + if (!str_contains($value, $this->decimalPoint)) { $value .= $this->decimalPoint.'0'; } break; @@ -445,7 +445,7 @@ class CliDumper extends AbstractDumper if (isset($attr['ellipsis'], $attr['ellipsis-type'])) { $prefix = substr($value, 0, -$attr['ellipsis']); - if ('cli' === \PHP_SAPI && 'path' === $attr['ellipsis-type'] && isset($_SERVER[$pwd = '\\' === \DIRECTORY_SEPARATOR ? 'CD' : 'PWD']) && 0 === strpos($prefix, $_SERVER[$pwd])) { + if ('cli' === \PHP_SAPI && 'path' === $attr['ellipsis-type'] && isset($_SERVER[$pwd = '\\' === \DIRECTORY_SEPARATOR ? 'CD' : 'PWD']) && str_starts_with($prefix, $_SERVER[$pwd])) { $prefix = '.'.substr($prefix, \strlen($_SERVER[$pwd])); } if (!empty($attr['ellipsis-tail'])) { @@ -479,7 +479,7 @@ class CliDumper extends AbstractDumper } else { $value = "\033[{$this->styles[$style]}m".$value; } - if ($cchrCount && $endCchr === substr($value, -\strlen($endCchr))) { + if ($cchrCount && str_ends_with($value, $endCchr)) { $value = substr($value, 0, -\strlen($endCchr)); } else { $value .= "\033[{$this->styles['default']}m"; diff --git a/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php b/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php index c3cd322..2e2c818 100644 --- a/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php +++ b/vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php @@ -56,7 +56,7 @@ final class SourceContextProvider implements ContextProviderInterface $line = $trace[$i]['line'] ?? $line; while (++$i < $this->limit) { - if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && 0 !== strpos($trace[$i]['function'], 'call_user_func')) { + if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && !str_starts_with($trace[$i]['function'], 'call_user_func')) { $file = $trace[$i]['file']; $line = $trace[$i]['line']; @@ -98,7 +98,7 @@ final class SourceContextProvider implements ContextProviderInterface if (null !== $this->projectDir) { $context['project_dir'] = $this->projectDir; - if (0 === strpos($file, $this->projectDir)) { + if (str_starts_with($file, $this->projectDir)) { $context['file_relative'] = ltrim(substr($file, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR); } } diff --git a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php index 6b205a7..8409a0c 100644 --- a/vendor/symfony/var-dumper/Dumper/HtmlDumper.php +++ b/vendor/symfony/var-dumper/Dumper/HtmlDumper.php @@ -153,7 +153,7 @@ class HtmlDumper extends CliDumper */ protected function getDumpHeader() { - $this->headerIsDumped = null !== $this->outputStream ? $this->outputStream : $this->lineDumper; + $this->headerIsDumped = $this->outputStream ?? $this->lineDumper; if (null !== $this->dumpHeader) { return $this->dumpHeader; @@ -964,7 +964,7 @@ EOHTML if (-1 === $this->lastDepth) { $this->line = sprintf($this->dumpPrefix, $this->dumpId, $this->indentPad).$this->line; } - if ($this->headerIsDumped !== (null !== $this->outputStream ? $this->outputStream : $this->lineDumper)) { + if ($this->headerIsDumped !== ($this->outputStream ?? $this->lineDumper)) { $this->line = $this->getDumpHeader().$this->line; } @@ -998,7 +998,7 @@ EOHTML } } -function esc($str) +function esc(string $str) { return htmlspecialchars($str, \ENT_QUOTES, 'UTF-8'); } diff --git a/vendor/symfony/var-dumper/Server/Connection.php b/vendor/symfony/var-dumper/Server/Connection.php index d8be235..55d9214 100644 --- a/vendor/symfony/var-dumper/Server/Connection.php +++ b/vendor/symfony/var-dumper/Server/Connection.php @@ -31,7 +31,7 @@ class Connection */ public function __construct(string $host, array $contextProviders = []) { - if (false === strpos($host, '://')) { + if (!str_contains($host, '://')) { $host = 'tcp://'.$host; } @@ -78,7 +78,7 @@ class Connection return false; } - private static function nullErrorHandler($t, $m) + private static function nullErrorHandler(int $t, string $m) { // no-op } diff --git a/vendor/symfony/var-dumper/Server/DumpServer.php b/vendor/symfony/var-dumper/Server/DumpServer.php index 55510c0..1c2c348 100644 --- a/vendor/symfony/var-dumper/Server/DumpServer.php +++ b/vendor/symfony/var-dumper/Server/DumpServer.php @@ -30,7 +30,7 @@ class DumpServer public function __construct(string $host, LoggerInterface $logger = null) { - if (false === strpos($host, '://')) { + if (!str_contains($host, '://')) { $host = 'tcp://'.$host; } diff --git a/vendor/symfony/var-dumper/composer.json b/vendor/symfony/var-dumper/composer.json index 642ee62..d4e64cc 100644 --- a/vendor/symfony/var-dumper/composer.json +++ b/vendor/symfony/var-dumper/composer.json @@ -19,7 +19,7 @@ "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php72": "~1.5", - "symfony/polyfill-php80": "^1.15" + "symfony/polyfill-php80": "^1.16" }, "require-dev": { "ext-iconv": "*", diff --git a/vendor/topthink/framework/.travis.yml b/vendor/topthink/framework/.travis.yml index 28987af..abaa271 100644 --- a/vendor/topthink/framework/.travis.yml +++ b/vendor/topthink/framework/.travis.yml @@ -4,9 +4,9 @@ language: php matrix: fast_finish: true include: - - php: 7.1 - php: 7.2 - php: 7.3 + - php: 8.0 cache: directories: diff --git a/vendor/topthink/framework/composer.json b/vendor/topthink/framework/composer.json index 9afc513..4be2ae0 100644 --- a/vendor/topthink/framework/composer.json +++ b/vendor/topthink/framework/composer.json @@ -19,10 +19,10 @@ } ], "require": { - "php": ">=7.1.0", + "php": ">=7.2.5", "ext-json": "*", "ext-mbstring": "*", - "league/flysystem": "^1.0", + "league/flysystem": "^1.1.4", "league/flysystem-cached-adapter": "^1.0", "psr/log": "~1.0", "psr/container": "~1.0", diff --git a/vendor/topthink/framework/src/think/App.php b/vendor/topthink/framework/src/think/App.php index cdcfeb8..056a341 100644 --- a/vendor/topthink/framework/src/think/App.php +++ b/vendor/topthink/framework/src/think/App.php @@ -39,7 +39,7 @@ use think\initializer\RegisterService; */ class App extends Container { - const VERSION = '6.0.8'; + const VERSION = '6.0.9'; /** * 应用调试模式 diff --git a/vendor/topthink/framework/src/think/Event.php b/vendor/topthink/framework/src/think/Event.php index 6a0eb1f..3c70aad 100644 --- a/vendor/topthink/framework/src/think/Event.php +++ b/vendor/topthink/framework/src/think/Event.php @@ -37,6 +37,7 @@ class Event 'HttpEnd' => event\HttpEnd::class, 'RouteLoaded' => event\RouteLoaded::class, 'LogWrite' => event\LogWrite::class, + 'LogRecord' => event\LogRecord::class, ]; /** @@ -215,6 +216,14 @@ class Event $result = []; $listeners = $this->listener[$event] ?? []; + + if (strpos($event, '.')) { + [$prefix, $event] = explode('.', $event, 2); + if (isset($this->listener[$prefix . '.*'])) { + $listeners = array_merge($listeners, $this->listener[$prefix . '.*']); + } + } + $listeners = array_unique($listeners, SORT_REGULAR); foreach ($listeners as $key => $listener) { diff --git a/vendor/topthink/framework/src/think/Request.php b/vendor/topthink/framework/src/think/Request.php index a21976d..1c15f63 100644 --- a/vendor/topthink/framework/src/think/Request.php +++ b/vendor/topthink/framework/src/think/Request.php @@ -408,7 +408,8 @@ class Request implements ArrayAccess $rootDomain = $this->rootDomain(); if ($rootDomain) { - $this->subDomain = rtrim(stristr($this->host(), $rootDomain, true), '.'); + $sub = stristr($this->host(), $rootDomain, true); + $this->subDomain = $sub ? rtrim($sub, '.') : ''; } else { $this->subDomain = ''; } @@ -878,10 +879,12 @@ class Request implements ArrayAccess */ public function all($name = '', $filter = '') { - $data = array_merge($this->param(), $this->file()); + $data = array_merge($this->param(), $this->file() ?: []); if (is_array($name)) { $data = $this->only($name, $data, $filter); + } elseif ($name) { + $data = $data[$name] ?? null; } return $data; @@ -1147,7 +1150,6 @@ class Request implements ArrayAccess { $files = $this->file; if (!empty($files)) { - if (strpos($name, '.')) { [$name, $sub] = explode('.', $name); } @@ -1307,12 +1309,12 @@ class Request implements ArrayAccess /** * 强制类型转换 - * @access public + * @access protected * @param mixed $data * @param string $type * @return mixed */ - private function typeCast(&$data, string $type) + protected function typeCast(&$data, string $type) { switch (strtolower($type)) { // 数组 @@ -1344,7 +1346,7 @@ class Request implements ArrayAccess /** * 获取数据 - * @access public + * @access protected * @param array $data 数据源 * @param string $name 字段名 * @param mixed $default 默认值 diff --git a/vendor/topthink/framework/src/think/console/command/RunServer.php b/vendor/topthink/framework/src/think/console/command/RunServer.php index 20a2466..d507c1d 100644 --- a/vendor/topthink/framework/src/think/console/command/RunServer.php +++ b/vendor/topthink/framework/src/think/console/command/RunServer.php @@ -63,7 +63,7 @@ class RunServer extends Command escapeshellarg($root . DIRECTORY_SEPARATOR . 'router.php') ); - $output->writeln(sprintf('ThinkPHP Development server is started On ', '0.0.0.0' == $host ? '127.0.0.1' : $host, $port)); + $output->writeln(sprintf('ThinkPHP Development server is started On ', $host, $port)); $output->writeln(sprintf('You can exit with `CTRL-C`')); $output->writeln(sprintf('Document root is: %s', $root)); passthru($command); diff --git a/vendor/topthink/framework/src/think/facade/Route.php b/vendor/topthink/framework/src/think/facade/Route.php index 46bd746..5a5b955 100644 --- a/vendor/topthink/framework/src/think/facade/Route.php +++ b/vendor/topthink/framework/src/think/facade/Route.php @@ -62,7 +62,7 @@ use think\route\Url as UrlBuild; * @method static RuleItem redirect(string $rule, string $route = '', int $status = 301) 注册重定向路由 * @method static \think\Route rest(string|array $name, array|bool $resource = []) rest方法定义和修改 * @method static array|null getRest(string $name = null) 获取rest方法定义的参数 - * @method static RuleItem miss(string|Closure $route, string $method = '*') 注册未匹配路由规则后的处理 + * @method static RuleItem miss(string|\Closure $route, string $method = '*') 注册未匹配路由规则后的处理 * @method static Response dispatch(\think\Request $request, Closure|bool $withRoute = true) 路由调度 * @method static Dispatch|false check() 检测URL路由 * @method static Dispatch url(string $url) 默认URL解析 diff --git a/vendor/topthink/framework/src/think/service/ModelService.php b/vendor/topthink/framework/src/think/service/ModelService.php index 87cfaf9..b517c4e 100644 --- a/vendor/topthink/framework/src/think/service/ModelService.php +++ b/vendor/topthink/framework/src/think/service/ModelService.php @@ -42,6 +42,12 @@ class ModelService extends Service $model->setDateFormat($config->get('database.datetime_format', 'Y-m-d H:i:s')); } + $timeField = $config->get('database.datetime_field'); + if (!empty($timeField)) { + [$createTime, $updateTime] = explode(',', $timeField); + $model->setTimeField($createTime, $updateTime); + } + }); } } diff --git a/vendor/topthink/think-helper/src/Collection.php b/vendor/topthink/think-helper/src/Collection.php index 905f3f8..fa408c2 100644 --- a/vendor/topthink/think-helper/src/Collection.php +++ b/vendor/topthink/think-helper/src/Collection.php @@ -242,15 +242,17 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria * @access public * @param mixed $value 元素 * @param string $key KEY - * @return void + * @return $this */ - public function push($value, string $key = null): void + public function push($value, string $key = null) { if (is_null($key)) { $this->items[] = $value; } else { $this->items[$key] = $value; } + + return $this; } /** @@ -277,15 +279,17 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria * @access public * @param mixed $value 元素 * @param string $key KEY - * @return void + * @return $this */ - public function unshift($value, string $key = null): void + public function unshift($value, string $key = null) { if (is_null($key)) { array_unshift($this->items, $value); } else { $this->items = [$key => $value] + $this->items; } + + return $this; } /** @@ -477,7 +481,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria * @param string|null $indexKey 作为索引值的列 * @return array */ - public function column(?string $columnKey, string $indexKey = null) + public function column( ? string $columnKey, string $indexKey = null) { return array_column($this->items, $columnKey, $indexKey); } @@ -515,7 +519,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria $fieldA = $a[$field] ?? null; $fieldB = $b[$field] ?? null; - return 'desc' == strtolower($order) ? $fieldB > $fieldA : $fieldA > $fieldB; + return 'desc' == strtolower($order) ? intval($fieldB > $fieldA) : intval($fieldA > $fieldB); }); } @@ -535,7 +539,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria } /** - * 获取最第一个单元数据 + * 获取第一个单元数据 * * @access public * @param callable|null $callback @@ -623,7 +627,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria * @param integer $options json参数 * @return string */ - public function toJson(int $options = JSON_UNESCAPED_UNICODE): string + public function toJson(int $options = JSON_UNESCAPED_UNICODE) : string { return json_encode($this->toArray(), $options); } diff --git a/vendor/topthink/think-orm/src/DbManager.php b/vendor/topthink/think-orm/src/DbManager.php index 147d9f6..f223cd2 100644 --- a/vendor/topthink/think-orm/src/DbManager.php +++ b/vendor/topthink/think-orm/src/DbManager.php @@ -364,7 +364,7 @@ class DbManager { if (isset($this->event[$event])) { foreach ($this->event[$event] as $callback) { - call_user_func_array($callback, [$this]); + call_user_func_array($callback, [$params]); } } } diff --git a/vendor/topthink/think-orm/src/Paginator.php b/vendor/topthink/think-orm/src/Paginator.php index f5d8006..d8d43d7 100644 --- a/vendor/topthink/think-orm/src/Paginator.php +++ b/vendor/topthink/think-orm/src/Paginator.php @@ -175,7 +175,7 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J $path = $this->options['path']; } else { $parameters = []; - $path = str_replace('[PAGE]', $page, $this->options['path']); + $path = str_replace('[PAGE]', (string) $page, $this->options['path']); } if (count($this->options['query']) > 0) { diff --git a/vendor/topthink/think-orm/src/db/BaseQuery.php b/vendor/topthink/think-orm/src/db/BaseQuery.php index ef2d3fd..9754a26 100644 --- a/vendor/topthink/think-orm/src/db/BaseQuery.php +++ b/vendor/topthink/think-orm/src/db/BaseQuery.php @@ -621,7 +621,7 @@ abstract class BaseQuery $bind = $this->bind; $total = $this->count(); - $results = $this->options($options)->bind($bind)->page($page, $listRows)->select(); + $results = $total > 0 ? $this->options($options)->bind($bind)->page($page, $listRows)->select() : []; } elseif ($simple) { $results = $this->limit(($page - 1) * $listRows, $listRows + 1)->select(); $total = null; @@ -1075,7 +1075,7 @@ abstract class BaseQuery * 查找记录 * @access public * @param mixed $data 数据 - * @return Collection + * @return Collection|array|static[] * @throws Exception * @throws ModelNotFoundException * @throws DataNotFoundException @@ -1109,7 +1109,7 @@ abstract class BaseQuery * 查找单条记录 * @access public * @param mixed $data 查询数据 - * @return array|Model|null + * @return array|Model|null|static * @throws Exception * @throws ModelNotFoundException * @throws DataNotFoundException diff --git a/vendor/topthink/think-orm/src/db/Builder.php b/vendor/topthink/think-orm/src/db/Builder.php index 73244f4..1a1921f 100644 --- a/vendor/topthink/think-orm/src/db/Builder.php +++ b/vendor/topthink/think-orm/src/db/Builder.php @@ -969,8 +969,8 @@ abstract class Builder $sort = in_array($sort, ['ASC', 'DESC'], true) ? ' ' . $sort : ''; $bind = $query->getFieldsBindType(); - foreach ($val as $item) { - $val[] = $this->parseDataBind($query, $key, $item, $bind); + foreach ($val as $k => $item) { + $val[$k] = $this->parseDataBind($query, $key, $item, $bind); } return 'field(' . $this->parseKey($query, $key, true) . ',' . implode(',', $val) . ')' . $sort; diff --git a/vendor/topthink/think-orm/src/db/PDOConnection.php b/vendor/topthink/think-orm/src/db/PDOConnection.php index 0a51c0c..60679af 100644 --- a/vendor/topthink/think-orm/src/db/PDOConnection.php +++ b/vendor/topthink/think-orm/src/db/PDOConnection.php @@ -16,6 +16,7 @@ use Closure; use PDO; use PDOStatement; use think\db\exception\BindParamException; +use think\db\exception\DbEventException; use think\db\exception\DbException; use think\db\exception\PDOException; use think\Model; @@ -865,18 +866,18 @@ abstract class PDOConnection extends Connection public function find(BaseQuery $query): array { // 事件回调 - $result = $this->db->trigger('before_find', $query); - - if (!$result) { - // 执行查询 - $resultSet = $this->pdoQuery($query, function ($query) { - return $this->builder->select($query, true); - }); - - $result = $resultSet[0] ?? []; + try { + $this->db->trigger('before_find', $query); + } catch (DbEventException $e) { + return []; } - return $result; + // 执行查询 + $resultSet = $this->pdoQuery($query, function ($query) { + return $this->builder->select($query, true); + }); + + return $resultSet[0] ?? []; } /** @@ -908,16 +909,16 @@ abstract class PDOConnection extends Connection */ public function select(BaseQuery $query): array { - $resultSet = $this->db->trigger('before_select', $query); - - if (!$resultSet) { - // 执行查询操作 - $resultSet = $this->pdoQuery($query, function ($query) { - return $this->builder->select($query); - }); + try { + $this->db->trigger('before_select', $query); + } catch (DbEventException $e) { + return []; } - return $resultSet; + // 执行查询操作 + return $this->pdoQuery($query, function ($query) { + return $this->builder->select($query); + }); } /** @@ -1158,7 +1159,7 @@ abstract class PDOConnection extends Connection $field = $aggregate . '(' . (!empty($distinct) ? 'DISTINCT ' : '') . $this->builder->parseKey($query, $field, true) . ') AS think_' . strtolower($aggregate); - $result = $this->value($query, $field, 0, false); + $result = $this->value($query, $field, 0); return $force ? (float) $result : $result; } @@ -1448,7 +1449,7 @@ abstract class PDOConnection extends Connection } $this->reConnectTimes = 0; } catch (\Throwable | \Exception $e) { - if ($this->transTimes === 1 && $this->reConnectTimes < 4 && $this->isBreak($e)) { + if (1 === $this->transTimes && $this->reConnectTimes < 4 && $this->isBreak($e)) { --$this->transTimes; ++$this->reConnectTimes; $this->close()->startTrans(); @@ -1566,10 +1567,10 @@ abstract class PDOConnection extends Connection */ public function close() { - $this->linkID = null; - $this->linkWrite = null; - $this->linkRead = null; - $this->links = []; + $this->linkID = null; + $this->linkWrite = null; + $this->linkRead = null; + $this->links = []; $this->transTimes = 0; $this->free(); diff --git a/vendor/topthink/think-orm/src/db/concern/ResultOperation.php b/vendor/topthink/think-orm/src/db/concern/ResultOperation.php index d93c409..de01093 100644 --- a/vendor/topthink/think-orm/src/db/concern/ResultOperation.php +++ b/vendor/topthink/think-orm/src/db/concern/ResultOperation.php @@ -149,7 +149,7 @@ trait ResultOperation /** * 处理空数据 * @access protected - * @return array|Model|null + * @return array|Model|null|static * @throws DbException * @throws ModelNotFoundException * @throws DataNotFoundException @@ -167,7 +167,7 @@ trait ResultOperation * 查找单条记录 不存在返回空数据(或者空模型) * @access public * @param mixed $data 数据 - * @return array|Model + * @return array|Model|static */ public function findOrEmpty($data = null) { @@ -226,7 +226,9 @@ trait ResultOperation * 查找多条记录 如果不存在则抛出异常 * @access public * @param array|string|Query|Closure $data 数据 - * @return array|Model + * @return array|Collection|static[] + * @throws ModelNotFoundException + * @throws DataNotFoundException */ public function selectOrFail($data = null) { @@ -237,7 +239,9 @@ trait ResultOperation * 查找单条记录 如果不存在则抛出异常 * @access public * @param array|string|Query|Closure $data 数据 - * @return array|Model + * @return array|Model|static + * @throws ModelNotFoundException + * @throws DataNotFoundException */ public function findOrFail($data = null) { diff --git a/vendor/topthink/think-orm/src/db/exception/DbEventException.php b/vendor/topthink/think-orm/src/db/exception/DbEventException.php new file mode 100644 index 0000000..394a1e8 --- /dev/null +++ b/vendor/topthink/think-orm/src/db/exception/DbEventException.php @@ -0,0 +1,19 @@ + +// +---------------------------------------------------------------------- + +namespace think\db\exception; + +/** + * Db事件异常 + */ +class DbEventException extends DbException +{ +} diff --git a/vendor/topthink/think-orm/src/model/Relation.php b/vendor/topthink/think-orm/src/model/Relation.php index e823bd9..1779896 100644 --- a/vendor/topthink/think-orm/src/model/Relation.php +++ b/vendor/topthink/think-orm/src/model/Relation.php @@ -79,6 +79,12 @@ abstract class Relation */ protected $withField; + /** + * 排除关联数据字段 + * @var array + */ + protected $withoutField; + /** * 获取关联的所属模型 * @access public @@ -236,6 +242,22 @@ abstract class Relation return $this; } + /** + * 排除关联数据的字段 + * @access public + * @param array|string $field 关联字段限制 + * @return $this + */ + public function withoutField($field) + { + if (is_string($field)) { + $field = array_map('trim', explode(',', $field)); + } + + $this->withoutField = $field; + return $this; + } + /** * 判断闭包的参数类型 * @access protected diff --git a/vendor/topthink/think-orm/src/model/concern/Attribute.php b/vendor/topthink/think-orm/src/model/concern/Attribute.php index 8f6f918..34cb59a 100644 --- a/vendor/topthink/think-orm/src/model/concern/Attribute.php +++ b/vendor/topthink/think-orm/src/model/concern/Attribute.php @@ -496,7 +496,9 @@ trait Attribute $value = $this->getJsonValue($fieldName, $value); } else { $closure = $this->withAttr[$fieldName]; - $value = $closure($value, $this->data); + if ($closure instanceof \Closure) { + $value = $closure($value, $this->data); + } } } elseif (method_exists($this, $method)) { if ($relation) { diff --git a/vendor/topthink/think-orm/src/model/concern/ModelEvent.php b/vendor/topthink/think-orm/src/model/concern/ModelEvent.php index f560379..d2388ab 100644 --- a/vendor/topthink/think-orm/src/model/concern/ModelEvent.php +++ b/vendor/topthink/think-orm/src/model/concern/ModelEvent.php @@ -74,7 +74,7 @@ trait ModelEvent if (method_exists(static::class, $call)) { $result = call_user_func([static::class, $call], $this); } elseif (is_object(self::$event) && method_exists(self::$event, 'trigger')) { - $result = self::$event->trigger(static::class . '.' . $event, $this); + $result = self::$event->trigger('model.' . static::class . '.' . $event, $this); $result = empty($result) ? true : end($result); } else { $result = true; diff --git a/vendor/topthink/think-orm/src/model/concern/SoftDelete.php b/vendor/topthink/think-orm/src/model/concern/SoftDelete.php index 5a9a56d..8d76bb0 100644 --- a/vendor/topthink/think-orm/src/model/concern/SoftDelete.php +++ b/vendor/topthink/think-orm/src/model/concern/SoftDelete.php @@ -151,8 +151,16 @@ trait SoftDelete */ public static function destroy($data, bool $force = false): bool { - // 包含软删除数据 - $query = (new static())->withTrashedData(true)->db(false); + // 传入空值(包括空字符串和空数组)的时候不会做任何的数据删除操作,但传入0则是有效的 + if(empty($data) && $data !== 0){ + return false; + } + // 仅当强制删除时包含软删除数据 + $model = (new static()); + if($force){ + $model->withTrashedData(true); + } + $query = $model->db(false); if (is_array($data) && key($data) !== 0) { $query->where($data); diff --git a/vendor/topthink/think-orm/src/model/concern/TimeStamp.php b/vendor/topthink/think-orm/src/model/concern/TimeStamp.php index e207961..2492e06 100644 --- a/vendor/topthink/think-orm/src/model/concern/TimeStamp.php +++ b/vendor/topthink/think-orm/src/model/concern/TimeStamp.php @@ -77,6 +77,21 @@ trait TimeStamp return $type; } + /** + * 设置时间字段名称 + * @access public + * @param string $createTime + * @param string $updateTime + * @return $this + */ + public function setTimeField(string $createTime, string $updateTime) + { + $this->createTime = $createTime; + $this->updateTime = $updateTime; + + return $this; + } + /** * 获取自动写入时间字段 * @access public diff --git a/vendor/topthink/think-orm/src/model/concern/Virtual.php b/vendor/topthink/think-orm/src/model/concern/Virtual.php new file mode 100644 index 0000000..66cdfb7 --- /dev/null +++ b/vendor/topthink/think-orm/src/model/concern/Virtual.php @@ -0,0 +1,90 @@ + +// +---------------------------------------------------------------------- +declare (strict_types = 1); + +namespace think\model\concern; + +use think\db\BaseQuery as Query; +use think\db\exception\DbException as Exception; + +/** + * 虚拟模型 + */ +trait Virtual +{ + /** + * 获取当前模型的数据库查询对象 + * @access public + * @param array $scope 设置不使用的全局查询范围 + * @return Query + */ + public function db($scope = []): Query + { + throw new Exception('virtual model not support db query'); + } + + /** + * 获取字段类型信息 + * @access public + * @param string $field 字段名 + * @return string|null + */ + public function getFieldType(string $field) + {} + + /** + * 保存当前数据对象 + * @access public + * @param array $data 数据 + * @param string $sequence 自增序列名 + * @return bool + */ + public function save(array $data = [], string $sequence = null): bool + { + // 数据对象赋值 + $this->setAttrs($data); + + if ($this->isEmpty() || false === $this->trigger('BeforeWrite')) { + return false; + } + + // 写入回调 + $this->trigger('AfterWrite'); + + $this->exists(true); + + return true; + } + + /** + * 删除当前的记录 + * @access public + * @return bool + */ + public function delete(): bool + { + if (!$this->isExists() || $this->isEmpty() || false === $this->trigger('BeforeDelete')) { + return false; + } + + // 关联删除 + if (!empty($this->relationWrite)) { + $this->autoRelationDelete(); + } + + $this->trigger('AfterDelete'); + + $this->exists(false); + + return true; + } + +} diff --git a/vendor/topthink/think-orm/src/model/relation/BelongsToMany.php b/vendor/topthink/think-orm/src/model/relation/BelongsToMany.php index 6b64d95..5f177c1 100644 --- a/vendor/topthink/think-orm/src/model/relation/BelongsToMany.php +++ b/vendor/topthink/think-orm/src/model/relation/BelongsToMany.php @@ -443,7 +443,12 @@ class BelongsToMany extends Relation if (empty($this->baseQuery)) { $tableName = $this->query->getTable(); $table = $this->pivot->db()->getTable(); - $fields = $this->getQueryFields($tableName); + + if ($this->withoutField) { + $this->query->withoutField($this->withoutField); + } + + $fields = $this->getQueryFields($tableName); if ($this->withLimit) { $this->query->limit($this->withLimit); diff --git a/vendor/topthink/think-orm/src/model/relation/HasMany.php b/vendor/topthink/think-orm/src/model/relation/HasMany.php index a67d41b..49f4c93 100644 --- a/vendor/topthink/think-orm/src/model/relation/HasMany.php +++ b/vendor/topthink/think-orm/src/model/relation/HasMany.php @@ -206,6 +206,10 @@ class HasMany extends Relation $closure($this->getClosureType($closure)); } + if ($this->withoutField) { + $this->query->withoutField($this->withoutField); + } + $list = $this->query ->where($where) ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) diff --git a/vendor/topthink/think-orm/src/model/relation/HasManyThrough.php b/vendor/topthink/think-orm/src/model/relation/HasManyThrough.php index 30d5ca4..4de5060 100644 --- a/vendor/topthink/think-orm/src/model/relation/HasManyThrough.php +++ b/vendor/topthink/think-orm/src/model/relation/HasManyThrough.php @@ -366,7 +366,12 @@ class HasManyThrough extends Relation $pk = $this->throughPk; $throughKey = $this->throughKey; $modelTable = $this->parent->getTable(); - $fields = $this->getQueryFields($alias); + + if ($this->withoutField) { + $this->query->withoutField($this->withoutField); + } + + $fields = $this->getQueryFields($alias); $this->query ->field($fields) diff --git a/vendor/topthink/think-orm/src/model/relation/MorphToMany.php b/vendor/topthink/think-orm/src/model/relation/MorphToMany.php index 88bbf9a..32f853f 100644 --- a/vendor/topthink/think-orm/src/model/relation/MorphToMany.php +++ b/vendor/topthink/think-orm/src/model/relation/MorphToMany.php @@ -200,7 +200,12 @@ class MorphToMany extends BelongsToMany // 关联查询封装 $tableName = $this->query->getTable(); $table = $this->pivot->db()->getTable(); - $fields = $this->getQueryFields($tableName); + + if ($this->withoutField) { + $this->query->withoutField($this->withoutField); + } + + $fields = $this->getQueryFields($tableName); if ($this->withLimit) { $this->query->limit($this->withLimit); diff --git a/vendor/topthink/think-orm/src/model/relation/OneToOne.php b/vendor/topthink/think-orm/src/model/relation/OneToOne.php index 65bbfda..d47d7f3 100644 --- a/vendor/topthink/think-orm/src/model/relation/OneToOne.php +++ b/vendor/topthink/think-orm/src/model/relation/OneToOne.php @@ -305,6 +305,8 @@ abstract class OneToOne extends Relation if ($this->withField) { $this->query->field($this->withField); + } elseif ($this->withoutField) { + $this->query->withoutField($this->withoutField); } $list = $this->query