Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 95 commits ahead, 2 commits behind frenchcomp:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Teknoo Software - PHP-DI integration with Symfony

Latest Stable Version Latest Unstable Version Total Downloads License PHPStan

This package provides integration for PHP-DI with Symfony. PHP-DI is a dependency injection container for PHP. This bridge works as Symfony Bundle to integrate PHP-DI, into the Symfony Container, as factory for entries defined into PHP-DI. Unlike the official bridge, this bridge does not require to use a custom version of Symfony's Kernel, neither a custom version of Symfony's container. During Symfony container's compilation, all entries in PHP-DI will be referenced into Symfony's Container. The bridge will also implements the PSR Container interface (PSR-11) to act as an interface with Symfony Container in PHP-DI factory. They will directly call the Symfony Container instead of PHP-DI, The bridge will also automatically manage the management
of the parameters, managed differently by Symfony.

Install this bridge

If you use a previous version of PHP-DI Bridge, remove PHP-DI Kernel overload and use the default kernel

  • Add to you bundles.php file

      Teknoo\DI\SymfonyBridge\DIBridgeBundle::class => ['all' => true],
  • Create the file di_bridge.yaml in your config folder and put in

        #To enable PHP-DI's container compilation (disable by default)
        compilation_path: ~ #Default, or path to store cache, like '%kernel.project_dir%/var/cache/phpdi'
        #To enable PHP-DI's cache (disable by default)
        enable_cache: false #Default or true
          - 'list of PHP-DI definitions file, you can use Symfony joker like %kernel.project_dir%'
          - '%kernel.project_dir%/vendor/editor_name/package_name/src/di.php'
          - '%kernel.project_dir%/config/di.php'
          #To make alias from SF entries into PHPDI
          My\Class\Name: ''

Support this project

This project is free and will remain free, but it is developed on my personal time. If you like it and help me maintain it and evolve it, don't hesitate to support me on Patreon. Thanks :) Richard.

Installation & Requirements

To install this library with composer, run this command :

composer require teknoo/bridge-phpdi-symfony

This library requires :

* PHP 8.0+
* A PHP autoloader (Composer is recommended)
* Symfony/dependency-injection.
* Symfony/http-kernel.
* Symfony/config


Matthieu Napoli - Original developer. Richard Déloge - - Lead developer. Teknoo Software -

About Teknoo Software

Teknoo Software is a PHP software editor, founded by Richard Déloge. Teknoo Software's goals : Provide to our partners and to the community a set of high quality services or software, sharing knowledge and skills.


This library is licensed under the MIT License - see the licenses folder for details

Contribute :)

You are welcome to contribute to this project. Fork it on Github


Userfriendly integration of PHP-DI with Symfony



Security policy





No packages published


  • PHP 98.8%
  • Makefile 1.2%