{"id":21384923,"url":"https://github.com/alexpts/php-mutable-psr7","last_synced_at":"2026-01-27T00:13:19.648Z","repository":{"id":56944737,"uuid":"270240106","full_name":"alexpts/php-mutable-psr7","owner":"alexpts","description":"A super lightweight PSR-7 implementation (muttable)","archived":false,"fork":false,"pushed_at":"2024-11-06T16:01:25.000Z","size":110,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-21T11:57:22.578Z","etag":null,"topics":["php","psr-7"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexpts.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-07T08:19:11.000Z","updated_at":"2022-03-03T13:27:02.000Z","dependencies_parsed_at":"2024-11-22T11:44:02.171Z","dependency_job_id":"00ed3b6e-55dd-4cd0-8cab-54f8a0d3f56f","html_url":"https://github.com/alexpts/php-mutable-psr7","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"cdd72b1e1b355f6ecd1f93884d915e738a7c476d"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/alexpts/php-mutable-psr7","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpts%2Fphp-mutable-psr7","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpts%2Fphp-mutable-psr7/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpts%2Fphp-mutable-psr7/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpts%2Fphp-mutable-psr7/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexpts","download_url":"https://codeload.github.com/alexpts/php-mutable-psr7/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpts%2Fphp-mutable-psr7/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28792647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["php","psr-7"],"created_at":"2024-11-22T11:43:55.466Z","updated_at":"2026-01-27T00:13:19.627Z","avatar_url":"https://github.com/alexpts.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://app.travis-ci.com/alexpts/php-mutable-psr7.svg?branch=master)](https://app.travis-ci.com/alexpts/php-mutable-psr7)\n[![Code Coverage](https://scrutinizer-ci.com/g/alexpts/php-mutable-psr7/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/alexpts/php-mutable-psr7/?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/alexpts/php-mutable-psr7/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/alexpts/php-mutable-psr7/?branch=master)\n\n### Mutable\nThe package is based on https://github.com/Nyholm/psr7/. The package is mutable. If you need immutable implementation please to see `nyholm/psr7`.\n\n\nA super lightweight PSR-7 implementation. Very strict and very fast.\n\n## Installation\n\n```bash\ncomposer require alexpts/mutable-psr7\n```\n\nIf you are using Symfony Flex then you get all message factories registered as services.\n\n## Usage\n\nThe PSR-7 objects do not contain any other public methods than those defined in\nthe [PSR-7 specification](https://www.php-fig.org/psr/psr-7/).\n\n### Create objects\n\nUse the PSR-17 factory to create requests, streams, URIs etc.\n\n```php\n$psr17Factory = new \\PTS\\Psr7\\Factory\\Psr17Factory();\n$request = $psr17Factory-\u003ecreateRequest('GET', 'http://some.com');\n$stream = $psr17Factory-\u003ecreateStream('foobar');\n```\n\n### Sending a request\n\nWith [HTTPlug](http://httplug.io/) or any other PSR-18 (HTTP client) you may send\nrequests like:\n\n```bash\ncomposer require kriswallsmith/buzz\n```\n\n```php\n$psr17Factory = new \\PTS\\Psr7\\Factory\\Psr17Factory();\n$psr18Client = new \\Buzz\\Client\\Curl($psr17Factory);\n\n$request = $psr17Factory-\u003ecreateRequest('GET', 'http://some.com');\n$response = $psr18Client-\u003esendRequest($request);\n```\n\n### Create server requests\n\nThe [`nyholm/psr7-server`](https://github.com/Nyholm/psr7-server) package can be used\nto create server requests from PHP superglobals.\n\n```bash\ncomposer require nyholm/psr7-server\n```\n\n```php\n$psr17Factory = new \\PTS\\Psr7\\Factory\\Psr17Factory();\n\n$creator = new \\Nyholm\\Psr7Server\\ServerRequestCreator(\n    $psr17Factory, // ServerRequestFactory\n    $psr17Factory, // UriFactory\n    $psr17Factory, // UploadedFileFactory\n    $psr17Factory  // StreamFactory\n);\n\n$serverRequest = $creator-\u003efromGlobals();\n```\n\n### Emitting a response\n\n```bash\ncomposer require laminas/laminas-httphandlerrunner\n```\n\n```php\n$psr17Factory = new \\PTS\\Psr7\\Factory\\Psr17Factory();\n\n$responseBody = $psr17Factory-\u003ecreateStream('Hello world');\n$response = $psr17Factory-\u003ecreateResponse(200)-\u003ewithBody($responseBody);\n(new \\Laminas\\HttpHandlerRunner\\Emitter\\SapiEmitter())-\u003eemit($response);\n```\n\n\n\n### Benchmark Tests\n\n`composer bench`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpts%2Fphp-mutable-psr7","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexpts%2Fphp-mutable-psr7","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpts%2Fphp-mutable-psr7/lists"}