{"id":18929524,"url":"https://github.com/thecodingmachine/drupal-service-provider-bridge","last_synced_at":"2026-03-16T14:30:18.623Z","repository":{"id":57067862,"uuid":"75755223","full_name":"thecodingmachine/drupal-service-provider-bridge","owner":"thecodingmachine","description":"This Drupal 8 module provides a bridge to include container-interop/service-provider service providers into your Drupal project.","archived":false,"fork":false,"pushed_at":"2016-12-15T21:43:19.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"0.3","last_synced_at":"2025-02-16T12:30:26.493Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodingmachine.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-12-06T17:33:07.000Z","updated_at":"2016-12-09T14:37:39.000Z","dependencies_parsed_at":"2022-08-24T10:20:12.477Z","dependency_job_id":null,"html_url":"https://github.com/thecodingmachine/drupal-service-provider-bridge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fdrupal-service-provider-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fdrupal-service-provider-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fdrupal-service-provider-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodingmachine%2Fdrupal-service-provider-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodingmachine","download_url":"https://codeload.github.com/thecodingmachine/drupal-service-provider-bridge/tar.gz/refs/heads/0.3","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239927823,"owners_count":19719835,"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":[],"created_at":"2024-11-08T11:33:24.631Z","updated_at":"2026-03-16T14:30:18.586Z","avatar_url":"https://github.com/thecodingmachine.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# container-interop/service-provider Drupal 8 module\n\nImport `service-provider` as defined in `container-interop` into a Drupal 8 project.\n\n## Usage\n\n### Installation\n\nInstall the package using Composer:\n\n```js\ncomposer require thecodingmachine/drupal-service-provider-bridge\n```\n\nGo to Drupal administration panel, to the \"Extensions\" page and enable the \"Service providers integration\" module.\n\n### Puli fix\n\nThere is currently an issue with Puli loading.\nTo fix it, create a `load_puli.php` file at the root of your project:\n\n**load_puli.php**\n```php\n\u003c?php\nif (file_exists(__DIR__.'/.puli/GeneratedPuliFactory.php')) {\n    require_once __DIR__.'/.puli/GeneratedPuliFactory.php';\n}\n```\n\nNow, go to your project `composer.json` file and in the `autoload` section, add:\n\n```js\n{\n    \"autoload\": {\n        \"files\": [\n            \"load_puli.php\"\n        ]\n    },\n}\n```\n\n### Usage using Puli\n\nThe bridge bundle will use Puli to automatically discover the service providers of your project. If the service provider you are loading publishes itself\non Puli, then you are done. The services declared in the service provider are available in the Symfony container!\n\n### Usage using manual declaration\n \nIf the service provider you are using does not publishes itself using Puli, you will have to declare it manually.\nTo do so, open a `service-providers.php` file at the web-root of your project, and return the list of service provider you want to import:\n\n**service-providers.php**\n```php\nreturn [\n    'service-providers' =\u003e [\n        'My\\\\Project\\\\Di\\\\MyServiceProvider',\n        'My\\\\Project\\\\Di\\\\MyOtherServiceProvider',\n    ]\n];\n```\n\n\n## Disabling Puli discovery\n\nYou can disable Puli discovery by passing `'puli' =\u003e false` in the `service-providers.php` file:\n\n**service-providers.php**\n```php\nreturn [\n    'service-providers' =\u003e [\n        'My\\\\Project\\\\Di\\\\MyServiceProvider',\n        'My\\\\Project\\\\Di\\\\MyOtherServiceProvider',\n    ],\n    'puli' =\u003e false\n];\n```\n\nNote: instead of returning a fully-qualified class name, you can also put in the array an instance of a service provider directly.\n\n## Known limitations\n\nDrupal 8 container only accepts **lower-case identifiers**.\n\nSince service providers can provide any kind of identifiers for services (both upper and lower case), this bridge systematically put cast the identifiers in lower-case.\n\nThis can introduce bugs if you have 2 services that have the same name in different cases (but honnestly, you should reconsider the way you design your service providers if you have this issue :) )\n\n\n## Default aliases\n\nBy default, this package provides will create the following entries:\n\n- `Psr\\Log\\LoggerInterface` =\u003e alias to `logger.channel.default` \n- `puli_factory` =\u003e The Puli factory\n- `puli_repository` =\u003e The Puli repository\n- `puli_discovery` =\u003e The Puli discovery service\n\n## How it works\n\nBehind the scene, this Drupal 8 module heavily relies on the [Symfony \u003c=\u003e service-provider bridge bundle](https://github.com/thecodingmachine/service-provider-bridge-bundle).\nIndeed, Drupal 8 container is a heavily adapted container based on Symfony container. This module is therefore a set of adaptations from the Symfony bridge.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fdrupal-service-provider-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodingmachine%2Fdrupal-service-provider-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodingmachine%2Fdrupal-service-provider-bridge/lists"}