mirror of
https://gitee.com/technical-laohu/mpay_v2_webman.git
synced 2026-04-22 01:54:25 +08:00
添加插件包
1. 验证器 respect/validation 2. 限流器 webman/rate-limiter 3. ENV环境组件 vlucas/phpdotenv 4. crontab定时任务组件 5. webman/console 命令行插件
This commit is contained in:
24
config/plugin/webman/console/app.php
Normal file
24
config/plugin/webman/console/app.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
|
||||
'build_dir' => BASE_PATH . DIRECTORY_SEPARATOR . 'build',
|
||||
|
||||
'phar_filename' => 'webman.phar',
|
||||
|
||||
'bin_filename' => 'webman.bin',
|
||||
|
||||
'signature_algorithm'=> Phar::SHA256, //set the signature algorithm for a phar and apply it. The signature algorithm must be one of Phar::MD5, Phar::SHA1, Phar::SHA256, Phar::SHA512, or Phar::OPENSSL.
|
||||
|
||||
'private_key_file' => '', // The file path for certificate or OpenSSL private key file.
|
||||
|
||||
'exclude_pattern' => '#^(?!.*(composer.json|/.github/|/.idea/|/.git/|/.setting/|/runtime/|/vendor-bin/|/build/|/vendor/webman/admin/))(.*)$#',
|
||||
|
||||
'exclude_files' => [
|
||||
'.env', 'LICENSE', 'composer.json', 'composer.lock', 'start.php', 'webman.phar', 'webman.bin'
|
||||
],
|
||||
|
||||
'custom_ini' => '
|
||||
memory_limit = 256M
|
||||
',
|
||||
];
|
||||
14
config/plugin/webman/rate-limiter/app.php
Normal file
14
config/plugin/webman/rate-limiter/app.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
return [
|
||||
'enable' => true,
|
||||
'driver' => 'auto', // auto, apcu, memory, redis
|
||||
'stores' => [
|
||||
'redis' => [
|
||||
'connection' => 'default',
|
||||
]
|
||||
],
|
||||
// 这些ip的请求不做频率限制
|
||||
'ip_whitelist' => [
|
||||
'127.0.0.1',
|
||||
],
|
||||
];
|
||||
17
config/plugin/webman/rate-limiter/bootstrap.php
Normal file
17
config/plugin/webman/rate-limiter/bootstrap.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* This file is part of webman.
|
||||
*
|
||||
* Licensed under The MIT License
|
||||
* For full copyright and license information, please see the MIT-LICENSE.txt
|
||||
* Redistributions of files must retain the above copyright notice.
|
||||
*
|
||||
* @author walkor<walkor@workerman.net>
|
||||
* @copyright walkor<walkor@workerman.net>
|
||||
* @link http://www.workerman.net/
|
||||
* @license http://www.opensource.org/licenses/mit-license.php MIT License
|
||||
*/
|
||||
|
||||
return [
|
||||
Webman\RateLimiter\Bootstrap::class
|
||||
];
|
||||
8
config/plugin/webman/rate-limiter/middleware.php
Normal file
8
config/plugin/webman/rate-limiter/middleware.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
use Webman\RateLimiter\Limiter;
|
||||
|
||||
return [
|
||||
'@' => [
|
||||
Limiter::class
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user