PHPackages                             kurl/silex-doctrine-migrations-provider - 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. kurl/silex-doctrine-migrations-provider

ActiveLibrary

kurl/silex-doctrine-migrations-provider
=======================================

A doctrine migrations provider for silex

0.3.2(6y ago)21153.8k↑40.7%11[2 issues](https://github.com/breenie/silex-doctrine-migrations-provider/issues)[2 PRs](https://github.com/breenie/silex-doctrine-migrations-provider/pulls)1MITPHPPHP ^5.6|^7.0

Since Dec 15Pushed 3y ago2 watchersCompare

[ Source](https://github.com/breenie/silex-doctrine-migrations-provider)[ Packagist](https://packagist.org/packages/kurl/silex-doctrine-migrations-provider)[ RSS](/packages/kurl-silex-doctrine-migrations-provider/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (9)Versions (13)Used By (1)

silex-doctrine-migrations-provider
==================================

[](#silex-doctrine-migrations-provider)

A doctrine migrations service provider for Silex 2.x or Pimple 3.x.

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

[](#installation)

Install the provider through Composer:

```
composer require kurl/silex-doctrine-migrations-provider
```

Usage
-----

[](#usage)

### Parameters

[](#parameters)

These are the configuration parameters you could configure for the provider:

- `migrations.directory`: The directory with migrations. Required.
- `migrations.namespace`: The namespace for the migration classes. Required.
- `migrations.name`: The name of the migrations suite. Defaults to "Migrations".
- `migrations.table_name`: The database migrations table. Defaults to `migration_versions`.

### Services

[](#services)

The service provider registers the following services which you could use:

- `migrations.em_helper_set`: The Doctrine ORM Entity Manager helper set. It would be registered if you have registered the `orm.em` service supposedly from the `DoctrineServiceProvider.
- `migrations.commands`: An array of Symfony command instances. You could use them to add to your own Console application.

There are also a few other services which the provider uses internally and they are exposed so you could extend or override them with the lazy loading of Pimple:

- `migrations.output_writer`: `Doctrine\DBAL\Migrations\OutputWriter` instance used in the Doctrine migrations configuration.
- `migrations.configuration`: `Doctrine\DBAL\Migrations\Configuration\Configuration` instance used in the console commands.
- `migrations.command_names`: Array of command names. You could add your own here to be lazy loaded into `migrations.commands`.

You can register the provider and configure it like so:

```
