ComposerUpdate

This commit is contained in:
Anyon 2020-07-30 17:54:06 +08:00
parent 98f42ed0cd
commit 6aeb6d0c96
9 changed files with 26 additions and 32 deletions

8
composer.lock generated
View File

@ -879,12 +879,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "845f0e19f58548a241fb42369344ca5b3f221337" "reference": "c5ae2601c499d95776061aeda087478f7912c2c5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/845f0e19f58548a241fb42369344ca5b3f221337", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c5ae2601c499d95776061aeda087478f7912c2c5",
"reference": "845f0e19f58548a241fb42369344ca5b3f221337", "reference": "c5ae2601c499d95776061aeda087478f7912c2c5",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -928,7 +928,7 @@
], ],
"description": "ThinkPHP v6.0 Development Library", "description": "ThinkPHP v6.0 Development Library",
"homepage": "http://framework.thinkadmin.top", "homepage": "http://framework.thinkadmin.top",
"time": "2020-07-30T08:07:27+00:00" "time": "2020-07-30T09:50:41+00:00"
}, },
{ {
"name": "zoujingli/wechat-developer", "name": "zoujingli/wechat-developer",

View File

@ -903,12 +903,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "845f0e19f58548a241fb42369344ca5b3f221337" "reference": "c5ae2601c499d95776061aeda087478f7912c2c5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/845f0e19f58548a241fb42369344ca5b3f221337", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c5ae2601c499d95776061aeda087478f7912c2c5",
"reference": "845f0e19f58548a241fb42369344ca5b3f221337", "reference": "c5ae2601c499d95776061aeda087478f7912c2c5",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -924,7 +924,7 @@
"ext-json": "*", "ext-json": "*",
"topthink/framework": "^6.0" "topthink/framework": "^6.0"
}, },
"time": "2020-07-30T08:07:27+00:00", "time": "2020-07-30T09:50:41+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"think": { "think": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php <?php
// This file is automatically generated at:2020-07-30 16:11:54 // This file is automatically generated at:2020-07-30 17:53:29
declare (strict_types = 1); declare (strict_types = 1);
return array ( return array (
0 => 'think\\admin\\Library', 0 => 'think\\admin\\Library',

View File

@ -2,7 +2,7 @@
"type": "library", "type": "library",
"name": "zoujingli/think-library", "name": "zoujingli/think-library",
"license": "MIT", "license": "MIT",
"homepage": "http://thinkadmin.top", "homepage": "http://framework.thinkadmin.top",
"description": "ThinkPHP v6.0 Development Library", "description": "ThinkPHP v6.0 Development Library",
"authors": [ "authors": [
{ {

View File

@ -17,6 +17,7 @@ namespace think\admin;
use think\admin\command\Database; use think\admin\command\Database;
use think\admin\command\Install; use think\admin\command\Install;
use think\admin\command\Queue;
use think\admin\command\Version; use think\admin\command\Version;
use think\admin\multiple\App; use think\admin\multiple\App;
use think\admin\multiple\command\Build; use think\admin\multiple\command\Build;
@ -46,12 +47,12 @@ class Library extends Service
$this->app->event->listen('HttpRun', function () { $this->app->event->listen('HttpRun', function () {
$this->app->middleware->add(App::class); $this->app->middleware->add(App::class);
}); });
// 替换 ThinkPHP 地址处理
$this->app->bind('think\route\Url', Url::class);
// 替换 ThinkPHP 指令 // 替换 ThinkPHP 指令
$this->commands(['build' => Build::class, 'clear' => Clear::class]); $this->commands(['build' => Build::class, 'clear' => Clear::class]);
// 注册 ThinkAdmin 指令 // 注册 ThinkAdmin 指令
$this->commands([Queue::class, Install::class, Version::class, Database::class]); $this->commands([Queue::class, Install::class, Version::class, Database::class]);
// 动态绑定运行配置
$this->app->bind('think\route\Url', Url::class);
// 动态应用配置参数 // 动态应用配置参数
SystemService::instance()->bindRuntime(); SystemService::instance()->bindRuntime();
} }

View File

@ -65,7 +65,7 @@ abstract class Storage
/** /**
* 存储初始化 * 存储初始化
* @return Storage|AliossStorage|LocalStorage|QiniuStorage * @return static
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
@ -98,7 +98,7 @@ abstract class Storage
/** /**
* 设置文件驱动名称 * 设置文件驱动名称
* @param string $name 驱动名称 * @param string $name 驱动名称
* @return AliossStorage|LocalStorage|QiniuStorage * @return static
* @throws Exception * @throws Exception
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException

View File

@ -37,12 +37,6 @@ class AliossStorage extends Storage
*/ */
private $bucket; private $bucket;
/**
* 绑定访问域名
* @var string
*/
private $domain;
/** /**
* AccessKeyId * AccessKeyId
* @var string * @var string
@ -68,14 +62,14 @@ class AliossStorage extends Storage
// 读取配置文件 // 读取配置文件
$this->point = sysconf('storage.alioss_point'); $this->point = sysconf('storage.alioss_point');
$this->bucket = sysconf('storage.alioss_bucket'); $this->bucket = sysconf('storage.alioss_bucket');
$this->domain = sysconf('storage.alioss_http_domain');
$this->accessKey = sysconf('storage.alioss_access_key'); $this->accessKey = sysconf('storage.alioss_access_key');
$this->secretKey = sysconf('storage.alioss_secret_key'); $this->secretKey = sysconf('storage.alioss_secret_key');
// 计算链接前缀 // 计算链接前缀
$type = strtolower(sysconf('storage.alioss_http_protocol')); $type = strtolower(sysconf('storage.alioss_http_protocol'));
if ($type === 'auto') $this->prefix = "//{$this->domain}"; $domain = strtolower(sysconf('storage.alioss_http_domain'));
elseif ($type === 'http') $this->prefix = "http://{$this->domain}"; if ($type === 'auto') $this->prefix = "//{$domain}";
elseif ($type === 'https') $this->prefix = "https://{$this->domain}"; elseif ($type === 'http') $this->prefix = "http://{$domain}";
elseif ($type === 'https') $this->prefix = "https://{$domain}";
else throw new \think\admin\Exception('未配置阿里云URL域名哦'); else throw new \think\admin\Exception('未配置阿里云URL域名哦');
// 初始化配置并返回当前实例 // 初始化配置并返回当前实例
return parent::initialize(); return parent::initialize();
@ -84,7 +78,7 @@ class AliossStorage extends Storage
/** /**
* 获取当前实例对象 * 获取当前实例对象
* @param null $name * @param null $name
* @return AliossStorage|LocalStorage|QiniuStorage * @return static
* @throws \think\admin\Exception * @throws \think\admin\Exception
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException

View File

@ -53,7 +53,7 @@ class LocalStorage extends Storage
/** /**
* 获取当前实例对象 * 获取当前实例对象
* @param null $name * @param null $name
* @return AliossStorage|LocalStorage|QiniuStorage * @return static
* @throws \think\admin\Exception * @throws \think\admin\Exception
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException

View File

@ -26,7 +26,6 @@ use think\admin\Storage;
class QiniuStorage extends Storage class QiniuStorage extends Storage
{ {
private $bucket; private $bucket;
private $domain;
private $accessKey; private $accessKey;
private $secretKey; private $secretKey;
@ -42,14 +41,14 @@ class QiniuStorage extends Storage
{ {
// 读取配置文件 // 读取配置文件
$this->bucket = sysconf('storage.qiniu_bucket'); $this->bucket = sysconf('storage.qiniu_bucket');
$this->domain = sysconf('storage.qiniu_http_domain');
$this->accessKey = sysconf('storage.qiniu_access_key'); $this->accessKey = sysconf('storage.qiniu_access_key');
$this->secretKey = sysconf('storage.qiniu_secret_key'); $this->secretKey = sysconf('storage.qiniu_secret_key');
// 计算链接前缀 // 计算链接前缀
$type = strtolower(sysconf('storage.qiniu_http_protocol')); $type = strtolower(sysconf('storage.qiniu_http_protocol'));
if ($type === 'auto') $this->prefix = "//{$this->domain}"; $domain = strtolower(sysconf('storage.qiniu_http_domain'));
elseif ($type === 'http') $this->prefix = "http://{$this->domain}"; if ($type === 'auto') $this->prefix = "//{$domain}";
elseif ($type === 'https') $this->prefix = "https://{$this->domain}"; elseif ($type === 'http') $this->prefix = "http://{$domain}";
elseif ($type === 'https') $this->prefix = "https://{$domain}";
else throw new \think\admin\Exception('未配置七牛云URL域名哦'); else throw new \think\admin\Exception('未配置七牛云URL域名哦');
// 初始化配置并返回当前实例 // 初始化配置并返回当前实例
return parent::initialize(); return parent::initialize();
@ -58,7 +57,7 @@ class QiniuStorage extends Storage
/** /**
* 获取当前实例对象 * 获取当前实例对象
* @param null $name * @param null $name
* @return AliossStorage|LocalStorage|QiniuStorage * @return static
* @throws \think\admin\Exception * @throws \think\admin\Exception
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException