maduser/argon-phinx 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

maduser/argon-phinx

Composer 安装命令:

composer require maduser/argon-phinx

包简介

Phinx migration integration for the Argon runtime stack.

README 文档

README

PHP Build codecov Psalm Level Latest Version Total Downloads License: MIT

Phinx migration integration for the Argon runtime stack.

Installation

composer require maduser/argon-phinx

Service Providers

Register 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.

Console Commands

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 CreateUsers

The command names are prefixed to avoid collisions with application commands.

Boundaries

  • 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.

Quality Gates

composer check
composer test:coverage
composer psalm
composer phpcs

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固