Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devture/pimple-provider-phinx-migrations
A Pimple Service Provider which provides database migrations console commands, powered by Phinx
https://github.com/devture/pimple-provider-phinx-migrations
Last synced: 13 days ago
JSON representation
A Pimple Service Provider which provides database migrations console commands, powered by Phinx
- Host: GitHub
- URL: https://github.com/devture/pimple-provider-phinx-migrations
- Owner: devture
- License: bsd-3-clause
- Created: 2022-12-17T11:15:40.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-17T11:40:19.000Z (almost 2 years ago)
- Last Synced: 2024-05-12T14:44:14.846Z (6 months ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Database Migrations services wrapped in a Pimple Service Provider
This is a [Pimple](https://github.com/silexphp/Pimple) Service Provider which provides database migrations console commands, powered by [Phinx](https://phinx.org/).
## Configuration
```php
$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
```php
$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();
```