{"id":51616629,"url":"https://github.com/phalcon/bridge-psr11","last_synced_at":"2026-07-12T14:01:35.381Z","repository":{"id":369609038,"uuid":"1290551965","full_name":"phalcon/bridge-psr11","owner":"phalcon","description":null,"archived":false,"fork":false,"pushed_at":"2026-07-06T04:32:16.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-07-06T06:11:54.974Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/phalcon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"phalcon","open_collective":"phalcon"}},"created_at":"2026-07-06T03:31:10.000Z","updated_at":"2026-07-06T04:19:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/phalcon/bridge-psr11","commit_stats":null,"previous_names":["phalcon/bridge-psr11"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/phalcon/bridge-psr11","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fbridge-psr11","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fbridge-psr11/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fbridge-psr11/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fbridge-psr11/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phalcon","download_url":"https://codeload.github.com/phalcon/bridge-psr11/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phalcon%2Fbridge-psr11/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35393398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-12T02:00:06.386Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-07-12T14:01:34.717Z","updated_at":"2026-07-12T14:01:35.378Z","avatar_url":"https://github.com/phalcon.png","language":"PHP","funding_links":["https://github.com/sponsors/phalcon","https://opencollective.com/phalcon"],"categories":[],"sub_categories":[],"readme":"# Phalcon Framework - Bridge PSR-11\n\n[![Bridge PSR-11 CI][ci-badge]][ci-link]\n[![Quality Gate Status][sonar-quality-badge]][sonar-link]\n[![Coverage][sonar-coverage-badge]][sonar-link]\n[![PDS Skeleton][pds-skeleton-badge]][pds-skeleton-link]\n\nPhalcon is an open source web framework delivered as a C extension for the PHP language providing high performance and lower resource consumption.\n\nBridge PSR-11 connects the Phalcon container ([Phalcon\\Container\\Container][container]) and the PSR-11 (`Psr\\Container\\ContainerInterface`) standard in both directions:\n\n* **`Container`** - a PSR-11 container backed by a Phalcon container. Use it wherever a `Psr\\Container\\ContainerInterface` is expected.\n* **`Adapter`** - wraps any PSR-11 container so it can be consumed through the Phalcon container's `get()` / `has()` surface.\n\n## Installation\n\nYou can install the package using composer\n\n```sh\ncomposer require phalcon/bridge-psr11\n```\n\n## Usage\n\n### `Container` - use a Phalcon container through a PSR-11 interface\n\n`Phalcon\\Bridge\\Psr11\\Container` *is* a `Psr\\Container\\ContainerInterface`, backed by a\nPhalcon container. Hand it to any code that expects a PSR-11 container.\n\n```php\nuse Phalcon\\Bridge\\Psr11\\Container;\nuse Phalcon\\Container\\Container as PhalconContainer;\n\n// A configured Phalcon container\n$phalcon = new PhalconContainer();\n// ... register services on $phalcon ...\n\n$container = new Container($phalcon);\n\n// $container is a Psr\\Container\\ContainerInterface\nif ($container-\u003ehas('router')) {\n    $router = $container-\u003eget('router');\n}\n```\n\nA missing entry throws `Phalcon\\Bridge\\Psr11\\Exception\\NotFound` (a\n`Psr\\Container\\NotFoundExceptionInterface`); `has()` never throws.\n\n### `Adapter` - use a PSR-11 container as a Phalcon container\n\n`Phalcon\\Bridge\\Psr11\\Adapter` wraps a `Psr\\Container\\ContainerInterface` and exposes it\nthrough the Phalcon container's `get()` / `has()` surface. Use it when a PSR-11 container\nalready exists, such as PHP-DI, and it needs to act as a Phalcon container.\n\n```php\nuse Phalcon\\Bridge\\Psr11\\Adapter;\n\n// Any Psr\\Container\\ContainerInterface, e.g. PHP-DI\n$psr = new DI\\Container(/* ... */);\n\n$container = new Adapter($psr);\n\nif ($container-\u003ehas('service')) {\n    $service = $container-\u003eget('service');\n}\n```\n\n## Development\n\nThe repository ships a Docker setup for local development and testing. You only need Docker +\nDocker Compose; the PHP runtime and Phalcon are provided inside the container.\n\n### Quick start\n\n```bash\ndocker compose up -d --build\ndocker compose exec app composer install\ndocker compose exec app composer test\n```\n\n\u003e `app` is the Compose *service* name. The running container is `bridge-psr11-app` (override with\n\u003e `PROJECT_PREFIX`). It stays up via a `sleep infinity` keepalive, so you can\n\u003e `docker compose exec app \u003ccmd\u003e` freely (e.g. `composer update`).\n\n### Choosing the PHP version\n\nThe image is built for one PHP version at a time, selected with the `PHP_VERSION` build arg\n(default `8.5`; supported `8.1`–`8.5`). Because it is a **build** arg, changing it requires a\nrebuild (`--build`):\n\n```bash\ndocker compose up -d --build                  # PHP 8.5 (default)\nPHP_VERSION=8.1 docker compose up -d --build  # PHP 8.1\nPHP_VERSION=8.4 docker compose up -d --build  # PHP 8.4\n```\n\nThe container keeps the same name, so each rebuild **replaces** the previous one. To run several\nversions side by side, give each its own Compose project and prefix:\n\n```bash\nPHP_VERSION=8.1 PROJECT_PREFIX=bridge-psr11-81 docker compose -p bridge-psr11-81 up -d --build\n# then: docker exec -w /srv bridge-psr11-81-app composer test\n```\n\n### Choosing the backend\n\nThe bridge works against either Phalcon runtime, selected with the `PHALCON_VARIANT` build arg:\n\n```bash\ndocker compose up -d --build                     # package: phalcon/phalcon (v6, default)\nPHALCON_VARIANT=ext docker compose up -d --build  # ext: cphalcon C extension (v5)\n```\n\nTip: drop `PHP_VERSION` / `PHALCON_VARIANT` into a `.env` file in the repo root to avoid prefixing\nevery command — Compose reads it automatically.\n\n### Composer scripts\n\nRun them inside the container, e.g. `docker compose exec app composer cs`:\n\n| Script                                 | Description                                                        |\n|----------------------------------------|--------------------------------------------------------------------|\n| `composer cs`                          | PHP_CodeSniffer (PSR-12)                                           |\n| `composer cs-fix`                      | Auto-fix coding-standard issues (phpcbf)                          |\n| `composer cs-fixer`                    | PHP CS Fixer (dry-run)                                             |\n| `composer cs-fixer-fix`                | Apply PHP CS Fixer                                                 |\n| `composer analyze`                     | PHPStan static analysis                                            |\n| `composer test` / `composer test-unit` | Unit tests via [`phalcon/talon`](https://github.com/phalcon/talon) |\n| `composer test-coverage`               | Tests + Clover coverage (`tests/_output/coverage.xml`)             |\n\n## Links\n\n### General\n* [Official Documentation](https://docs.phalcon.io/)\n\n### Support\n* [Forum](https://phalcon.io/forum)\n* [Discord](https://phalcon.io/discord)\n* [Stack Overflow](https://phalcon.io/so)\n\n### Social Media\n* [Telegram](https://phalcon.io/telegram)\n* [Gab](https://phalcon.io/gab)\n* [LinkedIn](https://phalcon.io/linkedin)\n* [MeWe](https://phalcon.io/mewe)\n* [Facebook](https://phalcon.io/fb)\n* [Twitter](https://phalcon.io/t)\n\n\n\u003c!-- External links should be here --\u003e\n[container]:            https://docs.phalcon.io/latest/container/\n[ci-badge]:             https://github.com/phalcon/bridge-psr11/actions/workflows/main.yml/badge.svg?branch=master\n[ci-link]:              https://github.com/phalcon/bridge-psr11/actions/workflows/main.yml\n[sonar-quality-badge]:  https://sonarcloud.io/api/project_badges/measure?project=phalcon_bridge-psr11\u0026metric=alert_status\n[sonar-coverage-badge]: https://sonarcloud.io/api/project_badges/measure?project=phalcon_bridge-psr11\u0026metric=coverage\n[sonar-link]:           https://sonarcloud.io/summary/new_code?id=phalcon_bridge-psr11\n[pds-skeleton-badge]:   https://img.shields.io/badge/pds-skeleton-blue.svg?style=flat-square\n[pds-skeleton-link]:    https://github.com/php-pds/skeleton\n[discord-badge]:        https://img.shields.io/discord/310910488152375297?label=Discord\u0026logo=discord\u0026style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalcon%2Fbridge-psr11","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphalcon%2Fbridge-psr11","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphalcon%2Fbridge-psr11/lists"}