Compare commits

..

No commits in common. 'test' and 'main' have entirely different histories.
test ... main

@ -51,4 +51,4 @@ RUN composer install --no-dev -o && php bin/hyperf.php
EXPOSE 9501
ENTRYPOINT ["composer", "watch"]
ENTRYPOINT ["php", "/opt/www/bin/hyperf.php", "start"]

@ -1,8 +0,0 @@
<?php
namespace App\Contract;
interface ServiceContract
{
}

@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
/**
* This file is part of Hyperf.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace App\Controller;
use Hyperf\Di\Annotation\Inject;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Contract\ResponseInterface;
use Psr\Container\ContainerInterface;
abstract class AbstractController
{
#[Inject]
protected ContainerInterface $container;
#[Inject]
protected RequestInterface $request;
#[Inject]
protected ResponseInterface $response;
}

@ -1,42 +0,0 @@
<?php
namespace App\Controller;
use App\Contract\ServiceContract;
use Hyperf\Di\Annotation\Inject;
use Hyperf\Validation\Contract\ValidatorFactoryInterface;
use Hyperf\Validation\Request\FormRequest;
/**
* @property ServiceContract $service
* @property FormRequest $request
*/
abstract class BaseController
{
#[Inject]
protected ValidatorFactoryInterface $validator;
protected function getService(): ServiceContract
{
return $this->service;
}
protected function validated(array $rules): array
{
$request = $this->getRequest();
$validator = $this->validator->make(
$request->all(),
$rules,
$request->messages(),
$request->attributes()
);
$validator->validate();
return $validator->validated();
}
protected function getRequest(): FormRequest
{
return $this->request;
}
}

@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
/**
* This file is part of Hyperf.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
namespace App\Controller;
class IndexController extends AbstractController
{
public function index()
{
$user = $this->request->input('user', 'Hyperf');
$method = $this->request->getMethod();
return [
'method' => $method,
'message' => "Hello {$user}.",
];
}
}

@ -13,13 +13,9 @@
"license": "Apache-2.0",
"require": {
"php": ">=8.1",
"96qbhy/hyperf-auth": "^3.1",
"hyperf/async-queue": "~3.1.0",
"hyperf/cache": "~3.1.0",
"hyperf/command": "~3.1.0",
"hyperf/config": "~3.1.0",
"hyperf/constants": "~3.1.0",
"hyperf/database": "~3.1.0",
"hyperf/db-connection": "~3.1.0",
"hyperf/engine": "^2.10",
"hyperf/framework": "~3.1.0",
@ -27,10 +23,12 @@
"hyperf/http-server": "~3.1.0",
"hyperf/logger": "~3.1.0",
"hyperf/memory": "~3.1.0",
"hyperf/model-cache": "~3.1.0",
"hyperf/process": "~3.1.0",
"hyperf/database": "~3.1.0",
"hyperf/redis": "~3.1.0",
"hyperf/validation": "^3.1"
"hyperf/constants": "~3.1.0",
"hyperf/async-queue": "~3.1.0",
"hyperf/model-cache": "~3.1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",

814
composer.lock generated

@ -4,169 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "333d342acc428b14e60f274a6eab90d4",
"content-hash": "4f70c499087e9d68e62ac1d667e47b05",
"packages": [
{
"name": "96qbhy/hyperf-auth",
"version": "v3.1.2",
"source": {
"type": "git",
"url": "https://github.com/qbhy/hyperf-auth.git",
"reference": "0252048d758c1c793ebe6448f3fd744e4e2c7793"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/qbhy/hyperf-auth/zipball/0252048d758c1c793ebe6448f3fd744e4e2c7793",
"reference": "0252048d758c1c793ebe6448f3fd744e4e2c7793",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"96qbhy/simple-jwt": "^v1.5",
"ext-json": "*",
"ext-redis": "*",
"hyperf/cache": "^3.1",
"hyperf/di": "^3.1",
"php": ">=8.1"
},
"require-dev": {
"brainmaestro/composer-git-hooks": "^2.8",
"friendsofphp/php-cs-fixer": "^2.14",
"hyperf/command": "^3.1",
"hyperf/config": "^3.1",
"hyperf/database": "^3.1",
"hyperf/event": "^3.1",
"hyperf/framework": "^3.1",
"hyperf/redis": "^3.1",
"hyperf/session": "^3.1",
"hyperf/testing": "^3.1",
"hyperf/utils": "^3.1",
"itsgoingd/clockwork": "^5.0",
"phpstan/phpstan": "^0.12",
"swoft/swoole-ide-helper": "dev-master",
"symfony/console": "^5.3",
"symfony/var-dumper": "^5.3"
},
"suggest": {
"ext-redis": "*"
},
"type": "library",
"extra": {
"hyperf": {
"config": "Qbhy\\HyperfAuth\\ConfigProvider"
},
"hooks": {
"pre-commit": [
"echo committing as $(git config user.name)",
"vendor/bin/php-cs-fixer fix .",
"git add .",
"composer test"
]
}
},
"autoload": {
"files": [
"src/helper.php"
],
"psr-4": {
"Qbhy\\HyperfAuth\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "hyperf 的 auth 组件",
"keywords": [
"hyperf",
"hyperf-auth",
"jwt-auth",
"php"
],
"support": {
"issues": "https://github.com/qbhy/hyperf-auth/issues",
"source": "https://github.com/qbhy/hyperf-auth/tree/v3.1.2"
},
"time": "2024-01-11T04:45:43+00:00"
},
{
"name": "96qbhy/simple-jwt",
"version": "v1.5",
"source": {
"type": "git",
"url": "https://github.com/qbhy/simple-jwt.git",
"reference": "5ed9564af7151f2cecc19249ffac4c697e5a7efb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/qbhy/simple-jwt/zipball/5ed9564af7151f2cecc19249ffac4c697e5a7efb",
"reference": "5ed9564af7151f2cecc19249ffac4c697e5a7efb",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"doctrine/cache": "^1.10",
"ext-json": ">=1.0",
"php": ">=8.1"
},
"require-dev": {
"brainmaestro/composer-git-hooks": "^2.8",
"friendsofphp/php-cs-fixer": "^3.0",
"hyperf/config": "^3.1",
"hyperf/context": "~3.1.0",
"phpunit/phpunit": "^10.0.0"
},
"type": "library",
"extra": {
"hooks": {
"pre-commit": [
"echo committing as $(git config user.name)",
"vendor/bin/php-cs-fixer fix .",
"git add .",
"composer test"
]
},
"hyperf": {
"config": "Qbhy\\SimpleJwt\\Hyperf\\ConfigProvider"
},
"laravel": {
"providers": [
"Qbhy\\SimpleJwt\\Laravel\\ServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Qbhy\\SimpleJwt\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"Apache-2.0"
],
"authors": [
{
"name": "96qbhy",
"email": "96qbhy@gmail.com"
}
],
"description": "简单的 jwt 实现",
"support": {
"issues": "https://github.com/qbhy/simple-jwt/issues",
"source": "https://github.com/qbhy/simple-jwt/tree/v1.5"
},
"time": "2023-12-05T08:17:09+00:00"
},
{
"name": "carbonphp/carbon-doctrine-types",
"version": "3.2.0",
@ -242,163 +81,6 @@
],
"time": "2024-02-09T16:56:22+00:00"
},
{
"name": "doctrine/cache",
"version": "1.13.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "56cd022adb5514472cb144c087393c1821911d09"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/56cd022adb5514472cb144c087393c1821911d09",
"reference": "56cd022adb5514472cb144c087393c1821911d09",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "~7.1 || ^8.0"
},
"conflict": {
"doctrine/common": ">2.2,<2.4"
},
"require-dev": {
"alcaeus/mongo-php-adapter": "^1.1",
"cache/integration-tests": "dev-master",
"doctrine/coding-standard": "^9",
"mongodb/mongodb": "^1.1",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"predis/predis": "~1.0",
"psr/cache": "^1.0 || ^2.0 || ^3.0",
"symfony/cache": "^4.4 || ^5.4 || ^6",
"symfony/var-exporter": "^4.4 || ^5.4 || ^6"
},
"suggest": {
"alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.",
"homepage": "https://www.doctrine-project.org/projects/cache.html",
"keywords": [
"abstraction",
"apcu",
"cache",
"caching",
"couchdb",
"memcached",
"php",
"redis",
"xcache"
],
"support": {
"issues": "https://github.com/doctrine/cache/issues",
"source": "https://github.com/doctrine/cache/tree/1.13.0"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache",
"type": "tidelift"
}
],
"abandoned": true,
"time": "2022-05-20T20:06:54+00:00"
},
{
"name": "doctrine/deprecations",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^12",
"phpstan/phpstan": "1.4.10 || 2.0.3",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"psr/log": "^1 || ^2 || ^3"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Deprecations\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.",
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/1.1.4"
},
"time": "2024-12-07T21:18:45+00:00"
},
{
"name": "doctrine/inflector",
"version": "2.0.10",
@ -468,177 +150,17 @@
"inflection",
"inflector",
"lowercase",
"manipulation",
"php",
"plural",
"singular",
"strings",
"uppercase",
"words"
],
"support": {
"issues": "https://github.com/doctrine/inflector/issues",
"source": "https://github.com/doctrine/inflector/tree/2.0.10"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector",
"type": "tidelift"
}
],
"time": "2024-02-18T20:23:39+00:00"
},
{
"name": "doctrine/instantiator",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
"reference": "0a0fa9780f5d4e507415a065172d26a98d02047b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b",
"reference": "0a0fa9780f5d4e507415a065172d26a98d02047b",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^11",
"ext-pdo": "*",
"ext-phar": "*",
"phpbench/phpbench": "^0.16 || ^1",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-phpunit": "^1",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"vimeo/psalm": "^4.30 || ^5.4"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
"homepage": "https://ocramius.github.io/"
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
"homepage": "https://www.doctrine-project.org/projects/instantiator.html",
"keywords": [
"constructor",
"instantiate"
],
"support": {
"issues": "https://github.com/doctrine/instantiator/issues",
"source": "https://github.com/doctrine/instantiator/tree/1.5.0"
},
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
"type": "tidelift"
}
],
"time": "2022-12-30T00:15:36+00:00"
},
{
"name": "doctrine/lexer",
"version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/lexer.git",
"reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/lexer/zipball/861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6",
"reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"doctrine/deprecations": "^1.0",
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^9 || ^12",
"phpstan/phpstan": "^1.3",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.6",
"psalm/plugin-phpunit": "^0.18.3",
"vimeo/psalm": "^4.11 || ^5.21"
},
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Common\\Lexer\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Guilherme Blanco",
"email": "guilhermeblanco@gmail.com"
},
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
},
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com"
}
],
"description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.",
"homepage": "https://www.doctrine-project.org/projects/lexer.html",
"keywords": [
"annotations",
"docblock",
"lexer",
"parser",
"php"
"manipulation",
"php",
"plural",
"singular",
"strings",
"uppercase",
"words"
],
"support": {
"issues": "https://github.com/doctrine/lexer/issues",
"source": "https://github.com/doctrine/lexer/tree/2.1.1"
"issues": "https://github.com/doctrine/inflector/issues",
"source": "https://github.com/doctrine/inflector/tree/2.0.10"
},
"funding": [
{
@ -650,24 +172,24 @@
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer",
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector",
"type": "tidelift"
}
],
"time": "2024-02-05T11:35:39+00:00"
"time": "2024-02-18T20:23:39+00:00"
},
{
"name": "egulias/email-validator",
"version": "3.2.6",
"name": "doctrine/instantiator",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/egulias/EmailValidator.git",
"reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7"
"url": "https://github.com/doctrine/instantiator.git",
"reference": "0a0fa9780f5d4e507415a065172d26a98d02047b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/egulias/EmailValidator/zipball/e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7",
"reference": "e5997fa97e8790cdae03a9cbd5e78e45e3c7bda7",
"url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b",
"reference": "0a0fa9780f5d4e507415a065172d26a98d02047b",
"shasum": "",
"mirrors": [
{
@ -677,26 +199,22 @@
]
},
"require": {
"doctrine/lexer": "^1.2|^2",
"php": ">=7.2",
"symfony/polyfill-intl-idn": "^1.15"
"php": "^7.1 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^8.5.8|^9.3.3",
"vimeo/psalm": "^4"
},
"suggest": {
"ext-intl": "PHP Internationalization Libraries are required to use the SpoofChecking validation"
"doctrine/coding-standard": "^9 || ^11",
"ext-pdo": "*",
"ext-phar": "*",
"phpbench/phpbench": "^0.16 || ^1",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-phpunit": "^1",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"vimeo/psalm": "^4.30 || ^5.4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Egulias\\EmailValidator\\": "src"
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -705,29 +223,36 @@
],
"authors": [
{
"name": "Eduardo Gulias Davis"
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
"homepage": "https://ocramius.github.io/"
}
],
"description": "A library for validating emails against several RFCs",
"homepage": "https://github.com/egulias/EmailValidator",
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
"homepage": "https://www.doctrine-project.org/projects/instantiator.html",
"keywords": [
"email",
"emailvalidation",
"emailvalidator",
"validation",
"validator"
"constructor",
"instantiate"
],
"support": {
"issues": "https://github.com/egulias/EmailValidator/issues",
"source": "https://github.com/egulias/EmailValidator/tree/3.2.6"
"issues": "https://github.com/doctrine/instantiator/issues",
"source": "https://github.com/doctrine/instantiator/tree/1.5.0"
},
"funding": [
{
"url": "https://github.com/egulias",
"type": "github"
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
"type": "tidelift"
}
],
"time": "2023-06-01T07:04:22+00:00"
"time": "2022-12-30T00:15:36+00:00"
},
{
"name": "fig/http-message-util",
@ -4202,160 +3727,6 @@
],
"time": "2025-10-30T01:44:44+00:00"
},
{
"name": "hyperf/translation",
"version": "v3.1.63",
"source": {
"type": "git",
"url": "https://github.com/hyperf/translation.git",
"reference": "04e8fc76031f256740f16b46dadac0e4e900b48b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/hyperf/translation/zipball/04e8fc76031f256740f16b46dadac0e4e900b48b",
"reference": "04e8fc76031f256740f16b46dadac0e4e900b48b",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"hyperf/collection": "~3.1.0",
"hyperf/context": "~3.1.0",
"hyperf/contract": "~3.1.0",
"hyperf/macroable": "~3.1.0",
"hyperf/stringable": "~3.1.0",
"hyperf/support": "~3.1.0",
"php": ">=8.1",
"psr/container": "^1.0 || ^2.0"
},
"type": "library",
"extra": {
"hyperf": {
"config": "Hyperf\\Translation\\ConfigProvider"
},
"branch-alias": {
"dev-master": "3.1-dev"
}
},
"autoload": {
"files": [
"src/Functions.php"
],
"psr-4": {
"Hyperf\\Translation\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "An independent translation component, forked by illuminate/translation.",
"keywords": [
"hyperf",
"translation"
],
"support": {
"issues": "https://github.com/hyperf/translation/issues",
"source": "https://github.com/hyperf/translation/tree/v3.1.63"
},
"funding": [
{
"url": "https://hyperf.wiki/#/zh-cn/donate",
"type": "custom"
},
{
"url": "https://opencollective.com/hyperf",
"type": "open_collective"
}
],
"time": "2025-10-30T01:44:44+00:00"
},
{
"name": "hyperf/validation",
"version": "v3.1.65",
"source": {
"type": "git",
"url": "https://github.com/hyperf/validation.git",
"reference": "fea3ffbf97e5b1f457b50706ef48741a0d715e0c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/hyperf/validation/zipball/fea3ffbf97e5b1f457b50706ef48741a0d715e0c",
"reference": "fea3ffbf97e5b1f457b50706ef48741a0d715e0c",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"egulias/email-validator": "^3.0",
"hyperf/collection": "~3.1.0",
"hyperf/conditionable": "~3.1.0",
"hyperf/context": "~3.1.0",
"hyperf/contract": "~3.1.0",
"hyperf/di": "~3.1.0",
"hyperf/framework": "~3.1.0",
"hyperf/macroable": "~3.1.0",
"hyperf/stringable": "~3.1.0",
"hyperf/support": "~3.1.0",
"hyperf/tappable": "~3.1.0",
"hyperf/translation": "~3.1.0",
"nesbot/carbon": "^2.21",
"php": ">=8.1",
"psr/container": "^1.0 || ^2.0",
"psr/event-dispatcher": "^1.0",
"psr/http-message": "^1.0 || ^2.0"
},
"suggest": {
"hyperf/database": "Required if you want to use the database validation rule (~3.1.0).",
"hyperf/http-server": "Required if you want to use the request validation rule (~3.1.0)."
},
"type": "library",
"extra": {
"hyperf": {
"config": "Hyperf\\Validation\\ConfigProvider"
},
"branch-alias": {
"dev-master": "3.1-dev"
}
},
"autoload": {
"psr-4": {
"Hyperf\\Validation\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "hyperf validation",
"keywords": [
"hyperf",
"validation"
],
"support": {
"issues": "https://github.com/hyperf/validation/issues",
"source": "https://github.com/hyperf/validation/tree/v3.1.65"
},
"funding": [
{
"url": "https://hyperf.wiki/#/zh-cn/donate",
"type": "custom"
},
{
"url": "https://opencollective.com/hyperf",
"type": "open_collective"
}
],
"time": "2025-12-01T03:37:59+00:00"
},
{
"name": "laminas/laminas-mime",
"version": "2.12.0",
@ -6069,95 +5440,6 @@
],
"time": "2025-06-27T09:58:17+00:00"
},
{
"name": "symfony/polyfill-intl-idn",
"version": "v1.32.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/9614ac4d8061dc257ecc64cba1b140873dce8ad3",
"reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.2",
"symfony/polyfill-intl-normalizer": "^1.10"
},
"suggest": {
"ext-intl": "For best performance"
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Intl\\Idn\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Laurent Bassin",
"email": "laurent@bassin.info"
},
{
"name": "Trevor Rowbotham",
"email": "trevor.rowbotham@pm.me"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"idn",
"intl",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.32.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-09-10T14:38:51+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
"version": "v1.32.0",

@ -1,183 +0,0 @@
<?php
declare(strict_types=1);
/**
* This file is part of qbhy/hyperf-auth.
*
* @link https://github.com/qbhy/hyperf-auth
* @document https://github.com/qbhy/hyperf-auth/blob/master/README.md
* @contact qbhy0715@qq.com
* @license https://github.com/qbhy/hyperf-auth/blob/master/LICENSE
*/
use Qbhy\SimpleJwt\Encoders;
use Qbhy\SimpleJwt\EncryptAdapters as Encrypter;
use function Hyperf\Support\env;
use function Hyperf\Support\make;
return [
'default' => [
'guard' => 'jwt',
'provider' => 'users',
],
'guards' => [
'sso' => [
// 支持的设备env配置时用英文逗号隔开
'clients' => explode(',', env('AUTH_SSO_CLIENTS', 'pc')),
// hyperf/redis 实例
'redis' => function () {
return make(\Hyperf\Redis\Redis::class);
},
// 自定义 redis key必须包含 {uid}{uid} 会被替换成用户ID
'redis_key' => 'u:token:{uid}',
'driver' => Qbhy\HyperfAuth\Guard\SsoGuard::class,
'provider' => 'users',
/*
* 以下是 simple-jwt 配置
* 必填
* jwt 服务端身份标识
*/
'secret' => env('SSO_JWT_SECRET'),
/*
* 可选配置
* jwt 默认头部token使用的字段
*/
'header_name' => env('JWT_HEADER_NAME', 'Authorization'),
/*
* 可选配置
* jwt 生命周期,单位秒,默认一天
*/
'ttl' => (int) env('SIMPLE_JWT_TTL', 60 * 60 * 24),
/*
* 可选配置
* 允许过期多久以内的 token 进行刷新,单位秒,默认一周
*/
'refresh_ttl' => (int) env('SIMPLE_JWT_REFRESH_TTL', 60 * 60 * 24 * 7),
/*
* 可选配置
* 默认使用的加密类
*/
'default' => Encrypter\SHA1Encrypter::class,
/*
* 可选配置
* 加密类必须实现 Qbhy\SimpleJwt\Interfaces\Encrypter 接口
*/
'drivers' => [
Encrypter\PasswordHashEncrypter::alg() => Encrypter\PasswordHashEncrypter::class,
Encrypter\CryptEncrypter::alg() => Encrypter\CryptEncrypter::class,
Encrypter\SHA1Encrypter::alg() => Encrypter\SHA1Encrypter::class,
Encrypter\Md5Encrypter::alg() => Encrypter\Md5Encrypter::class,
],
/*
* 可选配置
* 编码类
*/
'encoder' => new Encoders\Base64UrlSafeEncoder(),
// 'encoder' => new Encoders\Base64Encoder(),
/*
* 可选配置
* 缓存类
*/
'cache' => new \Doctrine\Common\Cache\FilesystemCache(sys_get_temp_dir()),
// 如果需要分布式部署,请选择 redis 或者其他支持分布式的缓存驱动
// 'cache' => function () {
// return make(\Qbhy\HyperfAuth\HyperfRedisCache::class);
// },
/*
* 可选配置
* 缓存前缀
*/
'prefix' => env('SIMPLE_JWT_PREFIX', 'default'),
],
'jwt' => [
'driver' => Qbhy\HyperfAuth\Guard\JwtGuard::class,
'provider' => 'users',
/*
* 以下是 simple-jwt 配置
* 必填
* jwt 服务端身份标识
*/
'secret' => env('SIMPLE_JWT_SECRET'),
/*
* 可选配置
* jwt 默认头部token使用的字段
*/
'header_name' => env('JWT_HEADER_NAME', 'Authorization'),
/*
* 可选配置
* jwt 生命周期,单位秒,默认一天
*/
'ttl' => (int) env('SIMPLE_JWT_TTL', 60 * 60 * 24),
/*
* 可选配置
* 允许过期多久以内的 token 进行刷新,单位秒,默认一周
*/
'refresh_ttl' => (int) env('SIMPLE_JWT_REFRESH_TTL', 60 * 60 * 24 * 7),
/*
* 可选配置
* 默认使用的加密类
*/
'default' => Encrypter\SHA1Encrypter::class,
/*
* 可选配置
* 加密类必须实现 Qbhy\SimpleJwt\Interfaces\Encrypter 接口
*/
'drivers' => [
Encrypter\PasswordHashEncrypter::alg() => Encrypter\PasswordHashEncrypter::class,
Encrypter\CryptEncrypter::alg() => Encrypter\CryptEncrypter::class,
Encrypter\SHA1Encrypter::alg() => Encrypter\SHA1Encrypter::class,
Encrypter\Md5Encrypter::alg() => Encrypter\Md5Encrypter::class,
],
/*
* 可选配置
* 编码类
*/
'encoder' => new Encoders\Base64UrlSafeEncoder(),
// 'encoder' => new Encoders\Base64Encoder(),
/*
* 可选配置
* 缓存类
*/
'cache' => new \Doctrine\Common\Cache\FilesystemCache(sys_get_temp_dir()),
// 如果需要分布式部署,请选择 redis 或者其他支持分布式的缓存驱动
// 'cache' => function () {
// return make(\Qbhy\HyperfAuth\HyperfRedisCache::class);
// },
/*
* 可选配置
* 缓存前缀
*/
'prefix' => env('SIMPLE_JWT_PREFIX', 'default'),
],
'session' => [
'driver' => Qbhy\HyperfAuth\Guard\SessionGuard::class,
'provider' => 'users',
],
],
'providers' => [
'users' => [
'driver' => \Qbhy\HyperfAuth\Provider\EloquentProvider::class,
'model' => App\Model\User::class, // 需要实现 Qbhy\HyperfAuth\Authenticatable 接口
],
],
];
Loading…
Cancel
Save