PHP code example of devture / pimple-provider-phinx-migrations

1. Go to this page and download the library: Download devture/pimple-provider-phinx-migrations library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

devture / pimple-provider-phinx-migrations example snippets


$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',
	],
];

$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();