Skip to content

A Pimple Service Provider which provides database migrations console commands, powered by Phinx

License

Notifications You must be signed in to change notification settings

devture/pimple-provider-phinx-migrations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Database Migrations services wrapped in a Pimple Service Provider

This is a Pimple Service Provider which provides database migrations console commands, powered by Phinx.

Configuration

$dbMigrationsConfig = [
	'environments' => [
		'default_database' => 'development',
		'development' => [
			'adapter' => 'mysql',
			'charset'=> 'utf8',
			'collation' => 'utf8_general_ci',
			'uri' => 'username:password@localhost/db_name',
		],
		'paths' => [
			'migrations' => 'migrations',
		],
		'migrations_base_path' => '/path/to/migrations-directory-parent',
	],
];

Usage

$container = new \Pimple\Container();

$container['console'] = function () use ($container) {
	$console = new \Symfony\Component\Console\Application();

	// Register some other console commands here

	// Register the services provided by this service provider
	$container->register(new \Devture\PimpleProvider\PhinxMigrations\ServiceProvider($dbMigrationsConfig));

	// Attach the console commands provided by this service provider with this console instance
	$container['devture_phinx_migrations.attach_commands_to_console']($console);

	return $console;
};

$container['console']->run();

About

A Pimple Service Provider which provides database migrations console commands, powered by Phinx

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages