PHPackages                             piotrpolak/codeigniter-symfony2-bridge - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. piotrpolak/codeigniter-symfony2-bridge

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

piotrpolak/codeigniter-symfony2-bridge
======================================

CodeIgniter library that facilitates integration of Symfony2 services into a CodeIgniter application in a compact yet elegant way.

1.0.0(7y ago)2864MITPHPPHP &gt;=5.3.0

Since Oct 24Pushed 7y ago1 watchersCompare

[ Source](https://github.com/piotrpolak/codeigniter-symfony2-bridge)[ Packagist](https://packagist.org/packages/piotrpolak/codeigniter-symfony2-bridge)[ RSS](/packages/piotrpolak-codeigniter-symfony2-bridge/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (2)Used By (0)

codeigniter-symfony2-bridge
===========================

[](#codeigniter-symfony2-bridge)

[![Build Status](https://camo.githubusercontent.com/ac4168bf909447eb21a499da43ececc876c701724bf760df9e6077776cda80f0/68747470733a2f2f7472617669732d63692e6f72672f70696f7472706f6c616b2f636f646569676e697465722d73796d666f6e79322d6272696467652e737667)](https://travis-ci.org/piotrpolak/codeigniter-symfony2-bridge)[![Maintainability](https://camo.githubusercontent.com/7acba9efd866dbab5a69ebc349b07de1a693669b330d68fcb3a97189d5fd087a/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33353633323836393065626532636339393164312f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/piotrpolak/codeigniter-symfony2-bridge/maintainability)[![Test Coverage](https://camo.githubusercontent.com/5a5d9497986cac1c98118ab0366d38bb7b00d7e714161ddc7ecdfa9ebe47ae49/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f33353633323836393065626532636339393164312f746573745f636f766572616765)](https://codeclimate.com/github/piotrpolak/codeigniter-symfony2-bridge/test_coverage)

A library that facilitates integration of Symfony services into legacy framework applications in a compact way.

As version 1.0.0 the package is composer-compatible and the code has been decoupled from the CodeIgniter framework.

If you want to use [the initial CodeIgniter library](https://github.com/piotrpolak/codeigniter-symfony2-bridge/releases/tag/0.1.0), please check the [0.1.0 release](https://github.com/piotrpolak/codeigniter-symfony2-bridge/releases/tag/0.1.0).

Some history and the most common scenario
-----------------------------------------

[](#some-history-and-the-most-common-scenario)

The library was written for a long term support project that had to be integrated with a brand new Symfony2+ application. The business logic is encapsulated within services managed by Symfony2+ dependency injection component and consumed both by the Symfony2+ bundles and some legacy CodeIgniter components.

Where possible, the service methods are taking variables of primitive types as input for convenience.

The output of the methods can be both of primitive types and complex objects as the bridge and the Symfony2+ kernel itself manages the PSR class autoload. The bridge does not create any overhead related to communication and parameter serialization.

Compatibility
-------------

[](#compatibility)

CodeIgniter: 2.0 - 3.1+

Symfony: 2.0+, 3.0+, 4.0+

Testing
-------

[](#testing)

```
composer install --prefer-dist && ./vendor/bin/phpunit -v
```

To test in an arbitrary version combination, please use (`sudo` might be required to connect to the Docker daemon):

```
PHP_VERSION=7.2 bin/test_in_docker.sh
```

Examples
--------

[](#examples)

### Getting Symfony2+ service container

[](#getting-symfony2-service-container)

```
$bridge = new \PiotrPolak\CodeIgniterSymfonyBridge\Bridge('./symfonyRootDir');
try {
    // \Symfony\Component\DependencyInjection\Container
    $container = $bridge->getKernel()->getContainer();
} catch(\PiotrPolak\CodeIgniterSymfonyBridge\Exception\KernelInitializationException $e) {
    // Unable to initialize Symfony2+ kernel
}
```

More information about Symfony service container and depencency injection:

- [http://symfony.com/doc/current/book/service\_container.html](http://symfony.com/doc/current/book/service_container.html)
- [http://symfony.com/doc/current/components/dependency\_injection/introduction.html](http://symfony.com/doc/current/components/dependency_injection/introduction.html)

### Consuming a service

[](#consuming-a-service)

```
$bridge = new \PiotrPolak\CodeIgniterSymfonyBridge\Bridge('./symfonyRootDir');
try {
    $result = $bridge->getKernel()->getContainer()->get('my_service')->businessLogicServiceMethod('parameter of a primitive type'));
} catch(\PiotrPolak\CodeIgniterSymfonyBridge\Exception\KernelInitializationException $e) {
    // Unable to initialize Symfony2+ kernel
}
```

When designing a service, parameters of primitive types are preferred - this creates minimum overhead and makes the service integration easy. The output of the service method can be of any type.

### Getting Doctrine2 entity manager

[](#getting-doctrine2-entity-manager)

```
$bridge = new \PiotrPolak\CodeIgniterSymfonyBridge\Bridge('./symfonyRootDir');
try {
    $em = $bridge->getKernel()->getContainer()->get('doctrine')->getManager();
} catch(\PiotrPolak\CodeIgniterSymfonyBridge\Exception\KernelInitializationException $e) {
    // Unable to initialize Symfony2+ kernel
}
```

Getting access to the Doctrine2 entity manager makes you able to get access to the entities and related repositories.

### Loading an arbitrary class defined within a Symfony2+ bundle

[](#loading-an-arbitrary-class-defined-within-a-symfony2-bundle)

```
$bridge = new \PiotrPolak\CodeIgniterSymfonyBridge\Bridge('./symfonyRootDir');
try {
    $container = $bridge->getKernel()->getContainer(); // Initializes Symfony2+ PSR class loader
    $imageHelper = new \Pepis\ImageManipulationBundle\Helpers\ImageHelper();
} catch(\PiotrPolak\CodeIgniterSymfonyBridge\Exception\KernelInitializationException $e) {
    // Unable to initialize Symfony2+ kernel
}
```

License
-------

[](#license)

The software is dual-licensed under:

- [MIT](LICENSE_MIT)
- [GPL v3](LICENSE_GPL_V3)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2754d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e8806a7475dd55dcf06f23489a27df7fa2b907697bbca65f294acdc37548593?d=identicon)[piotrpolak](/maintainers/piotrpolak)

---

Top Contributors

[![piotrpolak](https://avatars.githubusercontent.com/u/1048408?v=4)](https://github.com/piotrpolak "piotrpolak (34 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/piotrpolak-codeigniter-symfony2-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/piotrpolak-codeigniter-symfony2-bridge/health.svg)](https://phpackages.com/packages/piotrpolak-codeigniter-symfony2-bridge)
```

###  Alternatives

[paragi/php-websocket-client

Websocket client

14322.8k](/packages/paragi-php-websocket-client)[chippyash/monad

Functional programming Monad support

2828.1k8](/packages/chippyash-monad)[customgento/module-remove-product-comparison-m2

Remove Product Comparison for Magento 2 removes the product comparison feature completely from Magento.

1028.6k](/packages/customgento-module-remove-product-comparison-m2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
