diff --git a/composer.lock b/composer.lock index 03a104f2..2d295836 100644 --- a/composer.lock +++ b/composer.lock @@ -152,16 +152,16 @@ }, { "name": "league/mime-type-detection", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ea2fbfc988bade315acd5967e6d02274086d0f28" + "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ea2fbfc988bade315acd5967e6d02274086d0f28", - "reference": "ea2fbfc988bade315acd5967e6d02274086d0f28", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/353f66d7555d8a90781f6f5e7091932f9a4250aa", + "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa", "shasum": "", "mirrors": [ { @@ -195,7 +195,7 @@ } ], "description": "Mime-type detection for Flysystem", - "time": "2020-09-21T18:10:53+00:00" + "time": "2020-10-18T11:50:25+00:00" }, { "name": "liliuwei/thinkphp-auth", @@ -556,16 +556,16 @@ }, { "name": "myclabs/php-enum", - "version": "1.7.6", + "version": "1.7.7", "source": { "type": "git", "url": "https://github.com/myclabs/php-enum.git", - "reference": "5f36467c7a87e20fbdc51e524fd8f9d1de80187c" + "reference": "d178027d1e679832db9f38248fcc7200647dc2b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/php-enum/zipball/5f36467c7a87e20fbdc51e524fd8f9d1de80187c", - "reference": "5f36467c7a87e20fbdc51e524fd8f9d1de80187c", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/d178027d1e679832db9f38248fcc7200647dc2b7", + "reference": "d178027d1e679832db9f38248fcc7200647dc2b7", "shasum": "", "mirrors": [ { @@ -604,7 +604,7 @@ "keywords": [ "enum" ], - "time": "2020-02-14T08:15:52+00:00" + "time": "2020-11-14T18:14:52+00:00" }, { "name": "overtrue/pinyin", @@ -1162,16 +1162,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.18.1", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", "shasum": "", "mirrors": [ { @@ -1181,7 +1181,7 @@ ] }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-mbstring": "For best performance" @@ -1189,7 +1189,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.20-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1227,20 +1227,20 @@ "portable", "shim" ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-23T14:02:19+00:00" }, { "name": "topthink/framework", - "version": "v6.0.4", + "version": "v6.0.5", "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": [ { @@ -1294,7 +1294,7 @@ "orm", "thinkphp" ], - "time": "2020-09-29T02:19:59+00:00" + "time": "2020-10-26T07:18:00+00:00" }, { "name": "topthink/think-captcha", @@ -1740,16 +1740,16 @@ "packages-dev": [ { "name": "symfony/polyfill-php72", - "version": "v1.18.1", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "639447d008615574653fb3bc60d1986d7172eaae" + "reference": "cede45fcdfabdd6043b3592e83678e42ec69e930" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae", - "reference": "639447d008615574653fb3bc60d1986d7172eaae", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cede45fcdfabdd6043b3592e83678e42ec69e930", + "reference": "cede45fcdfabdd6043b3592e83678e42ec69e930", "shasum": "", "mirrors": [ { @@ -1759,12 +1759,12 @@ ] }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.20-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1801,20 +1801,20 @@ "portable", "shim" ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-23T14:02:19+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.18.1", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981" + "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981", - "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de", + "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de", "shasum": "", "mirrors": [ { @@ -1824,12 +1824,12 @@ ] }, "require": { - "php": ">=7.0.8" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.20-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1873,20 +1873,20 @@ "portable", "shim" ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-23T14:02:19+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.4.15", + "version": "v4.4.16", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "0dc22bdf9d1197467bb04d505355180b6f20bcca" + "reference": "3718e18b68d955348ad860e505991802c09f5f73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0dc22bdf9d1197467bb04d505355180b6f20bcca", - "reference": "0dc22bdf9d1197467bb04d505355180b6f20bcca", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3718e18b68d955348ad860e505991802c09f5f73", + "reference": "3718e18b68d955348ad860e505991802c09f5f73", "shasum": "", "mirrors": [ { @@ -1920,11 +1920,6 @@ "Resources/bin/var-dump-server" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, "autoload": { "files": [ "Resources/functions/dump.php" @@ -1956,7 +1951,7 @@ "debug", "dump" ], - "time": "2020-09-18T08:35:10+00:00" + "time": "2020-10-26T20:47:51+00:00" }, { "name": "topthink/think-trace", diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index aa2d2b81..3771215c 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -6,6 +6,7 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( + 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 33e9252d..afee75ba 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -276,6 +276,7 @@ class ComposerStaticInitb9e4f0134ed78dbdc8a5ce7a1ab58175 ); public static $classMap = array ( + 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 04935be2..cfbacf5c 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -149,17 +149,17 @@ }, { "name": "league/mime-type-detection", - "version": "1.5.0", - "version_normalized": "1.5.0.0", + "version": "1.5.1", + "version_normalized": "1.5.1.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ea2fbfc988bade315acd5967e6d02274086d0f28" + "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ea2fbfc988bade315acd5967e6d02274086d0f28", - "reference": "ea2fbfc988bade315acd5967e6d02274086d0f28", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/353f66d7555d8a90781f6f5e7091932f9a4250aa", + "reference": "353f66d7555d8a90781f6f5e7091932f9a4250aa", "shasum": "", "mirrors": [ { @@ -176,7 +176,7 @@ "phpstan/phpstan": "^0.12.36", "phpunit/phpunit": "^8.5.8" }, - "time": "2020-09-21T18:10:53+00:00", + "time": "2020-10-18T11:50:25+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -565,17 +565,17 @@ }, { "name": "myclabs/php-enum", - "version": "1.7.6", - "version_normalized": "1.7.6.0", + "version": "1.7.7", + "version_normalized": "1.7.7.0", "source": { "type": "git", "url": "https://github.com/myclabs/php-enum.git", - "reference": "5f36467c7a87e20fbdc51e524fd8f9d1de80187c" + "reference": "d178027d1e679832db9f38248fcc7200647dc2b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/php-enum/zipball/5f36467c7a87e20fbdc51e524fd8f9d1de80187c", - "reference": "5f36467c7a87e20fbdc51e524fd8f9d1de80187c", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/d178027d1e679832db9f38248fcc7200647dc2b7", + "reference": "d178027d1e679832db9f38248fcc7200647dc2b7", "shasum": "", "mirrors": [ { @@ -593,7 +593,7 @@ "squizlabs/php_codesniffer": "1.*", "vimeo/psalm": "^3.8" }, - "time": "2020-02-14T08:15:52+00:00", + "time": "2020-11-14T18:14:52+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1191,17 +1191,17 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.18.1", - "version_normalized": "1.18.1.0", + "version": "v1.20.0", + "version_normalized": "1.20.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", "shasum": "", "mirrors": [ { @@ -1211,16 +1211,16 @@ ] }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-mbstring": "For best performance" }, - "time": "2020-07-14T12:35:20+00:00", + "time": "2020-10-23T14:02:19+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.20-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1262,17 +1262,17 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.18.1", - "version_normalized": "1.18.1.0", + "version": "v1.20.0", + "version_normalized": "1.20.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "639447d008615574653fb3bc60d1986d7172eaae" + "reference": "cede45fcdfabdd6043b3592e83678e42ec69e930" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae", - "reference": "639447d008615574653fb3bc60d1986d7172eaae", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cede45fcdfabdd6043b3592e83678e42ec69e930", + "reference": "cede45fcdfabdd6043b3592e83678e42ec69e930", "shasum": "", "mirrors": [ { @@ -1282,13 +1282,13 @@ ] }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, - "time": "2020-07-14T12:35:20+00:00", + "time": "2020-10-23T14:02:19+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.20-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1329,17 +1329,17 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.18.1", - "version_normalized": "1.18.1.0", + "version": "v1.20.0", + "version_normalized": "1.20.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981" + "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981", - "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de", + "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de", "shasum": "", "mirrors": [ { @@ -1349,13 +1349,13 @@ ] }, "require": { - "php": ">=7.0.8" + "php": ">=7.1" }, - "time": "2020-07-14T12:35:20+00:00", + "time": "2020-10-23T14:02:19+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.20-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1403,17 +1403,17 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.15", - "version_normalized": "4.4.15.0", + "version": "v4.4.16", + "version_normalized": "4.4.16.0", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "0dc22bdf9d1197467bb04d505355180b6f20bcca" + "reference": "3718e18b68d955348ad860e505991802c09f5f73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/0dc22bdf9d1197467bb04d505355180b6f20bcca", - "reference": "0dc22bdf9d1197467bb04d505355180b6f20bcca", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/3718e18b68d955348ad860e505991802c09f5f73", + "reference": "3718e18b68d955348ad860e505991802c09f5f73", "shasum": "", "mirrors": [ { @@ -1443,16 +1443,11 @@ "ext-intl": "To show region name in time zone dump", "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" }, - "time": "2020-09-18T08:35:10+00:00", + "time": "2020-10-26T20:47:51+00:00", "bin": [ "Resources/bin/var-dump-server" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, "installation-source": "dist", "autoload": { "files": [ @@ -1488,17 +1483,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": [ { @@ -1524,7 +1519,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": { diff --git a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php index cfbc8367..a2086475 100644 --- a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php +++ b/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php @@ -70,6 +70,7 @@ class GeneratedExtensionToMimeTypeMap implements ExtensionToMimeTypeMap 'azs' => 'application/vnd.airzip.filesecure.azs', 'azv' => 'image/vnd.airzip.accelerator.azv', 'azw' => 'application/vnd.amazon.ebook', + 'b16' => 'image/vnd.pco.b16', 'bat' => 'application/x-msdownload', 'bcpio' => 'application/x-bcpio', 'bdf' => 'application/x-font-bdf', diff --git a/vendor/myclabs/php-enum/README.md b/vendor/myclabs/php-enum/README.md index 6065f490..bf1c91dd 100644 --- a/vendor/myclabs/php-enum/README.md +++ b/vendor/myclabs/php-enum/README.md @@ -13,7 +13,8 @@ First, and mainly, `SplEnum` is not integrated to PHP, you have to install the e Using an enum instead of class constants provides the following advantages: -- You can type-hint: `function setAction(Action $action) {` +- You can use an enum as a parameter type: `function setAction(Action $action) {` +- You can use an enum as a return type: `function getAction() : Action {` - You can enrich the enum with methods (e.g. `format`, `parse`, …) - You can extend the enum to add new values (make your enum `final` to prevent it) - You can get a list of all the possible values (see below) @@ -54,7 +55,7 @@ $action = new Action($value); As you can see, static methods are automatically implemented to provide quick access to an enum value. -One advantage over using class constants is to be able to type-hint enum values: +One advantage over using class constants is to be able to use an enum as a parameter type: ```php function setAction(Action $action) { @@ -130,3 +131,4 @@ class Action extends Enum - [Doctrine enum mapping](https://github.com/acelaya/doctrine-enum-type) - [Symfony ParamConverter integration](https://github.com/Ex3v/MyCLabsEnumParamConverter) - [PHPStan integration](https://github.com/timeweb/phpstan-enum) +- [Yii2 enum mapping](https://github.com/KartaviK/yii2-enum) diff --git a/vendor/myclabs/php-enum/src/Enum.php b/vendor/myclabs/php-enum/src/Enum.php index f5a59404..b8b93277 100644 --- a/vendor/myclabs/php-enum/src/Enum.php +++ b/vendor/myclabs/php-enum/src/Enum.php @@ -37,6 +37,14 @@ abstract class Enum implements \JsonSerializable */ protected static $cache = []; + /** + * Cache of instances of the Enum class + * + * @var array + * @psalm-var array> + */ + protected static $instances = []; + /** * Creates a new value of some type * @@ -211,17 +219,20 @@ abstract class Enum implements \JsonSerializable * @param array $arguments * * @return static - * @psalm-pure * @throws \BadMethodCallException */ public static function __callStatic($name, $arguments) { - $array = static::toArray(); - if (isset($array[$name]) || \array_key_exists($name, $array)) { - return new static($array[$name]); + $class = static::class; + if (!isset(self::$instances[$class][$name])) { + $array = static::toArray(); + if (!isset($array[$name]) && !\array_key_exists($name, $array)) { + $message = "No static method or enum constant '$name' in class " . static::class; + throw new \BadMethodCallException($message); + } + return self::$instances[$class][$name] = new static($array[$name]); } - - throw new \BadMethodCallException("No static method or enum constant '$name' in class " . static::class); + return clone self::$instances[$class][$name]; } /** diff --git a/vendor/services.php b/vendor/services.php index 67a814c0..a9de5f91 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\captcha\\CaptchaService', diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php index 15503bc9..7bb30237 100644 --- a/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -115,10 +115,8 @@ final class Mbstring return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); } - public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) + public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) { - $vars = array(&$a, &$b, &$c, &$d, &$e, &$f); - $ok = true; array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { @@ -629,10 +627,11 @@ final class Mbstring { $encoding = self::getEncoding($encoding); if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strrchr($haystack, $needle, $part); + $pos = strrpos($haystack, $needle); + } else { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = iconv_strrpos($haystack, $needle, $encoding); } - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = iconv_strrpos($haystack, $needle, $encoding); return self::getSubpart($pos, $part, $haystack, $encoding); } diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php index b36a0926..d0a93d4d 100644 --- a/vendor/symfony/polyfill-mbstring/bootstrap.php +++ b/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -12,28 +12,28 @@ use Symfony\Polyfill\Mbstring as p; if (!function_exists('mb_convert_encoding')) { - function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); } + function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } } if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); } + function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } } if (!function_exists('mb_encode_mimeheader')) { - function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); } + function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } } if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity($s, $convmap, $enc = null) { return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); } + function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } } if (!function_exists('mb_encode_numericentity')) { - function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); } + function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } } if (!function_exists('mb_convert_case')) { - function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); } + function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } } if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); } + function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } } if (!function_exists('mb_language')) { - function mb_language($lang = null) { return p\Mbstring::mb_language($lang); } + function mb_language($language = null) { return p\Mbstring::mb_language($language); } } if (!function_exists('mb_list_encodings')) { function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } @@ -42,88 +42,94 @@ if (!function_exists('mb_encoding_aliases')) { function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } } if (!function_exists('mb_check_encoding')) { - function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); } + function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } } if (!function_exists('mb_detect_encoding')) { - function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); } + function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } } if (!function_exists('mb_detect_order')) { - function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); } + function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } } if (!function_exists('mb_parse_str')) { - function mb_parse_str($s, &$result = array()) { parse_str($s, $result); } + function mb_parse_str($string, &$result = array()) { parse_str($string, $result); } } if (!function_exists('mb_strlen')) { - function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); } + function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } } if (!function_exists('mb_strpos')) { - function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); } + function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } } if (!function_exists('mb_strtolower')) { - function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); } + function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } } if (!function_exists('mb_strtoupper')) { - function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); } + function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } } if (!function_exists('mb_substitute_character')) { - function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); } + function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } } if (!function_exists('mb_substr')) { - function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); } + function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } } if (!function_exists('mb_stripos')) { - function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); } + function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } } if (!function_exists('mb_stristr')) { - function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); } + function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } } if (!function_exists('mb_strrchr')) { - function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); } + function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } } if (!function_exists('mb_strrichr')) { - function mb_strrichr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); } + function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } } if (!function_exists('mb_strripos')) { - function mb_strripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); } + function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } } if (!function_exists('mb_strrpos')) { - function mb_strrpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); } + function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } } if (!function_exists('mb_strstr')) { - function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); } + function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } } if (!function_exists('mb_get_info')) { function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } } if (!function_exists('mb_http_output')) { - function mb_http_output($enc = null) { return p\Mbstring::mb_http_output($enc); } + function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } } if (!function_exists('mb_strwidth')) { - function mb_strwidth($s, $enc = null) { return p\Mbstring::mb_strwidth($s, $enc); } + function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } } if (!function_exists('mb_substr_count')) { - function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); } + function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } } if (!function_exists('mb_output_handler')) { - function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); } + function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } } if (!function_exists('mb_http_input')) { function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); } } + if (!function_exists('mb_convert_variables')) { - function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); } + if (PHP_VERSION_ID >= 80000) { + function mb_convert_variables($to_encoding, $from_encoding, &$var, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, $var, ...$vars); } + } else { + function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } + } } + if (!function_exists('mb_ord')) { - function mb_ord($s, $enc = null) { return p\Mbstring::mb_ord($s, $enc); } + function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } } if (!function_exists('mb_chr')) { - function mb_chr($code, $enc = null) { return p\Mbstring::mb_chr($code, $enc); } + function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } } if (!function_exists('mb_scrub')) { - function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); } + function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } } if (!function_exists('mb_str_split')) { - function mb_str_split($string, $split_length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $split_length, $encoding); } + function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } } if (extension_loaded('mbstring')) { diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json index 06e6b31a..ca4a8392 100644 --- a/vendor/symfony/polyfill-mbstring/composer.json +++ b/vendor/symfony/polyfill-mbstring/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, @@ -28,7 +28,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.20-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/vendor/symfony/polyfill-php72/Php72.php b/vendor/symfony/polyfill-php72/Php72.php index 9b3edc7c..1e36d5e6 100644 --- a/vendor/symfony/polyfill-php72/Php72.php +++ b/vendor/symfony/polyfill-php72/Php72.php @@ -191,7 +191,7 @@ final class Php72 public static function mb_ord($s, $encoding = null) { - if (null == $encoding) { + if (null === $encoding) { $s = mb_convert_encoding($s, 'UTF-8'); } elseif ('UTF-8' !== $encoding) { $s = mb_convert_encoding($s, 'UTF-8', $encoding); diff --git a/vendor/symfony/polyfill-php72/bootstrap.php b/vendor/symfony/polyfill-php72/bootstrap.php index a27a900a..3154b2c3 100644 --- a/vendor/symfony/polyfill-php72/bootstrap.php +++ b/vendor/symfony/polyfill-php72/bootstrap.php @@ -38,20 +38,20 @@ if (!function_exists('stream_isatty')) { function stream_isatty($stream) { return p\Php72::stream_isatty($stream); } } if (!function_exists('utf8_encode')) { - function utf8_encode($s) { return p\Php72::utf8_encode($s); } + function utf8_encode($string) { return p\Php72::utf8_encode($string); } } if (!function_exists('utf8_decode')) { - function utf8_decode($s) { return p\Php72::utf8_decode($s); } + function utf8_decode($string) { return p\Php72::utf8_decode($string); } } if (!function_exists('spl_object_id')) { - function spl_object_id($s) { return p\Php72::spl_object_id($s); } + function spl_object_id($object) { return p\Php72::spl_object_id($object); } } if (!function_exists('mb_ord')) { - function mb_ord($s, $enc = null) { return p\Php72::mb_ord($s, $enc); } + function mb_ord($string, $encoding = null) { return p\Php72::mb_ord($string, $encoding); } } if (!function_exists('mb_chr')) { - function mb_chr($code, $enc = null) { return p\Php72::mb_chr($code, $enc); } + function mb_chr($codepoint, $encoding = null) { return p\Php72::mb_chr($codepoint, $encoding); } } if (!function_exists('mb_scrub')) { - function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); } + function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } } diff --git a/vendor/symfony/polyfill-php72/composer.json b/vendor/symfony/polyfill-php72/composer.json index e295cab3..994443a4 100644 --- a/vendor/symfony/polyfill-php72/composer.json +++ b/vendor/symfony/polyfill-php72/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Php72\\": "" }, @@ -25,7 +25,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.20-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php new file mode 100644 index 00000000..8f9e6793 --- /dev/null +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php @@ -0,0 +1,22 @@ +flags = $flags; + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php index ad0029a3..77e037cb 100644 --- a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +++ b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php @@ -1,9 +1,11 @@ =7.0.8" + "php": ">=7.1" }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, @@ -30,7 +30,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.20-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/vendor/symfony/var-dumper/Cloner/VarCloner.php b/vendor/symfony/var-dumper/Cloner/VarCloner.php index b659fc34..fad05f67 100644 --- a/vendor/symfony/var-dumper/Cloner/VarCloner.php +++ b/vendor/symfony/var-dumper/Cloner/VarCloner.php @@ -240,7 +240,7 @@ class VarCloner extends AbstractCloner $stub->position = $len++; } elseif ($pos < $maxItems) { if ($maxItems < $pos += \count($a)) { - $a = \array_slice($a, 0, $maxItems - $pos); + $a = \array_slice($a, 0, $maxItems - $pos, true); if ($stub->cut >= 0) { $stub->cut += $pos - $maxItems; } diff --git a/vendor/symfony/var-dumper/composer.json b/vendor/symfony/var-dumper/composer.json index 3ce7cef2..0a13e5e4 100644 --- a/vendor/symfony/var-dumper/composer.json +++ b/vendor/symfony/var-dumper/composer.json @@ -46,10 +46,5 @@ "bin": [ "Resources/bin/var-dump-server" ], - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - } + "minimum-stability": "dev" } diff --git a/vendor/topthink/framework/src/think/App.php b/vendor/topthink/framework/src/think/App.php index c23a03c8..c47e0164 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 7845e463..741f7028 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 24c5122a..73036f35 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 a8b9718d..5e2881b1 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 801a69af..10428c60 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 f4198b4e..06d522d6 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 d890c496..db5768b3 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 f0122f53..ccec3ea8 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 151b37c6..a87f02da 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 d3833b8e..2e4f2ca7 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 278c2bd4..d20fc751 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 82d2744b..20a24662 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 3aae1db5..16eafceb 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 60aa71c4..5bcc08b5 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 e587131b..e992d0fe 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);