PHPackages                             asaliev/symfony-yii2-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. [Framework](/categories/framework)
4. /
5. asaliev/symfony-yii2-bridge

ActiveSymfony-bundle[Framework](/categories/framework)

asaliev/symfony-yii2-bridge
===========================

0.2.0(11mo ago)03MITPHPPHP &gt;=7.4 || ^8.0CI passing

Since May 8Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/asaliev/symfony-yii2-bridge)[ Packagist](https://packagist.org/packages/asaliev/symfony-yii2-bridge)[ Docs](https://github.com/asaliev/symfony-yii2-bridge)[ RSS](/packages/asaliev-symfony-yii2-bridge/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (15)Versions (4)Used By (0)

symfony-yii2-bridge
===================

[](#symfony-yii2-bridge)

[![codecov](https://camo.githubusercontent.com/5aa451a774a1c0314947684a6b50c6c3141e4b82708c7f8381f87e4fdb6063ed/68747470733a2f2f636f6465636f762e696f2f67682f6173616c6965762f73796d666f6e792d796969322d6272696467652f67726170682f62616467652e7376673f746f6b656e3d45495149473756485634)](https://codecov.io/gh/asaliev/symfony-yii2-bridge)

This bundle was created as part of a workshop presentation for my team. The goal was to tackle a hypothetical scenario where we needed to migrate a legacy Yii2 application to Symfony incrementally. It is not intended to be a production-ready plugin but serves as an example of how such a migration could be approached.

Supports PHP 7.4+ and Symfony 5.4+.

Overview
--------

[](#overview)

- Registers Yii2 routes with Symfony routing component.
- Dispatches Yii2 routes to Yii2 Application.
- Yii2 Application is executed via a message bus, keeping the Yii2 application lifecycle intact.

Installation
------------

[](#installation)

1. Install the package via Composer:

```
composer require asaliev/symfony-yii2-bridge
```

2. Register the bundle in your Symfony application:

```
// config/bundles.php
return [
    // Other bundles...
    Asaliev\Yii2Bridge\Yii2Bundle::class => ['all' => true],
];
```

3. Register the yii2 route type in your Symfony application:

```
# config/routes.yaml
yii2_routes:
  resource: .
  type: yii2_routes
```

4. Configure the bundle in your Symfony application:

```
# config/packages/yii2.yaml
web_config_path: '%kernel.project_dir%/path/to/web.php'
messenger_bus: 'yii.app.bus'

# Optionally override the default Yii2 container class with an adapter which checks whether a service is registered in the Symfony container first.
# Otherwise you may provide your own implementation of `yii\di\Container`.

#override_yii_container_class: 'Asaliev\Yii2Bridge\Application\PsrPreferredContainerAdapter'
```

5. Configure the Yii2 message bus in your Symfony application:

```
# config/packages/messenger.yaml
framework:
    messenger:
        buses:
            # ...Other configs
            yii.app.bus:
                middleware:
                    - App\Middleware\SomeExtraMiddleware
```

6. In the Yii2 configuration file, update the Request class to use `Asaliev\Yii2Bridge\Http\HeaderlessResponse` instead of the default `yii\web\Request`. This is necessary because Yii2 will output headers and cookies before we have a chance to halt it's output.

```
# path/to/yii2/web.php
return [
    // ...
    'components' => [
        // ...
        'response' => [
            // ...
            'class' => HeaderlessResponse::class,
        ],
];
```

License
-------

[](#license)

This project is licensed under the MIT License. See the LICENSE file for details.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance52

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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

Every ~19 days

Total

3

Last Release

331d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b2024e9efd399d9a1b531a7a939f956ded7b7701cd01854a04feca562fe0fe3?d=identicon)[asaliev](/maintainers/asaliev)

---

Top Contributors

[![asaliev](https://avatars.githubusercontent.com/u/836841?v=4)](https://github.com/asaliev "asaliev (13 commits)")

---

Tags

symfonysymfony-bundleyii2symfonyyii2Symfony Bundle

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/asaliev-symfony-yii2-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/asaliev-symfony-yii2-bridge/health.svg)](https://phpackages.com/packages/asaliev-symfony-yii2-bridge)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k235.4M9.7k](/packages/symfony-framework-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

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