chimera / routing-expressive
Requires
- php: ^7.4 || ^8.0
- chimera/foundation: ^0.4
- chimera/routing: ^0.4
- psr/http-message: ^1.0
- zendframework/zend-diactoros: ^2.2
- zendframework/zend-expressive: ^3.2
- zendframework/zend-expressive-fastroute: ^3.0
- zendframework/zend-expressive-helpers: ^5.3
- zendframework/zend-expressive-router: ^3.1
Requires (Dev)
- infection/infection: ^0.21
- lcobucci/coding-standard: ^6.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^0.12
- phpstan/phpstan-deprecation-rules: ^0.12
- phpstan/phpstan-phpunit: ^0.12
- phpstan/phpstan-strict-rules: ^0.12
- phpunit/phpunit: ^9.5
Provides
This package is auto-updated.
Last update: 2021-02-24 21:10:38 UTC
README
⚠️ 该软件包已过时,将不再接收任何更新,请使用 chimera/routing-mezzio 代替 ⚠️
术语“Chimera”(发音为/kɪˈmɪərə/或/kaɪˈmɪərə/)用来描述任何由各种动物部分组成的神话或虚构动物,或者描述由非常不同的部分组成的事物,或者被视为非常富有想象力、难以置信或令人眼花缭乱的。
PHP 社区中有许多令人惊叹的库,随着 PSRs 的创建和采用,我们不必一定依赖全栈框架来创建复杂且设计良好的软件。选择要使用的组件并将它们连接起来有时可能有点具有挑战性。
这套软件包的目标是使其更容易做到这一点(而不妥协质量),让您能够专注于软件的行为。
此软件包仅提供对 Zend Expressive v3.0 的适配器,以便它可以作为 HTTP 应用程序使用。
安装
该软件包在 Packagist 上可用,您可以使用 Composer 进行安装。
composer require chimera/routing-expressive
PHP 配置
为了确保我们处理的是正确的数据,我们使用了 assert()
,这是 PHP 中一个非常有趣的功能,但很少使用。关于 assert()
的好处是我们可以在生产模式下禁用它,这样我们就不必有不必要的语句。
因此,对于生产模式,我们建议您在您的 php.ini
中将 zend.assertions
设置为 -1
。对于开发,您应该将 zend.assertions
留为 1
并将 assert.exception
设置为 1
,这样当出现问题时,PHP 会抛出 AssertionError
。
有关更多信息,请参阅文档:https://secure.php.net/manual/en/function.assert.php
使用方法
要使用此软件包,您需要配置您的 Zend Expressive 应用程序以使用我们的软件包(如此处所述),并在 DI 容器中注册 Chimera\Routing\Expressive\UriGenerator
和 Chimera\Routing\Expressive\RouteParamsExtractor
实例。
许可协议
MIT,请参阅LICENSE。