PHPackages                             proophsoftware/prooph-bundle - 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. [CLI &amp; Console](/categories/cli)
4. /
5. proophsoftware/prooph-bundle

ActiveSymfony-bundle[CLI &amp; Console](/categories/cli)

proophsoftware/prooph-bundle
============================

Symfony bundle for prooph components to get started out of the box with message bus, CQRS, event sourcing and snapshots

v0.1.2(10y ago)164.3k1BSD-3-ClausePHPPHP ^5.5 || ^7.0

Since Jan 18Pushed 9y ago4 watchersCompare

[ Source](https://github.com/proophsoftware/prooph-bundle)[ Packagist](https://packagist.org/packages/proophsoftware/prooph-bundle)[ Docs](http://prooph-software.com/)[ RSS](/packages/proophsoftware-prooph-bundle/feed)WikiDiscussions master Synced 2mo ago

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

Symfony bundle for prooph components
====================================

[](#symfony-bundle-for-prooph-components)

Deprecated
----------

[](#deprecated)

Based on user feedback we've decided to start working on Symfony integration again. This bundle makes use of the interop-container aware factories shipped with each prooph component. However, using these factories in a Symfony environment works different than you know it from other bundles. If you are looking for real Symfony bundles check out:

-
-

Overview
--------

[](#overview)

This is a Symfony bundle for prooph components to get started out of the box with message bus, CQRS, event sourcing and snapshots with the Symfony Doctrine Bundle. It uses Doctrine DBAL. There are more adapters available.

It provides all [service definitions and a default configuration](src/Resources/config "Symfony Bundle Resources"). This is more like a Quick-Start bundle. If you want to use the prooph components in production, we recommend to use only [prooph-interop-bundle](https://github.com/proophsoftware/prooph-interop-bundle) and configure the prooph components for your requirements. See the [documentation](http://getprooph.org/) for more details of the prooph components.

For rapid prototyping we recommend to use our [prooph-cli](https://github.com/proophsoftware/prooph-cli "prooph command line interface") tool.

### Available services

[](#available-services)

- `prooph.service_bus.command_bus`: Dispatches commands
- `prooph.service_bus.event_bus`: Dispatches events
- `prooph.event_bus.transaction_manager`: Transaction manager for service bus and event store
- `prooph.event_bus.event_publisher`: Publishes events on the event bus
- `prooph.event_store.doctrine_adapter`: Doctrine adapter for event store
- `prooph.event_store.snapshot_store`: Event store snapshot adapter
- `prooph.event_store.doctrine_snapshot_adapter`: Doctrine snapshot adapter

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

[](#installation)

You can install `proophsoftware/prooph-bundle` via composer by adding `"proophsoftware/prooph-bundle": "^0.1"` as requirement to your composer.json.

Finally, be sure to enable the following bundles in `AppKernel.php` by including the following:

```
// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        //...
        new Prooph\InteropBundle\ProophInteropBundle(),
        new Prooph\Bundle\ProophBundle(),
        new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
    );
}

```

### Database

[](#database)

Setup your Doctrine database [migrations](https://github.com/prooph/event-store-doctrine-adapter#database-set-up)for the Event Store and Snapshot. This bundle uses the Doctrine Migrations Bundle.

```
$ php bin/console doctrine:migrations:generate
```

Update the generated migration class with prooph Doctrine event store schema helper:

```
class Version20160202155238 extends AbstractMigration
{
    public function up(Schema $schema)
    {
        \Prooph\EventStore\Adapter\Doctrine\Schema\EventStoreSchema::createSingleStream($schema, 'event_stream', true);
    }

    public function down(Schema $schema)
    {
        \Prooph\EventStore\Adapter\Doctrine\Schema\EventStoreSchema::dropStream($schema, 'event_stream');
    }
}
```

And now for the snapshot table.

```
$ php bin/console doctrine:migrations:generate
```

Update the generated migration class with prooph Doctrine snapshot schema helper:

```
class Version20160202160810 extends AbstractMigration
{
    public function up(Schema $schema)
    {
        \Prooph\EventStore\Snapshot\Adapter\Doctrine\Schema\SnapshotStoreSchema::create($schema, 'snapshot');
    }

    public function down(Schema $schema)
    {
        \Prooph\EventStore\Snapshot\Adapter\Doctrine\Schema\SnapshotStoreSchema::drop($schema, 'snapshot');
    }
}
```

Now it's time to execute the migrations:

```
$ php bin/console doctrine:migrations:migrate
```

Example
-------

[](#example)

You have only to define your models (Entities, Repositories) and commands/routes. You find all these things in the [prooph components documentation](http://getprooph.org/ "prooph components documentation"). Here is an example YAML config from the [proophessor-do example app](https://github.com/prooph/proophessor-do "prooph components in action").

> You have to use a single quote `'` in the YAML configuration

Define the aggregate repository, command route and event route for `RegisterUser` in `app/config/config.yml`.

```
prooph:
  service_bus:
    command_bus:
      router:
        routes:
          # list of commands with corresponding command handler
          'Prooph\ProophessorDo\Model\User\Command\RegisterUser': 'Prooph\ProophessorDo\Model\User\Handler\RegisterUserHandler'
    event_bus:
      router:
        routes:
          # list of events with a list of projectors
          'Prooph\ProophessorDo\Model\User\Event\UserWasRegistered':
            - 'Prooph\ProophessorDo\Projection\User\UserProjector'
  event_store:
    # list of aggregate repositories
    user_collection:
      repository_class: 'Prooph\ProophessorDo\Infrastructure\Repository\EventStoreUserCollection'
      aggregate_type: 'Prooph\ProophessorDo\Model\User\User'
      aggregate_translator: 'Prooph\EventSourcing\EventStoreIntegration\AggregateTranslator'
      snapshot_store: 'Prooph\EventStore\Snapshot\SnapshotStore'
```

Add the service container factories. Here is an example of the corresponding service XML configuration with container-interop for the example above.

```

```

Here is an example how to call the `RegisterUser` command:

```
    /* @var $container \Symfony\Component\DependencyInjection\ContainerBuilder */

    /* @var $commandBus \Prooph\ServiceBus\CommandBus */
    $commandBus = $container->get('prooph.service_bus.command_bus');

    $command = new \Prooph\ProophessorDo\Model\User\Command\RegisterUser(
        [
            'user_id' => \Rhumsaa\Uuid\Uuid::uuid4()->toString(),
            'name' => 'prooph',
            'email' => 'my@domain.com',
        ]
    );

    $commandBus->dispatch($command);
```

Here is an example how to get a list of all users from the example above:

```
    /* @var $container \Symfony\Component\DependencyInjection\ContainerBuilder */
    $userFinder = $container->get('Prooph\ProophessorDo\Projection\User\UserFinder');

    $users = $userFinder->findAll();
```

Support
-------

[](#support)

- Ask questions on [prooph-users](https://groups.google.com/forum/?hl=de#!forum/prooph) mailing list.
- File issues at .
- Say hello in the [prooph gitter](https://gitter.im/prooph/improoph) chat.

Contribute
----------

[](#contribute)

Please feel free to fork and extend existing or add new plugins and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation.

License
-------

[](#license)

Released under the [New BSD License](LICENSE.md).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

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

Every ~37 days

Total

3

Last Release

3696d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e14a3b6de25e60cb289c51b23c58ffd8c56b28053deb4a75d3b7ea6b7fa03809?d=identicon)[proophsoftware](/maintainers/proophsoftware)

---

Top Contributors

[![sandrokeil](https://avatars.githubusercontent.com/u/3597436?v=4)](https://github.com/sandrokeil "sandrokeil (10 commits)")

---

Tags

clisymfonybundleintegrationevent sourcingcqrsproophsnapshots

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/proophsoftware-prooph-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/proophsoftware-prooph-bundle/health.svg)](https://phpackages.com/packages/proophsoftware-prooph-bundle)
```

###  Alternatives

[prooph/laravel-package

Laravel package for prooph components to get started out of the box with message bus, CQRS, event sourcing and snapshots

9910.4k](/packages/prooph-laravel-package)[prooph/service-bus-symfony-bundle

88392.2k3](/packages/prooph-service-bus-symfony-bundle)[sensiolabs/gotenberg-bundle

A Symfony bundle that provides seamless integration with Gotenberg for generating PDFs and screenshots from various sources (HTML, Markdown, Office documents, URLs) with a clean, builder-based API.

210210.4k2](/packages/sensiolabs-gotenberg-bundle)[prooph/event-store-symfony-bundle

109253.5k8](/packages/prooph-event-store-symfony-bundle)[cmsig/seal-symfony-bundle

An integration of CMS-IG SEAL search abstraction into Symfony Framework.

15195.8k5](/packages/cmsig-seal-symfony-bundle)[shapecode/cron-bundle

This bundle provides scheduled execution of Symfony commands

59493.0k2](/packages/shapecode-cron-bundle)

PHPackages © 2026

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