diff --git a/README.md b/README.md index 969635becf99a24fe1f9bbb21f33e7a83fcef8de..e6d1129fd0066ebc4bd9f0217b5eb71e2fa6e4a6 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ php bin/hyperf.php vendor:publish hyperf/cache ## 使用 ```php -use Hyperf\Utils\ApplicationContext; +use Hyperf\Context\ApplicationContext; use HyperfExt\Captcha\CaptchaFactory; $captchaFactory = ApplicationContext::getContainer()->get(CaptchaFactory::class); diff --git a/composer.json b/composer.json index f6453dee71577fcd809aa0ada4902438ffbebe57..6e28fcd4449d8ebf9f9cb48f0d551dc9162bade0 100644 --- a/composer.json +++ b/composer.json @@ -25,19 +25,19 @@ } }, "require": { - "php": ">=8.0", + "php": ">=8.1", "ext-fileinfo": "*", "ext-imagick": "*", - "ext-swoole": ">=4.8", - "hyperf-ext/encryption": "dev-master", - "hyperf/cache": "~3.0.0", - "hyperf/di": "~3.0.0", - "hyperf/framework": "~3.0.0", - "hyperf/validation": "~3.0.0" + "ext-swoole": ">=5.0", + "hyperf-ext/encryption": "3.1.x-dev", + "hyperf/cache": "~3.1.0", + "hyperf/di": "~3.1.0", + "hyperf/framework": "~3.1.0", + "hyperf/validation": "~3.1.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.0", - "hyperf/testing": "~3.0.0", + "hyperf/testing": "~3.1.0", "phpstan/phpstan": "^1.0", "swoole/ide-helper": "^5.0" }, diff --git a/publish/captcha.php b/publish/captcha.php index 3410391d4997bdfb19562127aef02df555163f41..8e8c85a370e85d21ab578b32fb0c76af8b2004cc 100644 --- a/publish/captcha.php +++ b/publish/captcha.php @@ -8,6 +8,8 @@ declare(strict_types=1); * @contact eric@zhu.email * @license https://github.com/hyperf-ext/captcha/blob/master/LICENSE */ +use function Hyperf\Support\env; + return [ 'fonts_dir' => BASE_PATH . '/storage/fonts', 'encryption_driver' => env('CAPTCHA_ENCRYPTION_DRIVER', 'aes'), diff --git a/src/Captcha.php b/src/Captcha.php index c3e1be21d7baf499e5e30c8d48f4d252bbf3850f..7ec1174fe67d83f5ab23f5f505e25721750c93b3 100644 --- a/src/Captcha.php +++ b/src/Captcha.php @@ -11,7 +11,7 @@ declare(strict_types=1); namespace HyperfExt\Captcha; use Carbon\Carbon; -use Hyperf\Utils\Contracts\Arrayable; +use Hyperf\Contract\Arrayable; class Captcha implements Arrayable { diff --git a/src/Listener/ValidatorFactoryResolvedListener.php b/src/Listener/ValidatorFactoryResolvedListener.php index 4546c13b8fd74ae27aa1faab28dda938ccb21fe2..7b41550bab5e8b426ee026cd7315fe3bc9c3ca40 100644 --- a/src/Listener/ValidatorFactoryResolvedListener.php +++ b/src/Listener/ValidatorFactoryResolvedListener.php @@ -11,7 +11,7 @@ declare(strict_types=1); namespace HyperfExt\Captcha\Listener; use Hyperf\Event\Contract\ListenerInterface; -use Hyperf\Utils\ApplicationContext; +use Hyperf\Context\ApplicationContext; use Hyperf\Validation\Event\ValidatorFactoryResolved; use HyperfExt\Captcha\CaptchaFactory;