Download the PHP package kurl/silex-doctrine-migrations-provider without Composer
On this page you can find all versions of the php package kurl/silex-doctrine-migrations-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kurl/silex-doctrine-migrations-provider
More information about kurl/silex-doctrine-migrations-provider
Files in kurl/silex-doctrine-migrations-provider
Package silex-doctrine-migrations-provider
Short Description A doctrine migrations provider for silex
License MIT
Informations about the package silex-doctrine-migrations-provider
silex-doctrine-migrations-provider
A doctrine migrations service provider for Silex 2.x or Pimple 3.x.
Installation
Install the provider through Composer:
Usage
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 tomigration_versions
.
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 theorm.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 intomigrations.commands
.
You can register the provider and configure it like so:
Silex
You can pass an optional instance of Symfony\Component\Console\Application
to the constructor of the provider. Alternatively you can set the instance of your Console application to $app['console']
. If the provider can find the Console application instance it is able to register the commands and helper set for you.
The provider implements `Silex\Api\BootableProviderInterface, so if you use the provider with Silex, booting the application would register the commands for you:
Pimple
If you use the provider with Pimple without using Silex, then you'd need to register the helper set and the commands to your Console application yourself. This is made very easy by the provider as it already registered all the needed services:
Code coverage reports
That was it!
All versions of silex-doctrine-migrations-provider with dependencies
doctrine/dbal Version ^2.2
pimple/pimple Version ^3.0
silex/api Version ^2.0
doctrine/migrations Version ^1.5
symfony/console Version ^2.3 | ^3.0
symfony/http-foundation Version 3.4.35