{"id":16233309,"url":"https://github.com/ajgarlag/psr-http-message-bundle","last_synced_at":"2025-03-19T14:31:28.647Z","repository":{"id":53981094,"uuid":"335565810","full_name":"ajgarlag/psr-http-message-bundle","owner":"ajgarlag","description":"Bundle to provide support for PSR-7 HTTP messages. It allows to inject instances of Psr\\Http\\Message\\ServerRequestInterface and to return instances of Psr\\Http\\Message\\ResponseInterface in controllers.","archived":false,"fork":false,"pushed_at":"2022-09-28T11:25:16.000Z","size":50,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T19:20:57.705Z","etag":null,"topics":["psr-7","psr7","symfony","symfony-bundle"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajgarlag.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-03T09:06:15.000Z","updated_at":"2024-04-12T06:41:45.000Z","dependencies_parsed_at":"2022-08-13T05:40:45.327Z","dependency_job_id":null,"html_url":"https://github.com/ajgarlag/psr-http-message-bundle","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajgarlag%2Fpsr-http-message-bundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajgarlag%2Fpsr-http-message-bundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajgarlag%2Fpsr-http-message-bundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajgarlag%2Fpsr-http-message-bundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajgarlag","download_url":"https://codeload.github.com/ajgarlag/psr-http-message-bundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243997108,"owners_count":20380980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["psr-7","psr7","symfony","symfony-bundle"],"created_at":"2024-10-10T13:12:11.560Z","updated_at":"2025-03-19T14:31:28.355Z","avatar_url":"https://github.com/ajgarlag.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"AjgarlagPsrHttpMessageBundle\n============================\n\nThis bundle provides support for HTTP messages interfaces defined\nin [PSR-7]. It allows to inject instances of ``Psr\\Http\\Message\\ServerRequestInterface``\nand to return instances of ``Psr\\Http\\Message\\ResponseInterface`` in controllers.\n\n\nThe inital code is borrowed from [sensio/framework-extra-bundle] which [removed support] for [PSR-7] since version 6.0.\n\n\nInstallation\n------------\n\nTo install the latest stable version of this component, open a console and execute the following command:\n```\n$ composer require ajgarlag/psr-http-message-bundle\n```\n\nNote that [autowiring aliases for PSR-17] must be installed. An easy way to provide them is to require [nyholm/psr7] :\n```\n$ composer require nyholm/psr7\n```\n\nConfiguration\n-------------\n\nIf your code depends on old `sensio_framework_extra_...` services identifiers, you should enable aliasing defining:\n```yaml\najgarlag_psr_http_message:\n    alias_sensio_framework_extra_services:\n        enabled: true\n```\n\n\nUsage\n-----\n\nThen, [PSR-7] messages can be used directly in controllers like in the following code snippet\n\n```php\nnamespace App\\Controller;\n\nuse Psr\\Http\\Message\\ResponseFactoryInterface;\nuse Psr\\Http\\Message\\ServerRequestInterface;\n\nclass DefaultController\n{\n    public function index(ServerRequestInterface $request, ResponseFactoryInterface $responseFactory)\n    {\n        // Interact with the PSR-7 request\n\n        $response = $responseFactory-\u003ecreateResponse();\n        // Interact with the PSR-7 response\n\n        return $response;\n    }\n}\n```\n\nNote that internally, Symfony always use `Symfony\\Component\\HttpFoundation\\Request`\nand `Symfony\\Component\\HttpFoundation\\Response` instances.\n\n\nUpgrade path from [sensio/framework-extra-bundle] [PSR-7] support\n-----------------------------------------------------------------\n\nIf your code depends on [sensio/framework-extra-bundle] [PSR-7] support, this is the\nsuggested upgrade path:\n\n1. Require `sensio/framework-extra-bundle:^5.3`.\n2. Require `ajgarlag/psr-http-message-bundle:^1.1`, and enable old services aliasing.\n3. Disable PSR-7 support in `sensio_framework_extra` configuration.\n4. If your code depends on old `sensio_framework_extra.psr7.http_(message|foundation)_factory` services identifiers,\n   modify service definitions to use the `Symfony\\Bridge\\PsrHttpMessage\\Http(Message|Foundation)Interface` alternatives\n   following deprecation messages.\n5. Do you need any other feature provided by `sensio/framework-extra-bundle`?:\n   - YES: require `sensio/framework-extra-bundle:^6.0`.\n   - NO: remove `sensio/framework-extra-bundle`.\n\n\nLicense\n-------\n\nThis component is under the MIT license. See the complete license in the [LICENSE] file.\n\n\nReporting an issue or a feature request\n---------------------------------------\n\nIssues and feature requests are tracked in the [Github issue tracker].\n\n\nAuthor Information\n------------------\n\nDeveloped with ♥ by [Antonio J. García Lagar].\n\nIf you find this component useful, please add a ★ in the [GitHub repository page] and/or the [Packagist package page].\n\n[sensio/framework-extra-bundle]: https://github.com/sensiolabs/SensioFrameworkExtraBundle\n[removed support]: https://github.com/sensiolabs/SensioFrameworkExtraBundle/pull/710\n[PSR-7]: http://www.php-fig.org/psr/psr-7/\n[autowiring aliases for PSR-17]: https://github.com/symfony/recipes/blob/master/nyholm/psr7/1.0/config/packages/nyholm_psr7.yaml\n[nyholm/psr7]: https://github.com/Nyholm/psr7\n[LICENSE]: LICENSE\n[Github issue tracker]: https://github.com/ajgarlag/psr-http-message-bundle/issues\n[Antonio J. García Lagar]: http://aj.garcialagar.es\n[GitHub repository page]: https://github.com/ajgarlag/psr-http-message-bundle\n[Packagist package page]: https://packagist.org/packages/ajgarlag/psr-http-message-bundle\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajgarlag%2Fpsr-http-message-bundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajgarlag%2Fpsr-http-message-bundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajgarlag%2Fpsr-http-message-bundle/lists"}