aaronheath / laravel-speed-test
执行计划测试以验证下行带宽。
v1.0.1
2023-10-01 08:02 UTC
Requires
- php: ^8.2.0
- ext-json: *
- aaronheath/class-logger: ^1.2.0
- aaronheath/oauth-client: ^1.0.0
- guzzlehttp/guzzle: ^7.8.0
- illuminate/support: ^10.0.0
Requires (Dev)
- mockery/mockery: ^1.5.0
- orchestra/testbench: ^8.0.0
- phpunit/phpunit: ^10.0.0
- sempro/phpunit-pretty-print: ^1.0
- timacdonald/log-fake: ^2.0.0
- dev-master
- v1.0.1
- v1.0.0
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-20231001-oauth-bump
- dev-20231001-laravel-10
- dev-dependabot/composer/symfony/http-kernel-4.4.50
- dev-dependabot/composer/guzzlehttp/guzzle-6.5.8
- dev-dependabot/composer/guzzlehttp/psr7-1.8.5
- dev-dependabot/composer/lcobucci/jwt-3.4.6
- dev-dependabot/composer/league/flysystem-1.1.4
- dev-20201923-laravel-5-8-support
This package is auto-updated.
Last update: 2024-09-30 02:16:03 UTC
README
简介
这是一个个人包,用于简化计划中的下行带宽检查。
安装
此包通过 Composer 安装。
在安装之前,必须将存储库以及其他私有包添加到宿主项目的 composer.json 文件的存储库部分。
"repositories": [
{
"type": "vcs",
"url": "https://github.com/aaronheath/laravel-speed-test"
},
{
"type": "vcs",
"url": "https://github.com/aaronheath/oauth-client"
},
{
"type": "vcs",
"url": "https://github.com/aaronheath/class-logger"
}
],
要安装,请运行以下命令。
composer require aaronheath/laravel-speed-test
然后,发布配置文件。新文件将创建在 config/bandwidth-check.php。
可能还会为 oauth-client 创建另一个新配置文件。请参阅 该项目 获取更多详细信息。
php artisan vendor:publish
最后,您需要通过更新项目中的 .env 文件来配置带宽检查器。根据需要更新值。
BANDWIDTH_CHECK_ENABLED=true
BANDWIDTH_CHECK_REPORT_URL=https://example.com/api/bandwidth-check
BANDWIDTH_CHECK_DOWNLOAD_URL=https://example.com/50MB.file
BANDWIDTH_CHECK_FILESIZE=50
执行带宽检查
通过 CLI
配置正确后,可以通过 CLI 执行带宽检查。
php artisan bandwidth-check:run
执行此命令后,将执行检查并将结果发送到远程存储库。
通过任务
带宽检查也可以通过任务调度到队列中。
dispatch(new Heath\BandwidthCheck\BandwidthCheckJob);
直接
带宽检查也可以同步执行。
(new Heath\BandwidthCheck\BandwidthCheck)->run();
BandwidthCheck 还包括一个 isEnable() 方法,有助于确保检查已启用。
(new Heath\BandwidthCheck\BandwidthCheck)->isEnabled(); // bool