ComposerUpdate

This commit is contained in:
Anyon 2020-04-16 15:26:49 +08:00
parent a9b96826e1
commit 13090cd996
5 changed files with 14 additions and 14 deletions

View File

@ -92,7 +92,6 @@ class Config extends Controller
$this->error("后台入口名称{$xpath}已经存在应用!"); $this->error("后台入口名称{$xpath}已经存在应用!");
} }
SystemService::instance()->setRuntime([$xpath => 'admin']); SystemService::instance()->setRuntime([$xpath => 'admin']);
SystemService::instance()->bindRuntime();
} }
foreach ($this->request->post() as $name => $value) sysconf($name, $value); foreach ($this->request->post() as $name => $value) sysconf($name, $value);
$this->success('修改系统参数成功!', sysuri("{$xpath}/index/index") . '#' . url("{$xpath}/config/index")); $this->success('修改系统参数成功!', sysuri("{$xpath}/index/index") . '#' . url("{$xpath}/config/index"));

8
composer.lock generated
View File

@ -909,12 +909,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "b8c0f8bbb01cecaf6ac42c1be10a9cf54e16a50e" "reference": "86bd9b95fc7080aa642c803446cde65acbaccedc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/b8c0f8bbb01cecaf6ac42c1be10a9cf54e16a50e", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/86bd9b95fc7080aa642c803446cde65acbaccedc",
"reference": "b8c0f8bbb01cecaf6ac42c1be10a9cf54e16a50e", "reference": "86bd9b95fc7080aa642c803446cde65acbaccedc",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -958,7 +958,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-04-16T07:13:37+00:00" "time": "2020-04-16T07:24:06+00:00"
}, },
{ {
"name": "zoujingli/wechat-developer", "name": "zoujingli/wechat-developer",

View File

@ -935,12 +935,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "b8c0f8bbb01cecaf6ac42c1be10a9cf54e16a50e" "reference": "86bd9b95fc7080aa642c803446cde65acbaccedc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/b8c0f8bbb01cecaf6ac42c1be10a9cf54e16a50e", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/86bd9b95fc7080aa642c803446cde65acbaccedc",
"reference": "b8c0f8bbb01cecaf6ac42c1be10a9cf54e16a50e", "reference": "86bd9b95fc7080aa642c803446cde65acbaccedc",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -956,7 +956,7 @@
"ext-json": "*", "ext-json": "*",
"topthink/framework": "^6.0" "topthink/framework": "^6.0"
}, },
"time": "2020-04-16T07:13:37+00:00", "time": "2020-04-16T07:24:06+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-04-16 15:15:34 // This file is automatically generated at:2020-04-16 15:26:23
declare (strict_types = 1); declare (strict_types = 1);
return array ( return array (
0 => 'think\\app\\Service', 0 => 'think\\app\\Service',

View File

@ -215,7 +215,6 @@ class SystemService extends Service
* 设置实时运行配置 * 设置实时运行配置
* @param array|null $map 应用映射 * @param array|null $map 应用映射
* @param string|null $run 支持模式 * @param string|null $run 支持模式
* @return boolean
*/ */
public function setRuntime($map = [], $run = null) public function setRuntime($map = [], $run = null)
{ {
@ -226,7 +225,8 @@ class SystemService extends Service
$file = "{$this->app->getRootPath()}runtime/config.json"; $file = "{$this->app->getRootPath()}runtime/config.json";
$data['app_run'] = is_null($run) ? $data['app_run'] : $run; $data['app_run'] = is_null($run) ? $data['app_run'] : $run;
$data['app_map'] = is_null($map) ? [] : array_merge($data['app_map'], $map); $data['app_map'] = is_null($map) ? [] : array_merge($data['app_map'], $map);
return file_put_contents($file, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT)); file_put_contents($file, json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
$this->bindRuntime($data);
} }
/** /**
@ -246,11 +246,12 @@ class SystemService extends Service
/** /**
* 绑定应用实时配置 * 绑定应用实时配置
* @param array $data 配置数据
*/ */
public function bindRuntime() public function bindRuntime($data = [])
{ {
// 动态绑定应用映射 // 动态绑定应用映射
$data = $this->getRuntime(); if (empty($data)) $data = $this->getRuntime();
if (!empty($data['app_map'])) { if (!empty($data['app_map'])) {
$maps = $this->app->config->get('app.app_map', []); $maps = $this->app->config->get('app.app_map', []);
if (is_array($maps) && count($maps) > 0 && count($data['app_map']) > 0) { if (is_array($maps) && count($maps) > 0 && count($data['app_map']) > 0) {