ComposerUpdate

This commit is contained in:
Anyon 2020-08-24 14:33:47 +08:00
parent 7e4155f77f
commit 57ad11c63e
6 changed files with 21 additions and 22 deletions

8
composer.lock generated
View File

@ -937,12 +937,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "c2a6046bfaa13a9d42a2c82a18425c9d5841c5f2" "reference": "62a79d2ab6f1e4bf79e2c5bac8f1e659109a9242"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c2a6046bfaa13a9d42a2c82a18425c9d5841c5f2", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/62a79d2ab6f1e4bf79e2c5bac8f1e659109a9242",
"reference": "c2a6046bfaa13a9d42a2c82a18425c9d5841c5f2", "reference": "62a79d2ab6f1e4bf79e2c5bac8f1e659109a9242",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -987,7 +987,7 @@
], ],
"description": "ThinkPHP v6.0 Development Library", "description": "ThinkPHP v6.0 Development Library",
"homepage": "http://thinkadmin.top", "homepage": "http://thinkadmin.top",
"time": "2020-08-24T05:58:10+00:00" "time": "2020-08-24T06:25:31+00:00"
}, },
{ {
"name": "zoujingli/wechat-developer", "name": "zoujingli/wechat-developer",

View File

@ -963,12 +963,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "c2a6046bfaa13a9d42a2c82a18425c9d5841c5f2" "reference": "62a79d2ab6f1e4bf79e2c5bac8f1e659109a9242"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c2a6046bfaa13a9d42a2c82a18425c9d5841c5f2", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/62a79d2ab6f1e4bf79e2c5bac8f1e659109a9242",
"reference": "c2a6046bfaa13a9d42a2c82a18425c9d5841c5f2", "reference": "62a79d2ab6f1e4bf79e2c5bac8f1e659109a9242",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -985,7 +985,7 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"topthink/framework": "^6.0" "topthink/framework": "^6.0"
}, },
"time": "2020-08-24T05:58:10+00:00", "time": "2020-08-24T06:25:31+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-08-24 14:03:20 // This file is automatically generated at:2020-08-24 14:33:34
declare (strict_types = 1); declare (strict_types = 1);
return array ( return array (
0 => 'think\\admin\\Library', 0 => 'think\\admin\\Library',

View File

@ -58,7 +58,7 @@ class InstallService extends Service
// 扫描规则文件 // 扫描规则文件
foreach ($rules as $key => $rule) { foreach ($rules as $key => $rule) {
$name = strtr(trim($rule, '\\/'), '\\', '/'); $name = strtr(trim($rule, '\\/'), '\\', '/');
$data = array_merge($data, $this->_scanList("{$this->root}{$name}")); $data = array_merge($data, $this->_scanList($this->root . $name));
} }
// 清除忽略文件 // 清除忽略文件
foreach ($data as $key => $item) foreach ($ignore as $ign) { foreach ($data as $key => $item) foreach ($ignore as $ign) {
@ -77,7 +77,7 @@ class InstallService extends Service
public function grenerateDifference(array $rules = [], array $ignore = []): array public function grenerateDifference(array $rules = [], array $ignore = []): array
{ {
[$rules1, $ignore1, $data] = [$rules, $ignore, []]; [$rules1, $ignore1, $data] = [$rules, $ignore, []];
$result = json_decode(HttpExtend::post("{$this->server}/admin/api.update/node", [ $result = json_decode(HttpExtend::post($this->server . '/admin/api.update/node', [
'rules' => json_encode($rules1), 'ignore' => json_encode($ignore1), 'rules' => json_encode($rules1), 'ignore' => json_encode($ignore1),
]), true); ]), true);
if (!empty($result['code'])) { if (!empty($result['code'])) {
@ -122,7 +122,7 @@ class InstallService extends Service
*/ */
private function _downloadFile($encode) private function _downloadFile($encode)
{ {
$source = "{$this->server}/admin/api.update/get?encode={$encode}"; $source = $this->server . '/admin/api.update/get?encode=' . $encode;
$result = json_decode(HttpExtend::get($source), true); $result = json_decode(HttpExtend::get($source), true);
if (empty($result['code'])) return false; if (empty($result['code'])) return false;
$filename = $this->root . decode($encode); $filename = $this->root . decode($encode);

View File

@ -147,7 +147,7 @@ class ModuleService extends Service
$vars = $this->_getModuleVersion($name); $vars = $this->_getModuleVersion($name);
if (is_array($vars) && isset($vars['version']) && preg_match('|^\d{4}\.\d{2}\.\d{2}\.\d{2}$|', $vars['version'])) { if (is_array($vars) && isset($vars['version']) && preg_match('|^\d{4}\.\d{2}\.\d{2}\.\d{2}$|', $vars['version'])) {
$data[$name] = array_merge($vars, ['change' => []]); $data[$name] = array_merge($vars, ['change' => []]);
foreach ($service->scanDirectory($this->_getModulePath($name) . 'change/', [], 'md') as $file) { foreach ($service->scanDirectory($this->_getModulePath($name) . 'change', [], 'md') as $file) {
$data[$name]['change'][pathinfo($file, PATHINFO_FILENAME)] = Parsedown::instance()->parse(file_get_contents($file)); $data[$name]['change'][pathinfo($file, PATHINFO_FILENAME)] = Parsedown::instance()->parse(file_get_contents($file));
} }
} }
@ -164,7 +164,7 @@ class ModuleService extends Service
$data = $this->app->cache->get('moduleAllowRule', []); $data = $this->app->cache->get('moduleAllowRule', []);
if (is_array($data) && count($data) > 0) return $data; if (is_array($data) && count($data) > 0) return $data;
$data = ['config', 'public/static']; $data = ['config', 'public/static'];
foreach (array_keys($this->getModules()) as $name) $data[] = "app/{$name}"; foreach (array_keys($this->getModules()) as $name) $data[] = 'app/' . $name;
$this->app->cache->set('moduleAllowRule', $data, 30); $this->app->cache->set('moduleAllowRule', $data, 30);
return $data; return $data;
} }

View File

@ -143,8 +143,8 @@ class NodeService extends Service
*/ */
public function scanDirectory($path, $data = [], $ext = 'php') public function scanDirectory($path, $data = [], $ext = 'php')
{ {
if (file_exists($path) && is_dir($path)) { if (file_exists($path)) if (is_file($path)) $data[] = $path;
foreach (scandir($path) as $item) if ($item[0] !== '.') { elseif (is_dir($path)) foreach (scandir($path) as $item) if ($item[0] !== '.') {
$realpath = rtrim($path, '\\/') . DIRECTORY_SEPARATOR . $item; $realpath = rtrim($path, '\\/') . DIRECTORY_SEPARATOR . $item;
if (is_readable($realpath)) if (is_dir($realpath)) { if (is_readable($realpath)) if (is_dir($realpath)) {
$data = $this->scanDirectory($realpath, $data, $ext); $data = $this->scanDirectory($realpath, $data, $ext);
@ -152,7 +152,6 @@ class NodeService extends Service
$data[] = strtr($realpath, '\\', '/'); $data[] = strtr($realpath, '\\', '/');
} }
} }
}
return $data; return $data;
} }
} }