diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index e0698e64d..a38d97da0 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -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', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index ac7b9c75b..b39a04811 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -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', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 92c5fbf1e..e98542563 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -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": { diff --git a/vendor/services.php b/vendor/services.php index 625343ba3..9e3ce540c 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library', diff --git a/vendor/topthink/framework/src/think/App.php b/vendor/topthink/framework/src/think/App.php index c23a03c8a..c47e01644 100644 --- a/vendor/topthink/framework/src/think/App.php +++ b/vendor/topthink/framework/src/think/App.php @@ -39,7 +39,7 @@ use think\initializer\RegisterService; */ class App extends Container { - const VERSION = '6.0.4'; + const VERSION = '6.0.5'; /** * 应用调试模式 diff --git a/vendor/topthink/framework/src/think/Manager.php b/vendor/topthink/framework/src/think/Manager.php index 7845e463e..741f7028f 100644 --- a/vendor/topthink/framework/src/think/Manager.php +++ b/vendor/topthink/framework/src/think/Manager.php @@ -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 )); } diff --git a/vendor/topthink/framework/src/think/Pipeline.php b/vendor/topthink/framework/src/think/Pipeline.php index 24c5122ae..73036f35d 100644 --- a/vendor/topthink/framework/src/think/Pipeline.php +++ b/vendor/topthink/framework/src/think/Pipeline.php @@ -60,7 +60,8 @@ class Pipeline } catch (Throwable | Exception $e) { return $this->handleException($passable, $e); } - }); + } + ); return $pipeline($this->passable); } diff --git a/vendor/topthink/framework/src/think/Route.php b/vendor/topthink/framework/src/think/Route.php index a8b9718de..5e2881b10 100644 --- a/vendor/topthink/framework/src/think/Route.php +++ b/vendor/topthink/framework/src/think/Route.php @@ -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 . '>'; diff --git a/vendor/topthink/framework/src/think/Validate.php b/vendor/topthink/framework/src/think/Validate.php index 801a69af7..10428c603 100644 --- a/vendor/topthink/framework/src/think/Validate.php +++ b/vendor/topthink/framework/src/think/Validate.php @@ -484,6 +484,7 @@ class Validate foreach ($this->append as $key => $rule) { if (!isset($rules[$key])) { $rules[$key] = $rule; + unset($this->append[$key]); } } diff --git a/vendor/topthink/framework/src/think/cache/Driver.php b/vendor/topthink/framework/src/think/cache/Driver.php index f4198b4e1..06d522d64 100644 --- a/vendor/topthink/framework/src/think/cache/Driver.php +++ b/vendor/topthink/framework/src/think/cache/Driver.php @@ -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, []); } /** diff --git a/vendor/topthink/framework/src/think/cache/TagSet.php b/vendor/topthink/framework/src/think/cache/TagSet.php index d890c496a..db5768b37 100644 --- a/vendor/topthink/framework/src/think/cache/TagSet.php +++ b/vendor/topthink/framework/src/think/cache/TagSet.php @@ -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; diff --git a/vendor/topthink/framework/src/think/cache/driver/File.php b/vendor/topthink/framework/src/think/cache/driver/File.php index f0122f538..ccec3ea8e 100644 --- a/vendor/topthink/framework/src/think/cache/driver/File.php +++ b/vendor/topthink/framework/src/think/cache/driver/File.php @@ -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; } } diff --git a/vendor/topthink/framework/src/think/cache/driver/Redis.php b/vendor/topthink/framework/src/think/cache/driver/Redis.php index 151b37c61..a87f02da5 100644 --- a/vendor/topthink/framework/src/think/cache/driver/Redis.php +++ b/vendor/topthink/framework/src/think/cache/driver/Redis.php @@ -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); } } diff --git a/vendor/topthink/framework/src/think/console/command/Help.php b/vendor/topthink/framework/src/think/console/command/Help.php index d3833b8e2..2e4f2ca76 100644 --- a/vendor/topthink/framework/src/think/console/command/Help.php +++ b/vendor/topthink/framework/src/think/console/command/Help.php @@ -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(<<setDescription('Displays help for a command')->setHelp( + <<%command.name% command displays help for a given command: php %command.full_name% list diff --git a/vendor/topthink/framework/src/think/console/command/Lists.php b/vendor/topthink/framework/src/think/console/command/Lists.php index 278c2bd46..d20fc751b 100644 --- a/vendor/topthink/framework/src/think/console/command/Lists.php +++ b/vendor/topthink/framework/src/think/console/command/Lists.php @@ -25,7 +25,8 @@ class Lists extends Command */ protected function configure() { - $this->setName('list')->setDefinition($this->createDefinition())->setDescription('Lists commands')->setHelp(<<setName('list')->setDefinition($this->createDefinition())->setDescription('Lists commands')->setHelp( + <<%command.name% command lists all commands: php %command.full_name% diff --git a/vendor/topthink/framework/src/think/console/command/RunServer.php b/vendor/topthink/framework/src/think/console/command/RunServer.php index 82d2744b9..20a246627 100644 --- a/vendor/topthink/framework/src/think/console/command/RunServer.php +++ b/vendor/topthink/framework/src/think/console/command/RunServer.php @@ -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'); } diff --git a/vendor/topthink/framework/src/think/console/command/ServiceDiscover.php b/vendor/topthink/framework/src/think/console/command/ServiceDiscover.php index 3aae1db57..16eafcebc 100644 --- a/vendor/topthink/framework/src/think/console/command/ServiceDiscover.php +++ b/vendor/topthink/framework/src/think/console/command/ServiceDiscover.php @@ -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) { diff --git a/vendor/topthink/framework/src/think/filesystem/driver/Local.php b/vendor/topthink/framework/src/think/filesystem/driver/Local.php index 60aa71c4c..5bcc08b5c 100644 --- a/vendor/topthink/framework/src/think/filesystem/driver/Local.php +++ b/vendor/topthink/framework/src/think/filesystem/driver/Local.php @@ -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 ); } } diff --git a/vendor/topthink/framework/tests/RouteTest.php b/vendor/topthink/framework/tests/RouteTest.php index e587131b6..e992d0fed 100644 --- a/vendor/topthink/framework/tests/RouteTest.php +++ b/vendor/topthink/framework/tests/RouteTest.php @@ -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); diff --git a/vendor/zoujingli/think-library/src/service/TokenService.php b/vendor/zoujingli/think-library/src/service/TokenService.php index 4e3366a12..068f3f3f6 100644 --- a/vendor/zoujingli/think-library/src/service/TokenService.php +++ b/vendor/zoujingli/think-library/src/service/TokenService.php @@ -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_', ''); } /**