ComposerUpdate

This commit is contained in:
Anyon 2020-10-27 15:16:20 +08:00
parent c9809e7029
commit 2ec3ac9e20
20 changed files with 75 additions and 44 deletions

View File

@ -224,6 +224,7 @@ return array(
'app\\data\\controller\\api\\auth\\News' => $baseDir . '/app/data/controller/api/auth/News.php',
'app\\data\\controller\\api\\auth\\Order' => $baseDir . '/app/data/controller/api/auth/Order.php',
'app\\data\\service\\GoodsService' => $baseDir . '/app/data/service/GoodsService.php',
'app\\data\\service\\MessageService' => $baseDir . '/app/data/service/MessageService.php',
'app\\data\\service\\NewsService' => $baseDir . '/app/data/service/NewsService.php',
'app\\data\\service\\OrderService' => $baseDir . '/app/data/service/OrderService.php',
'app\\data\\service\\TruckService' => $baseDir . '/app/data/service/TruckService.php',

View File

@ -352,6 +352,7 @@ class ComposerStaticInit33b66ed99ea8fcca84c95dfb0e7ed409
'app\\data\\controller\\api\\auth\\News' => __DIR__ . '/../..' . '/app/data/controller/api/auth/News.php',
'app\\data\\controller\\api\\auth\\Order' => __DIR__ . '/../..' . '/app/data/controller/api/auth/Order.php',
'app\\data\\service\\GoodsService' => __DIR__ . '/../..' . '/app/data/service/GoodsService.php',
'app\\data\\service\\MessageService' => __DIR__ . '/../..' . '/app/data/service/MessageService.php',
'app\\data\\service\\NewsService' => __DIR__ . '/../..' . '/app/data/service/NewsService.php',
'app\\data\\service\\OrderService' => __DIR__ . '/../..' . '/app/data/service/OrderService.php',
'app\\data\\service\\TruckService' => __DIR__ . '/../..' . '/app/data/service/TruckService.php',

View File

@ -580,17 +580,17 @@
},
{
"name": "topthink/framework",
"version": "v6.0.4",
"version_normalized": "6.0.4.0",
"version": "v6.0.5",
"version_normalized": "6.0.5.0",
"source": {
"type": "git",
"url": "https://github.com/top-think/framework.git",
"reference": "4b252d78562d4a51a501651f837c26cb9d91624f"
"reference": "85625d984f5c96699dc27d384869f206c3aec1cc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/top-think/framework/zipball/4b252d78562d4a51a501651f837c26cb9d91624f",
"reference": "4b252d78562d4a51a501651f837c26cb9d91624f",
"url": "https://api.github.com/repos/top-think/framework/zipball/85625d984f5c96699dc27d384869f206c3aec1cc",
"reference": "85625d984f5c96699dc27d384869f206c3aec1cc",
"shasum": "",
"mirrors": [
{
@ -616,7 +616,7 @@
"mockery/mockery": "^1.2",
"phpunit/phpunit": "^7.0"
},
"time": "2020-09-29T02:19:59+00:00",
"time": "2020-10-26T07:18:00+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -893,12 +893,12 @@
"source": {
"type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "c5846d13a516a982f94b4d28ead23b515bd0fafc"
"reference": "51051855309a5752c0adb8f8d63129a43fd139ce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c5846d13a516a982f94b4d28ead23b515bd0fafc",
"reference": "c5846d13a516a982f94b4d28ead23b515bd0fafc",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/51051855309a5752c0adb8f8d63129a43fd139ce",
"reference": "51051855309a5752c0adb8f8d63129a43fd139ce",
"shasum": "",
"mirrors": [
{
@ -915,7 +915,7 @@
"ext-mbstring": "*",
"topthink/framework": "^6.0"
},
"time": "2020-10-26T02:07:54+00:00",
"time": "2020-10-26T10:23:23+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-10-26 10:23:32
// This file is automatically generated at:2020-10-27 15:14:34
declare (strict_types = 1);
return array (
0 => 'think\\admin\\Library',

View File

@ -39,7 +39,7 @@ use think\initializer\RegisterService;
*/
class App extends Container
{
const VERSION = '6.0.4';
const VERSION = '6.0.5';
/**
* 应用调试模式

View File

@ -48,7 +48,8 @@ abstract class Manager
if (is_null($name)) {
throw new InvalidArgumentException(sprintf(
'Unable to resolve NULL driver for [%s].', static::class
'Unable to resolve NULL driver for [%s].',
static::class
));
}

View File

@ -60,7 +60,8 @@ class Pipeline
} catch (Throwable | Exception $e) {
return $this->handleException($passable, $e);
}
});
}
);
return $pipeline($this->passable);
}

View File

@ -680,9 +680,9 @@ class Route
*/
public function redirect(string $rule, string $route = '', int $status = 301): RuleItem
{
return $this->rule($rule, function () use ($status, $route) {
return $this->rule($rule, function (Request $request) use ($status, $route) {
$search = $replace = [];
$matches = $this->request->rule()->getVars();
$matches = $request->rule()->getVars();
foreach ($matches as $key => $value) {
$search[] = '<' . $key . '>';

View File

@ -484,6 +484,7 @@ class Validate
foreach ($this->append as $key => $rule) {
if (!isset($rules[$key])) {
$rules[$key] = $rule;
unset($this->append[$key]);
}
}

View File

@ -185,9 +185,6 @@ abstract class Driver implements CacheInterface, CacheHandlerInterface
$key = implode('-', $name);
if (!isset($this->tag[$key])) {
$name = array_map(function ($val) {
return $this->getTagKey($val);
}, $name);
$this->tag[$key] = new TagSet($name, $this);
}
@ -202,7 +199,8 @@ abstract class Driver implements CacheInterface, CacheHandlerInterface
*/
public function getTagItems(string $tag): array
{
return $this->get($tag, []);
$name = $this->getTagKey($tag);
return $this->get($name, []);
}
/**

View File

@ -69,7 +69,8 @@ class TagSet
$name = $this->handler->getCacheKey($name);
foreach ($this->tag as $tag) {
$this->handler->push($tag, $name);
$key = $this->handler->getTagKey($tag);
$this->handler->push($key, $name);
}
}
@ -120,9 +121,10 @@ class TagSet
// 指定标签清除
foreach ($this->tag as $tag) {
$names = $this->handler->getTagItems($tag);
$this->handler->clearTag($names);
$this->handler->delete($tag);
$key = $this->handler->getTagKey($tag);
$this->handler->delete($key);
}
return true;

View File

@ -108,7 +108,7 @@ class File extends Driver
$content = gzuncompress($content);
}
return ['content' => $content, 'expire' => $expire];
return is_string($content) ? ['content' => $content, 'expire' => $expire] : null;
}
}

View File

@ -87,7 +87,7 @@ class Redis extends Driver
}
if (0 != $this->options['select']) {
$this->handler->select( (int) $this->options['select']);
$this->handler->select((int) $this->options['select']);
}
}
@ -112,8 +112,8 @@ class Redis extends Driver
public function get($name, $default = null)
{
$this->readTimes++;
$value = $this->handler->get($this->getCacheKey($name));
$key = $this->getCacheKey($name);
$value = $this->handler->get($key);
if (false === $value || is_null($value)) {
return $default;
@ -161,7 +161,6 @@ class Redis extends Driver
public function inc(string $name, int $step = 1)
{
$this->writeTimes++;
$key = $this->getCacheKey($name);
return $this->handler->incrby($key, $step);
@ -177,7 +176,6 @@ class Redis extends Driver
public function dec(string $name, int $step = 1)
{
$this->writeTimes++;
$key = $this->getCacheKey($name);
return $this->handler->decrby($key, $step);
@ -193,7 +191,8 @@ class Redis extends Driver
{
$this->writeTimes++;
$result = $this->handler->del($this->getCacheKey($name));
$key = $this->getCacheKey($name);
$result = $this->handler->del($key);
return $result > 0;
}
@ -205,7 +204,6 @@ class Redis extends Driver
public function clear(): bool
{
$this->writeTimes++;
$this->handler->flushDB();
return true;
}
@ -231,7 +229,8 @@ class Redis extends Driver
*/
public function push(string $name, $value): void
{
$this->handler->sAdd($name, $value);
$key = $this->getCacheKey($name);
$this->handler->sAdd($key, $value);
}
/**
@ -242,7 +241,9 @@ class Redis extends Driver
*/
public function getTagItems(string $tag): array
{
return $this->handler->sMembers($tag);
$name = $this->getTagKey($tag);
$key = $this->getCacheKey($name);
return $this->handler->sMembers($key);
}
}

View File

@ -32,7 +32,8 @@ class Help extends Command
$this->setName('help')->setDefinition([
new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'),
new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'),
])->setDescription('Displays help for a command')->setHelp(<<<EOF
])->setDescription('Displays help for a command')->setHelp(
<<<EOF
The <info>%command.name%</info> command displays help for a given command:
<info>php %command.full_name% list</info>

View File

@ -25,7 +25,8 @@ class Lists extends Command
*/
protected function configure()
{
$this->setName('list')->setDefinition($this->createDefinition())->setDescription('Lists commands')->setHelp(<<<EOF
$this->setName('list')->setDefinition($this->createDefinition())->setDescription('Lists commands')->setHelp(
<<<EOF
The <info>%command.name%</info> command lists all commands:
<info>php %command.full_name%</info>

View File

@ -22,12 +22,27 @@ class RunServer extends Command
public function configure()
{
$this->setName('run')
->addOption('host', 'H', Option::VALUE_OPTIONAL,
'The host to server the application on', '0.0.0.0')
->addOption('port', 'p', Option::VALUE_OPTIONAL,
'The port to server the application on', 8000)
->addOption('root', 'r', Option::VALUE_OPTIONAL,
'The document root of the application', '')
->addOption(
'host',
'H',
Option::VALUE_OPTIONAL,
'The host to server the application on',
'0.0.0.0'
)
->addOption(
'port',
'p',
Option::VALUE_OPTIONAL,
'The port to server the application on',
8000
)
->addOption(
'root',
'r',
Option::VALUE_OPTIONAL,
'The document root of the application',
''
)
->setDescription('PHP Built-in Server for ThinkPHP');
}

View File

@ -28,6 +28,10 @@ class ServiceDiscover extends Command
{
if (is_file($path = $this->app->getRootPath() . 'vendor/composer/installed.json')) {
$packages = json_decode(@file_get_contents($path), true);
// Compatibility with Composer 2.0
if (isset($packages['packages'])) {
$packages = $packages['packages'];
}
$services = [];
foreach ($packages as $package) {

View File

@ -35,7 +35,10 @@ class Local extends Driver
: LocalAdapter::DISALLOW_LINKS;
return new LocalAdapter(
$this->config['root'], LOCK_EX, $links, $permissions
$this->config['root'],
LOCK_EX,
$links,
$permissions
);
}
}

View File

@ -223,7 +223,8 @@ class RouteTest extends TestCase
{
$this->route->redirect('foo', 'http://localhost', 302);
$request = $this->makeRequest('foo');
$request = $this->makeRequest('foo');
$this->app->shouldReceive('make')->with(Request::class)->andReturn($request);
$response = $this->route->dispatch($request);
$this->assertInstanceOf(Redirect::class, $response);

View File

@ -81,7 +81,7 @@ class TokenService extends Service
*/
public function getInputToken(): string
{
return $this->app->request->header('user-form-token', input('_csrf_', ''));
return $this->app->request->header('user-form-token') ?: input('_csrf_', '');
}
/**