[更新]ComposerUpdate

This commit is contained in:
Anyon 2019-07-20 11:08:40 +08:00
parent 079c2dd28a
commit 556157c8ef
15 changed files with 125 additions and 30 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 ComposerAutoloaderInit715bbba180591c7e55267e7c41402e91::getLoader(); return ComposerAutoloaderInit05623102e809b1029859cb55f12358ed::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInit715bbba180591c7e55267e7c41402e91 class ComposerAutoloaderInit05623102e809b1029859cb55f12358ed
{ {
private static $loader; private static $loader;
@ -19,15 +19,15 @@ class ComposerAutoloaderInit715bbba180591c7e55267e7c41402e91
return self::$loader; return self::$loader;
} }
spl_autoload_register(array('ComposerAutoloaderInit715bbba180591c7e55267e7c41402e91', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInit05623102e809b1029859cb55f12358ed', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit715bbba180591c7e55267e7c41402e91', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit05623102e809b1029859cb55f12358ed', '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\ComposerStaticInit715bbba180591c7e55267e7c41402e91::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInit05623102e809b1029859cb55f12358ed::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 ComposerAutoloaderInit715bbba180591c7e55267e7c41402e91
$loader->register(true); $loader->register(true);
if ($useStaticLoader) { if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit715bbba180591c7e55267e7c41402e91::$files; $includeFiles = Composer\Autoload\ComposerStaticInit05623102e809b1029859cb55f12358ed::$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) {
composerRequire715bbba180591c7e55267e7c41402e91($fileIdentifier, $file); composerRequire05623102e809b1029859cb55f12358ed($fileIdentifier, $file);
} }
return $loader; return $loader;
} }
} }
function composerRequire715bbba180591c7e55267e7c41402e91($fileIdentifier, $file) function composerRequire05623102e809b1029859cb55f12358ed($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 ComposerStaticInit715bbba180591c7e55267e7c41402e91 class ComposerStaticInit05623102e809b1029859cb55f12358ed
{ {
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 ComposerStaticInit715bbba180591c7e55267e7c41402e91
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 = ComposerStaticInit715bbba180591c7e55267e7c41402e91::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInit05623102e809b1029859cb55f12358ed::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit715bbba180591c7e55267e7c41402e91::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit05623102e809b1029859cb55f12358ed::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit715bbba180591c7e55267e7c41402e91::$classMap; $loader->classMap = ComposerStaticInit05623102e809b1029859cb55f12358ed::$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": "f3eeca76e07fc7b21f9879ca1ead5b2f30c97d99" "reference": "c278499d1e7be0db3b76388112ae26038205d052"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/f3eeca76e07fc7b21f9879ca1ead5b2f30c97d99", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c278499d1e7be0db3b76388112ae26038205d052",
"reference": "f3eeca76e07fc7b21f9879ca1ead5b2f30c97d99", "reference": "c278499d1e7be0db3b76388112ae26038205d052",
"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:42:10+00:00", "time": "2019-07-20T03:04:58+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {

View File

@ -16,6 +16,8 @@
namespace library\command; namespace library\command;
use think\console\Command; use think\console\Command;
use think\console\Input;
use think\console\Output;
/** /**
* 清理会话文件 * 清理会话文件
@ -25,22 +27,30 @@ use think\console\Command;
class Sess extends Command class Sess extends Command
{ {
/**
* 指令属性配置
*/
protected function configure() protected function configure()
{ {
$this->setName('xclean:session')->setDescription('清理失效过期的会话文件'); $this->setName('xclean:session')->setDescription('清理失效过期的会话文件');
} }
protected function execute(\think\console\Input $input, \think\console\Output $output) /**
* 执行清理操作
* @param Input $input
* @param Output $output
*/
protected function execute(Input $input, Output $output)
{ {
$output->writeln('Start cleaning up invalid session files'); $output->comment('=== 准备清理无效的会话文件 ===');
foreach (glob(config('session.path') . 'sess_*') as $file) { foreach (glob(config('session.path') . 'sess_*') as $file) {
list($fileatime, $filesize) = [fileatime($file), filesize($file)]; list($fileatime, $filesize) = [fileatime($file), filesize($file)];
if ($filesize < 1 || $fileatime < time() - 3600) { if ($filesize < 1 || $fileatime < time() - 3600) {
$output->writeln('clear session file -> [ ' . date('Y-m-d H:i:s', $fileatime) . ' ] ' . basename($file) . " {$filesize}"); $output->info('clear session file -> [ ' . date('Y-m-d H:i:s', $fileatime) . ' ] ' . basename($file) . " {$filesize}");
@unlink($file); @unlink($file);
} }
} }
$output->writeln('Complete cleaning of invalid session files'); $output->comment('=== 成功清理无效的会话文件 ===');
} }
} }

View File

@ -57,7 +57,7 @@ class Sync extends Command
} }
/** /**
* 执行指令 * 执行更新操作
* @param Input $input * @param Input $input
* @param Output $output * @param Output $output
*/ */

View File

@ -25,17 +25,26 @@ use think\console\Output;
*/ */
class Admin extends Sync class Admin extends Sync
{ {
/**
* 指令属性配置
*/
protected function configure() protected function configure()
{ {
$this->modules = ['application/admin/', 'think']; $this->modules = ['application/admin/', 'think'];
$this->setName('xsync:admin')->setDescription('从远程覆盖本地Admin模块的所有代码'); $this->setName('xsync:admin')->setDescription('从远程覆盖本地Admin模块的所有代码');
} }
/**
* 执行更新操作
* @param Input $input
* @param Output $output
*/
protected function execute(Input $input, Output $output) protected function execute(Input $input, Output $output)
{ {
$root = str_replace('\\', '/', env('root_path')); $root = str_replace('\\', '/', env('root_path'));
if (file_exists("{$root}/application/admin/sync.lock")) { if (file_exists("{$root}/application/admin/sync.lock")) {
$this->output->error('admin module has been locked'); $this->output->error("--- Admin 模块已经被锁定,不能继续更新");
} else { } else {
parent::execute($input, $output); parent::execute($input, $output);
} }

View File

@ -25,17 +25,26 @@ use think\console\Output;
*/ */
class Config extends Sync class Config extends Sync
{ {
/**
* 指令属性配置
*/
protected function configure() protected function configure()
{ {
$this->modules = ['config/']; $this->modules = ['config/'];
$this->setName('xsync:config')->setDescription('从远程覆盖本地Config的部分配置文件'); $this->setName('xsync:config')->setDescription('从远程覆盖本地Config的部分配置文件');
} }
/**
* 执行更新操作
* @param Input $input
* @param Output $output
*/
protected function execute(Input $input, Output $output) protected function execute(Input $input, Output $output)
{ {
$root = str_replace('\\', '/', env('root_path')); $root = str_replace('\\', '/', env('root_path'));
if (file_exists("{$root}/config/sync.lock")) { if (file_exists("{$root}/config/sync.lock")) {
$this->output->error('config files has been locked'); $this->output->error("--- Config 配置已经被锁定,不能继续更新");
} else { } else {
parent::execute($input, $output); parent::execute($input, $output);
} }

View File

@ -25,17 +25,26 @@ use think\console\Output;
*/ */
class Plugs extends Sync class Plugs extends Sync
{ {
/**
* 指令属性配置
*/
protected function configure() protected function configure()
{ {
$this->modules = ['public/static/']; $this->modules = ['public/static/'];
$this->setName('xsync:plugs')->setDescription('从远程覆盖本地Plugs资源插件等代码'); $this->setName('xsync:plugs')->setDescription('从远程覆盖本地Plugs资源插件等代码');
} }
/**
* 执行更新操作
* @param Input $input
* @param Output $output
*/
protected function execute(Input $input, Output $output) protected function execute(Input $input, Output $output)
{ {
$root = str_replace('\\', '/', env('root_path')); $root = str_replace('\\', '/', env('root_path'));
if (file_exists("{$root}/public/static/sync.lock")) { if (file_exists("{$root}/public/static/sync.lock")) {
$this->output->error('plugs static files has been locked'); $this->output->error("--- Plugs 资源已经被锁定,不能继续更新");
} else { } else {
parent::execute($input, $output); parent::execute($input, $output);
} }

View File

@ -25,17 +25,25 @@ use think\console\Output;
*/ */
class Service extends Sync class Service extends Sync
{ {
/**
* 指令属性配置
*/
protected function configure() protected function configure()
{ {
$this->modules = ['application/service/']; $this->modules = ['application/service/'];
$this->setName('xsync:service')->setDescription('从远程覆盖本地Service模块的所有代码'); $this->setName('xsync:service')->setDescription('从远程覆盖本地Service模块的所有代码');
} }
/**
* 执行更新操作
* @param Input $input
* @param Output $output
*/
protected function execute(Input $input, Output $output) protected function execute(Input $input, Output $output)
{ {
$root = str_replace('\\', '/', env('root_path')); $root = str_replace('\\', '/', env('root_path'));
if (file_exists("{$root}/application/service/sync.lock")) { if (file_exists("{$root}/application/service/sync.lock")) {
$this->output->error('service module has been locked'); $this->output->error("--- Service 模块已经被锁定,不能继续更新");
} else { } else {
parent::execute($input, $output); parent::execute($input, $output);
} }

View File

@ -25,17 +25,26 @@ use think\console\Output;
*/ */
class Wechat extends Sync class Wechat extends Sync
{ {
/**
* 指令属性配置
*/
protected function configure() protected function configure()
{ {
$this->modules = ['application/wechat/']; $this->modules = ['application/wechat/'];
$this->setName('xsync:wechat')->setDescription('从远程覆盖本地Wechat模块的所有代码'); $this->setName('xsync:wechat')->setDescription('从远程覆盖本地Wechat模块的所有代码');
} }
/**
* 执行更新操作
* @param Input $input
* @param Output $output
*/
protected function execute(Input $input, Output $output) protected function execute(Input $input, Output $output)
{ {
$root = str_replace('\\', '/', env('root_path')); $root = str_replace('\\', '/', env('root_path'));
if (file_exists("{$root}/application/wechat/sync.lock")) { if (file_exists("{$root}/application/wechat/sync.lock")) {
$this->output->error('wechat module has been locked'); $this->output->error("--- Wechat 模块已经被锁定,不能继续更新");
} else { } else {
parent::execute($input, $output); parent::execute($input, $output);
} }

View File

@ -16,6 +16,8 @@
namespace library\command\task; namespace library\command\task;
use library\command\Task; use library\command\Task;
use think\console\Input;
use think\console\Output;
/** /**
* Class Reset * Class Reset
@ -24,12 +26,21 @@ use library\command\Task;
class Reset extends Task class Reset extends Task
{ {
/**
* 指令属性配置
*/
protected function configure() protected function configure()
{ {
$this->setName('xtask:reset')->setDescription('重新启动消息队列守护进程'); $this->setName('xtask:reset')->setDescription('重新启动消息队列守护进程');
} }
protected function execute(\think\console\Input $input, \think\console\Output $output) /**
* 执行重置操作
* @param Input $input
* @param Output $output
* @return int|void|null
*/
protected function execute(Input $input, Output $output)
{ {
if (($pid = $this->checkProcess()) > 0) { if (($pid = $this->checkProcess()) > 0) {
$this->closeProcess($pid); $this->closeProcess($pid);

View File

@ -16,6 +16,8 @@
namespace library\command\task; namespace library\command\task;
use library\command\Task; use library\command\Task;
use think\console\Input;
use think\console\Output;
/** /**
* Class Start * Class Start
@ -24,12 +26,20 @@ use library\command\Task;
class Start extends Task class Start extends Task
{ {
/**
* 指令属性配置
*/
protected function configure() protected function configure()
{ {
$this->setName('xtask:start')->setDescription('开始启动消息队列守护进程'); $this->setName('xtask:start')->setDescription('开始启动消息队列守护进程');
} }
protected function execute(\think\console\Input $input, \think\console\Output $output) /**
* 执行启动操作
* @param Input $input
* @param Output $output
*/
protected function execute(Input $input, Output $output)
{ {
if (($pid = $this->checkProcess()) > 0) { if (($pid = $this->checkProcess()) > 0) {
$output->info("The message queue daemon {$pid} already exists!"); $output->info("The message queue daemon {$pid} already exists!");

View File

@ -16,6 +16,8 @@
namespace library\command\task; namespace library\command\task;
use library\command\Task; use library\command\Task;
use think\console\Input;
use think\console\Output;
/** /**
* Class State * Class State
@ -24,12 +26,20 @@ use library\command\Task;
class State extends Task class State extends Task
{ {
/**
* 指令属性配置
*/
protected function configure() protected function configure()
{ {
$this->setName('xtask:state')->setDescription('查看消息队列守护进程状态'); $this->setName('xtask:state')->setDescription('查看消息队列守护进程状态');
} }
protected function execute(\think\console\Input $input, \think\console\Output $output) /**
* 执行查询操作
* @param Input $input
* @param Output $output
*/
protected function execute(Input $input, Output $output)
{ {
if (($pid = $this->checkProcess()) > 0) { if (($pid = $this->checkProcess()) > 0) {
$output->info("message queue daemon {$pid} is runing."); $output->info("message queue daemon {$pid} is runing.");

View File

@ -16,6 +16,8 @@
namespace library\command\task; namespace library\command\task;
use library\command\Task; use library\command\Task;
use think\console\Input;
use think\console\Output;
/** /**
* Class Stop * Class Stop
@ -24,12 +26,20 @@ use library\command\Task;
class Stop extends Task class Stop extends Task
{ {
/**
* 指令属性配置
*/
protected function configure() protected function configure()
{ {
$this->setName('xtask:stop')->setDescription('立即停止消息队列守护进程'); $this->setName('xtask:stop')->setDescription('立即停止消息队列守护进程');
} }
protected function execute(\think\console\Input $input, \think\console\Output $output) /**
* 执行停止操作
* @param Input $input
* @param Output $output
*/
protected function execute(Input $input, Output $output)
{ {
if (($pid = $this->checkProcess()) > 0) { if (($pid = $this->checkProcess()) > 0) {
$this->closeProcess($pid); $this->closeProcess($pid);