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

View File

@ -963,12 +963,12 @@
"source": {
"type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "c2a6046bfaa13a9d42a2c82a18425c9d5841c5f2"
"reference": "62a79d2ab6f1e4bf79e2c5bac8f1e659109a9242"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c2a6046bfaa13a9d42a2c82a18425c9d5841c5f2",
"reference": "c2a6046bfaa13a9d42a2c82a18425c9d5841c5f2",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/62a79d2ab6f1e4bf79e2c5bac8f1e659109a9242",
"reference": "62a79d2ab6f1e4bf79e2c5bac8f1e659109a9242",
"shasum": "",
"mirrors": [
{
@ -985,7 +985,7 @@
"ext-mbstring": "*",
"topthink/framework": "^6.0"
},
"time": "2020-08-24T05:58:10+00:00",
"time": "2020-08-24T06:25:31+00:00",
"type": "library",
"extra": {
"think": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?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);
return array (
0 => 'think\\admin\\Library',

View File

@ -58,7 +58,7 @@ class InstallService extends Service
// 扫描规则文件
foreach ($rules as $key => $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) {
@ -77,7 +77,7 @@ class InstallService extends Service
public function grenerateDifference(array $rules = [], array $ignore = []): array
{
[$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),
]), true);
if (!empty($result['code'])) {
@ -122,7 +122,7 @@ class InstallService extends Service
*/
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);
if (empty($result['code'])) return false;
$filename = $this->root . decode($encode);

View File

@ -147,7 +147,7 @@ class ModuleService extends Service
$vars = $this->_getModuleVersion($name);
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' => []]);
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));
}
}
@ -164,7 +164,7 @@ class ModuleService extends Service
$data = $this->app->cache->get('moduleAllowRule', []);
if (is_array($data) && count($data) > 0) return $data;
$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);
return $data;
}

View File

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