eureka / kernel-http
Kernel Http 用于内容 PHP 应用程序。使用 PSR-7、15 & 17 构建应用程序。
6.0.0
2024-02-22 17:05 UTC
Requires
- php: 8.1.*||8.2.*||8.3.*
- ext-filter: *
- ext-json: *
- eureka/component-http: ^5.3
- nyholm/psr7: ^1.8
- psr/cache: ^1.0||^2.0||^3.0
- psr/container: ^1.0||^2.0||^3.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.0||^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
- psr/log: ^1.1||^2.0||^3.0
- symfony/config: ^5.4||^6.4||^7.0
- symfony/dependency-injection: ^5.4||^6.4||^7.0
- symfony/finder: ^5.4||^6.4||^7.0
- symfony/routing: ^5.4||^6.4||^7.0
- symfony/yaml: ^5.4||^6.4||^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.49.0
- maglnet/composer-require-checker: ^4.7.1
- phpstan/phpstan: ^1.10.59
- phpstan/phpstan-phpunit: ^1.3.15
- phpstan/phpstan-strict-rules: ^1.5.2
- phpunit/phpcov: ^9.0.2
- phpunit/phpunit: ^10.5.10
- symfony/cache: ^5.4.35||^6.4.3||^7.0
This package is auto-updated.
Last update: 2024-09-22 18:25:49 UTC
README
Kernel Http 用于任何 Eureka 框架应用程序。
定义全局应用程序、控制器和组件内核版本
安装
如果您想在项目中安装它,请通过 composer 引入
composer require eureka/kernel-http
用法
<?php declare(strict_types=1); /* * Copyright (c) Romain Cottard * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Eureka\Kernel\Http\Application\Application; use Eureka\Kernel\Http\Kernel; //~ Define Loader & add main classes for config require_once __DIR__ . '/vendor/autoload.php'; $root = realpath(__DIR__ . '/'); $env = 'dev'; $debug = true; // Run application // Applications exception should be caught. Try catch useful only when you have a bug in kernel component try { $application = new Application(new Kernel($root, $env, $debug)); $response = $application->run(); $application->send($response); } catch (\Exception $exception) { echo 'Exception: ' . $exception->getMessage() . PHP_EOL; echo 'Trace: ' . $exception->getTraceAsString() . PHP_EOL; exit(1); }
贡献
查看CONTRIBUTING 文件。
安装/更新项目
您可以使用以下命令安装项目
make install
并使用以下命令更新
make update
注意:对于组件,composer.lock
文件没有提交。
测试 & CI(持续集成)
测试
您可以使用以下命令在您的侧运行单元测试(带有覆盖率)
make tests
您可以使用以下命令在您的侧运行功能测试(不带覆盖率)
make integration
对于更清晰的输出(但没有覆盖率),您可以使用以下命令
make testdox # run tests without coverage reports but with prettified output
代码风格
您还可以使用以下命令运行代码风格检查
make phpcs
您还可以使用以下命令运行代码风格修复
make phpcsf
静态分析
要执行代码的静态分析(使用 phpstan,默认为 lvl 9),您可以使用以下命令
make analyze
为了确保您的代码仍然与 Deezer 当前支持的版本和未来的 PHP 版本兼容,您需要运行以下命令(两者都是完全支持的必要条件)
最低支持版本
make php74compatibility
最高支持版本
make php83compatibility
CI 模拟
最后,“辅助”命令,您可以在提交和推送之前运行
make ci
许可证
本项目目前采用 MIT 许可证(MIT)。有关更多信息,请参阅 LICENCE 文件。