{"id":36997617,"url":"https://github.com/php-pm/php-pm-psr7","last_synced_at":"2026-01-13T23:55:32.984Z","repository":{"id":57039956,"uuid":"56549922","full_name":"php-pm/php-pm-psr7","owner":"php-pm","description":"A PSR-7 middleware bridge for PHP-PM","archived":true,"fork":false,"pushed_at":"2017-11-30T09:01:23.000Z","size":10,"stargazers_count":27,"open_issues_count":1,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-08-15T11:29:43.206Z","etag":null,"topics":[],"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/php-pm.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}},"created_at":"2016-04-18T23:44:27.000Z","updated_at":"2023-01-28T21:25:14.000Z","dependencies_parsed_at":"2022-08-23T23:30:35.455Z","dependency_job_id":null,"html_url":"https://github.com/php-pm/php-pm-psr7","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/php-pm/php-pm-psr7","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-pm%2Fphp-pm-psr7","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-pm%2Fphp-pm-psr7/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-pm%2Fphp-pm-psr7/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-pm%2Fphp-pm-psr7/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-pm","download_url":"https://codeload.github.com/php-pm/php-pm-psr7/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-pm%2Fphp-pm-psr7/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2026-01-13T23:55:32.273Z","updated_at":"2026-01-13T23:55:32.971Z","avatar_url":"https://github.com/php-pm.png","language":"PHP","readme":"**[OBSOLETE] PSR-7 compatibility is now built into [php-pm](https://github.com/php-pm/php-pm) directly.**\n\n# PHP-PM PSR-7 Adapter\n\n[PSR-7](http://www.php-fig.org/psr/psr-7/) adapter for use of PSR-7 middleware applications with PHP-PM.\nSee https://github.com/php-pm/php-pm.\n\n## Setup\n\n```\ncomposer require php-pm/psr7-adapter\n```\n\n## Usage\n\nPPM bootstraps your application once, and then passes all incoming requests to this instance.\nThis instance needs to be a PSR-7 compatible interface, which means it needs to implement the following interface:\n\n```php\npublic function __invoke($request, $response, $next = null)\n```\n\nSo, to be compatible with this adapter, you need to implement a class that, when instantiated, sets up your application, and implements the `__invoke` method as described above.\n\nFor example, if you use Zend's [Stratigility library](https://github.com/zendframework/zend-stratigility), your bootstrapper could look like this:\n\n```php\nnamespace Your\\App;\n\nuse Zend\\Stratigility\\MiddlewarePipe;\n\nclass Middleware\n{\n    protected $pipe;\n\n    public function __construct()\n    {\n        // Set up the application\n\n        $this-\u003epipe = new MiddlewarePipe;\n\n        $this-\u003epipe-\u003epipe(new MyFirstMiddleware);\n        $this-\u003epipe-\u003epipe(new MySecondMiddleware);\n        $this-\u003epipe-\u003epipe(new MyThirdMiddleware);\n    }\n\n    public function __invoke($request, $response, $next = null)\n    {\n        $middleware = $this-\u003epipe;\n        return $middleware($request, $response, $next);\n    }\n}\n```\n\n### Starting the server\n\nWhen starting PPM, pass your middleware as the bootstrapper:\n\n```\nvendor/bin/ppm start --bridge=PHPPM\\\\Psr7\\\\Psr7Bridge --bootstrap=Your\\\\App\\\\Middleware\n```\n\nAlternatively, first configure PPM to use these options by default, and then start it directly:\n\n```\nvendor/bin/ppm config --bridge=PHPPM\\\\Psr7\\\\Psr7Bridge --bootstrap=Your\\\\App\\\\Middleware\nvendor/bin/ppm start\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-pm%2Fphp-pm-psr7","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-pm%2Fphp-pm-psr7","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-pm%2Fphp-pm-psr7/lists"}