[更新]ComposerUpdate

This commit is contained in:
Anyon 2019-07-19 11:44:46 +08:00
parent 93ff22720e
commit 7826bd3122
5 changed files with 25 additions and 31 deletions

2
vendor/autoload.php vendored
View File

@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit9e86e7f0caf03b802905a68d453659bc::getLoader(); return ComposerAutoloaderInit715bbba180591c7e55267e7c41402e91::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInit9e86e7f0caf03b802905a68d453659bc class ComposerAutoloaderInit715bbba180591c7e55267e7c41402e91
{ {
private static $loader; private static $loader;
@ -19,15 +19,15 @@ class ComposerAutoloaderInit9e86e7f0caf03b802905a68d453659bc
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInit9e86e7f0caf03b802905a68d453659bc', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInit715bbba180591c7e55267e7c41402e91', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit9e86e7f0caf03b802905a68d453659bc', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit715bbba180591c7e55267e7c41402e91', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) { if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php'; require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit9e86e7f0caf03b802905a68d453659bc::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInit715bbba180591c7e55267e7c41402e91::getInitializer($loader));
} else { } else {
$map = require __DIR__ . '/autoload_namespaces.php'; $map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) { foreach ($map as $namespace => $path) {
@ -48,19 +48,19 @@ class ComposerAutoloaderInit9e86e7f0caf03b802905a68d453659bc
$loader->register(true); $loader->register(true);
if ($useStaticLoader) { if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit9e86e7f0caf03b802905a68d453659bc::$files; $includeFiles = Composer\Autoload\ComposerStaticInit715bbba180591c7e55267e7c41402e91::$files;
} else { } else {
$includeFiles = require __DIR__ . '/autoload_files.php'; $includeFiles = require __DIR__ . '/autoload_files.php';
} }
foreach ($includeFiles as $fileIdentifier => $file) { foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire9e86e7f0caf03b802905a68d453659bc($fileIdentifier, $file); composerRequire715bbba180591c7e55267e7c41402e91($fileIdentifier, $file);
} }
return $loader; return $loader;
} }
} }
function composerRequire9e86e7f0caf03b802905a68d453659bc($fileIdentifier, $file) function composerRequire715bbba180591c7e55267e7c41402e91($fileIdentifier, $file)
{ {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file; require $file;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInit9e86e7f0caf03b802905a68d453659bc class ComposerStaticInit715bbba180591c7e55267e7c41402e91
{ {
public static $files = array ( public static $files = array (
'841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php', '841780ea2e1d6545ea3a253239d59c05' => __DIR__ . '/..' . '/qiniu/php-sdk/src/Qiniu/functions.php',
@ -347,9 +347,9 @@ class ComposerStaticInit9e86e7f0caf03b802905a68d453659bc
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit9e86e7f0caf03b802905a68d453659bc::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInit715bbba180591c7e55267e7c41402e91::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit9e86e7f0caf03b802905a68d453659bc::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit715bbba180591c7e55267e7c41402e91::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit9e86e7f0caf03b802905a68d453659bc::$classMap; $loader->classMap = ComposerStaticInit715bbba180591c7e55267e7c41402e91::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }

View File

@ -502,12 +502,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "792cc96d0b400bde724d40a4296a4b9c98136cb4" "reference": "f3eeca76e07fc7b21f9879ca1ead5b2f30c97d99"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/792cc96d0b400bde724d40a4296a4b9c98136cb4", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/f3eeca76e07fc7b21f9879ca1ead5b2f30c97d99",
"reference": "792cc96d0b400bde724d40a4296a4b9c98136cb4", "reference": "f3eeca76e07fc7b21f9879ca1ead5b2f30c97d99",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -526,7 +526,7 @@
"qiniu/php-sdk": "^7.2", "qiniu/php-sdk": "^7.2",
"topthink/framework": "5.1.*" "topthink/framework": "5.1.*"
}, },
"time": "2019-07-19T03:28:52+00:00", "time": "2019-07-19T03:42:10+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {

View File

@ -53,9 +53,7 @@ class Sync extends Command
$this->version = config('app.thinkadmin_ver'); $this->version = config('app.thinkadmin_ver');
if (empty($this->version)) $this->version = 'v4'; if (empty($this->version)) $this->version = 'v4';
$this->uri = "https://{$this->version}.thinkadmin.top"; $this->uri = "https://{$this->version}.thinkadmin.top";
if (is_string($name) && !empty($name)) { parent::__construct($name);
parent::__construct($name);
}
} }
/** /**
@ -65,18 +63,14 @@ class Sync extends Command
*/ */
protected function execute(Input $input, Output $output) protected function execute(Input $input, Output $output)
{ {
$output->newLine();
$output->comment("=== 准备从代码仓库下载更新{$this->version}版本文件 ===");
$output->newLine();
$files = []; $files = [];
foreach ($this->getDiff() as $file) foreach ($this->modules as $module) { $output->comment("=== 准备从代码仓库下载更新{$this->version}版本文件 ===");
if (stripos($file['name'], $module) === 0) $files[] = $file; foreach ($this->getDiff() as $file) if (in_array($file['type'], ['add', 'del', 'mod'])) {
foreach ($this->modules as $module) if (stripos($file['name'], $module) === 0) $files[] = $file;
} }
if (empty($files)) $output->info('--- 本地文件与线上文件一致,无需要下载及更新文件'); if (empty($files)) $output->info('--- 本地文件与线上文件一致,无需更新文件');
else foreach ($files as $file) $this->syncFile($file, $output); else foreach ($files as $file) $this->syncFile($file, $output);
$output->newLine(); $output->comment("=== 从代码仓库下载{$this->version}版本同步更新成功 ===");
$output->comment("=== 从代码仓库下载{$this->version}版本并更新文件成功 ===");
$output->newLine();
} }
/** /**
@ -137,9 +131,9 @@ class Sync extends Command
$output->error("--- 下载 {$file['name']} 更新失败"); $output->error("--- 下载 {$file['name']} 更新失败");
} }
} elseif (in_array($file['type'], ['del'])) { } elseif (in_array($file['type'], ['del'])) {
$realfile = realpath(env('root_path') . $file['name']); $real = realpath(env('root_path') . $file['name']);
if (is_file($realfile) && unlink($realfile)) { if (is_file($real) && unlink($real)) {
$this->delEmptyDir(dirname($realfile)); $this->delEmptyDir(dirname($real));
$output->writeln("--- 删除 {$file['name']} 文件成功"); $output->writeln("--- 删除 {$file['name']} 文件成功");
} else { } else {
$output->error("--- 删除 {$file['name']} 文件失败"); $output->error("--- 删除 {$file['name']} 文件失败");