mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
ComposerUpdate
This commit is contained in:
parent
30bba580b8
commit
a1d834cc4d
8
composer.lock
generated
8
composer.lock
generated
@ -783,12 +783,12 @@
|
|||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
||||||
"reference": "db1bc2c31e0850dc2b3dfa622757bc69bc19adb3"
|
"reference": "ad940b565ff7432ede780d57aeae2a05bfd925a6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/db1bc2c31e0850dc2b3dfa622757bc69bc19adb3",
|
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/ad940b565ff7432ede780d57aeae2a05bfd925a6",
|
||||||
"reference": "db1bc2c31e0850dc2b3dfa622757bc69bc19adb3",
|
"reference": "ad940b565ff7432ede780d57aeae2a05bfd925a6",
|
||||||
"shasum": "",
|
"shasum": "",
|
||||||
"mirrors": [
|
"mirrors": [
|
||||||
{
|
{
|
||||||
@ -832,7 +832,7 @@
|
|||||||
],
|
],
|
||||||
"description": "ThinkPHP v6.0 Development Library",
|
"description": "ThinkPHP v6.0 Development Library",
|
||||||
"homepage": "http://framework.thinkadmin.top",
|
"homepage": "http://framework.thinkadmin.top",
|
||||||
"time": "2019-11-12T02:49:58+00:00"
|
"time": "2019-11-13T06:45:23+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [],
|
"packages-dev": [],
|
||||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
|||||||
|
|
||||||
require_once __DIR__ . '/composer/autoload_real.php';
|
require_once __DIR__ . '/composer/autoload_real.php';
|
||||||
|
|
||||||
return ComposerAutoloaderInitd0e0e12040e0346563a00e9de898c5b7::getLoader();
|
return ComposerAutoloaderInit53454ac98c72727d5ff48461854fbb40::getLoader();
|
||||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// autoload_real.php @generated by Composer
|
// autoload_real.php @generated by Composer
|
||||||
|
|
||||||
class ComposerAutoloaderInitd0e0e12040e0346563a00e9de898c5b7
|
class ComposerAutoloaderInit53454ac98c72727d5ff48461854fbb40
|
||||||
{
|
{
|
||||||
private static $loader;
|
private static $loader;
|
||||||
|
|
||||||
@ -19,15 +19,15 @@ class ComposerAutoloaderInitd0e0e12040e0346563a00e9de898c5b7
|
|||||||
return self::$loader;
|
return self::$loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
spl_autoload_register(array('ComposerAutoloaderInitd0e0e12040e0346563a00e9de898c5b7', 'loadClassLoader'), true, true);
|
spl_autoload_register(array('ComposerAutoloaderInit53454ac98c72727d5ff48461854fbb40', 'loadClassLoader'), true, true);
|
||||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||||
spl_autoload_unregister(array('ComposerAutoloaderInitd0e0e12040e0346563a00e9de898c5b7', 'loadClassLoader'));
|
spl_autoload_unregister(array('ComposerAutoloaderInit53454ac98c72727d5ff48461854fbb40', '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\ComposerStaticInitd0e0e12040e0346563a00e9de898c5b7::getInitializer($loader));
|
call_user_func(\Composer\Autoload\ComposerStaticInit53454ac98c72727d5ff48461854fbb40::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 ComposerAutoloaderInitd0e0e12040e0346563a00e9de898c5b7
|
|||||||
$loader->register(true);
|
$loader->register(true);
|
||||||
|
|
||||||
if ($useStaticLoader) {
|
if ($useStaticLoader) {
|
||||||
$includeFiles = Composer\Autoload\ComposerStaticInitd0e0e12040e0346563a00e9de898c5b7::$files;
|
$includeFiles = Composer\Autoload\ComposerStaticInit53454ac98c72727d5ff48461854fbb40::$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) {
|
||||||
composerRequired0e0e12040e0346563a00e9de898c5b7($fileIdentifier, $file);
|
composerRequire53454ac98c72727d5ff48461854fbb40($fileIdentifier, $file);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $loader;
|
return $loader;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function composerRequired0e0e12040e0346563a00e9de898c5b7($fileIdentifier, $file)
|
function composerRequire53454ac98c72727d5ff48461854fbb40($fileIdentifier, $file)
|
||||||
{
|
{
|
||||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||||
require $file;
|
require $file;
|
||||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace Composer\Autoload;
|
namespace Composer\Autoload;
|
||||||
|
|
||||||
class ComposerStaticInitd0e0e12040e0346563a00e9de898c5b7
|
class ComposerStaticInit53454ac98c72727d5ff48461854fbb40
|
||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
|
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
|
||||||
@ -470,9 +470,9 @@ class ComposerStaticInitd0e0e12040e0346563a00e9de898c5b7
|
|||||||
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 = ComposerStaticInitd0e0e12040e0346563a00e9de898c5b7::$prefixLengthsPsr4;
|
$loader->prefixLengthsPsr4 = ComposerStaticInit53454ac98c72727d5ff48461854fbb40::$prefixLengthsPsr4;
|
||||||
$loader->prefixDirsPsr4 = ComposerStaticInitd0e0e12040e0346563a00e9de898c5b7::$prefixDirsPsr4;
|
$loader->prefixDirsPsr4 = ComposerStaticInit53454ac98c72727d5ff48461854fbb40::$prefixDirsPsr4;
|
||||||
$loader->classMap = ComposerStaticInitd0e0e12040e0346563a00e9de898c5b7::$classMap;
|
$loader->classMap = ComposerStaticInit53454ac98c72727d5ff48461854fbb40::$classMap;
|
||||||
|
|
||||||
}, null, ClassLoader::class);
|
}, null, ClassLoader::class);
|
||||||
}
|
}
|
||||||
|
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
@ -805,12 +805,12 @@
|
|||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
||||||
"reference": "db1bc2c31e0850dc2b3dfa622757bc69bc19adb3"
|
"reference": "ad940b565ff7432ede780d57aeae2a05bfd925a6"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/db1bc2c31e0850dc2b3dfa622757bc69bc19adb3",
|
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/ad940b565ff7432ede780d57aeae2a05bfd925a6",
|
||||||
"reference": "db1bc2c31e0850dc2b3dfa622757bc69bc19adb3",
|
"reference": "ad940b565ff7432ede780d57aeae2a05bfd925a6",
|
||||||
"shasum": "",
|
"shasum": "",
|
||||||
"mirrors": [
|
"mirrors": [
|
||||||
{
|
{
|
||||||
@ -826,7 +826,7 @@
|
|||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"topthink/framework": "^6.0"
|
"topthink/framework": "^6.0"
|
||||||
},
|
},
|
||||||
"time": "2019-11-12T02:49:58+00:00",
|
"time": "2019-11-13T06:45:23+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"think": {
|
"think": {
|
||||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// This file is automatically generated at:2019-11-12 10:52:35
|
// This file is automatically generated at:2019-11-13 14:52:09
|
||||||
declare (strict_types = 1);
|
declare (strict_types = 1);
|
||||||
return array (
|
return array (
|
||||||
0 => 'think\\app\\Service',
|
0 => 'think\\app\\Service',
|
||||||
|
@ -46,8 +46,9 @@ class ThinkLibrary extends Service
|
|||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
// 注册访问中间键
|
// 注册访问中间键
|
||||||
if (in_array($this->app->request->method(), ['get', 'post', 'options'])) {
|
if (stripos('get,post,options', $this->app->request->method()) !== false) {
|
||||||
$this->app->middleware->add(function (Request $request, \Closure $next, $header = []) {
|
$this->app->middleware->add(function (Request $request, \Closure $next) {
|
||||||
|
$header = [];
|
||||||
if (($origin = $request->header('origin', '*')) !== '*') {
|
if (($origin = $request->header('origin', '*')) !== '*') {
|
||||||
$header['Access-Control-Allow-Origin'] = $origin;
|
$header['Access-Control-Allow-Origin'] = $origin;
|
||||||
$header['Access-Control-Allow-Methods'] = 'GET,POST,PATCH,PUT,DELETE';
|
$header['Access-Control-Allow-Methods'] = 'GET,POST,PATCH,PUT,DELETE';
|
||||||
@ -58,7 +59,7 @@ class ThinkLibrary extends Service
|
|||||||
if ($request->isOptions()) {
|
if ($request->isOptions()) {
|
||||||
return response()->code(204)->header($header);
|
return response()->code(204)->header($header);
|
||||||
} elseif (AuthService::instance($this->app)->check()) {
|
} elseif (AuthService::instance($this->app)->check()) {
|
||||||
return $next($request)->header($header);
|
return $next($request)->code(200)->header($header);
|
||||||
} elseif (AuthService::instance($this->app)->isLogin()) {
|
} elseif (AuthService::instance($this->app)->isLogin()) {
|
||||||
return json(['code' => 0, 'msg' => '抱歉,没有访问该操作的权限!'])->header($header);
|
return json(['code' => 0, 'msg' => '抱歉,没有访问该操作的权限!'])->header($header);
|
||||||
} else {
|
} else {
|
||||||
|
@ -89,16 +89,14 @@ class PageHelper extends Helper
|
|||||||
$limit = intval($this->app->request->get('limit', cookie('page-limit')));
|
$limit = intval($this->app->request->get('limit', cookie('page-limit')));
|
||||||
cookie('page-limit', $limit = $limit >= 10 ? $limit : 20);
|
cookie('page-limit', $limit = $limit >= 10 ? $limit : 20);
|
||||||
if ($this->limit > 0) $limit = $this->limit;
|
if ($this->limit > 0) $limit = $this->limit;
|
||||||
$rows = [];
|
list($options, $query) = [[], $this->app->request->get()];
|
||||||
// $paginate = $this->query->paginate($limit, $this->total, ['query' => ($query = $this->app->request->get())]);
|
$paginate = $this->query->paginate(['list_rows' => $limit, 'query' => $query], $this->total);
|
||||||
$query = $this->app->request->get();
|
|
||||||
$paginate = $this->query->paginate($limit, $this->total);
|
|
||||||
foreach ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200] as $num) {
|
foreach ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200] as $num) {
|
||||||
list($query['limit'], $query['page'], $selected) = [$num, '1', $limit === $num ? 'selected' : ''];
|
list($query['limit'], $query['page'], $selected) = [$num, '1', $limit === $num ? 'selected' : ''];
|
||||||
$url = url('@admin') . '#' . $this->app->request->baseUrl() . '?' . urldecode(http_build_query($query));
|
$url = url('@admin') . '#' . $this->app->request->baseUrl() . '?' . urldecode(http_build_query($query));
|
||||||
array_push($rows, "<option data-num='{$num}' value='{$url}' {$selected}>{$num}</option>");
|
array_push($options, "<option data-num='{$num}' value='{$url}' {$selected}>{$num}</option>");
|
||||||
}
|
}
|
||||||
$select = "<select onchange='location.href=this.options[this.selectedIndex].value' data-auto-none>" . join('', $rows) . "</select>";
|
$select = "<select onchange='location.href=this.options[this.selectedIndex].value' data-auto-none>" . join('', $options) . "</select>";
|
||||||
$html = "<div class='pagination-container nowrap'><span>共 {$paginate->total()} 条记录,每页显示 {$select} 条,共 {$paginate->lastPage()} 页当前显示第 {$paginate->currentPage()} 页。</span>{$paginate->render()}</div>";
|
$html = "<div class='pagination-container nowrap'><span>共 {$paginate->total()} 条记录,每页显示 {$select} 条,共 {$paginate->lastPage()} 页当前显示第 {$paginate->currentPage()} 页。</span>{$paginate->render()}</div>";
|
||||||
$this->class->assign('pagehtml', preg_replace('|href="(.*?)"|', 'data-open="$1" onclick="return false" href="$1"', $html));
|
$this->class->assign('pagehtml', preg_replace('|href="(.*?)"|', 'data-open="$1" onclick="return false" href="$1"', $html));
|
||||||
$result = ['page' => ['limit' => intval($limit), 'total' => intval($paginate->total()), 'pages' => intval($paginate->lastPage()), 'current' => intval($paginate->currentPage())], 'list' => $paginate->items()];
|
$result = ['page' => ['limit' => intval($limit), 'total' => intval($paginate->total()), 'pages' => intval($paginate->lastPage()), 'current' => intval($paginate->currentPage())], 'list' => $paginate->items()];
|
||||||
|
@ -53,16 +53,16 @@ class ListenQueue extends Command
|
|||||||
while (true) {
|
while (true) {
|
||||||
foreach ($this->app->db->name('SystemQueue')->where([['status', '=', '1'], ['exec_time', '<=', time()]])->order('exec_time asc')->select() as $vo) {
|
foreach ($this->app->db->name('SystemQueue')->where([['status', '=', '1'], ['exec_time', '<=', time()]])->order('exec_time asc')->select() as $vo) {
|
||||||
try {
|
try {
|
||||||
$this->app->db->name('SystemQueue')->where(['id' => $vo['id']])->update(['status' => '2', 'enter_time' => time(), 'attempts' => $vo['attempts'] + 1]);
|
$this->app->db->name('SystemQueue')->where(['id' => $vo['id']])->update(['status' => '2', 'enter_time' => time(), 'exec_desc' => '', 'attempts' => $vo['attempts'] + 1]);
|
||||||
if ($process->query($command = $process->think("xtask:_work {$vo['id']} -"))) {
|
if ($process->query($command = $process->think("xtask:_work {$vo['id']} -"))) {
|
||||||
$output->comment("正在执行 --> [{$vo['id']}] {$vo['title']}");
|
$output->comment("正在执行 -> [{$vo['id']}] {$vo['title']}");
|
||||||
} else {
|
} else {
|
||||||
$process->create($command);
|
$process->create($command);
|
||||||
$output->info("创建成功 --> [{$vo['id']}] {$vo['title']}");
|
$output->info("创建成功 -> [{$vo['id']}] {$vo['title']}");
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->app->db->name('SystemQueue')->where(['id' => $vo['id']])->update(['status' => '4', 'outer_time' => time(), 'exec_desc' => $e->getMessage()]);
|
$this->app->db->name('SystemQueue')->where(['id' => $vo['id']])->update(['status' => '4', 'outer_time' => time(), 'exec_desc' => $e->getMessage()]);
|
||||||
$output->error("创建失败 --> [{$vo['id']}] {$vo['title']},{$e->getMessage()}");
|
$output->error("创建失败 -> [{$vo['id']}] {$vo['title']},{$e->getMessage()}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user