Phinx migration integration for the Argon runtime stack.
composer require maduser/argon-phinxRegister PhinxServiceProvider, then configure migrations from an application service provider.
use Maduser\Argon\Container\AbstractServiceProvider;
use Maduser\Argon\Container\ArgonContainer;
use Maduser\Argon\Phinx\Config\PhinxConfigRegistry;
use Maduser\Argon\Phinx\Provider\PhinxServiceProvider;
final class AppServiceProvider extends AbstractServiceProvider
{
#[\Override]
public function register(ArgonContainer $container): void
{
$container->register(PhinxServiceProvider::class);
$container->register(MigrationServiceProvider::class);
}
}
final class MigrationServiceProvider extends AbstractServiceProvider
{
#[\Override]
public function register(ArgonContainer $container): void
{
$basePath = $container->getParameters()->get('basePath');
assert(is_string($basePath));
$container->get(PhinxConfigRegistry::class)
->addMigrationPath($basePath . '/database/migrations')
->addEnvironment('default', [
'adapter' => 'sqlite',
'name' => $basePath . '/storage/database/argon.sqlite',
'suffix' => '',
])
->setDefaultEnvironment('default');
}
}For SQLite, Phinx appends .sqlite3 by default. Use 'suffix' => '' when the configured name is already the full database file path.
The provider exposes Phinx through the Argon console command tag:
php bin/console phinx:status
php bin/console phinx:migrate
php bin/console phinx:rollback
php bin/console phinx:create CreateUsersThe command names are prefixed to avoid collisions with application commands.
- This package wires Phinx into Argon. It does not add a migration DSL.
- Applications own migration paths, seed paths, environments, and database credentials.
- Configuration is explicit service-provider code, not automatic file discovery.
- Multiple environments are supported through Phinx configuration arrays.
composer check
composer test:coverage
composer psalm
composer phpcs