承接 kalider/phinx-tenant 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kalider/phinx-tenant

最新稳定版本:v0.1.0

Composer 安装命令:

composer require kalider/phinx-tenant

包简介

README 文档

README

This project is a multi-tenant implementation using the Phinx library for database migrations.

Installation

To install the library, use Composer:

composer require kalider/phinx-tenant

Usage

Configuration

Create a phinx-tenant.php configuration file in the root of your project:

return [
    'type' => 'database', // database, array
    // if database type
    'database' => [
        'connection' => [
            'adapter' => 'mysql',
            'host' => 'localhost',
            'name' => 'multi_tenant_db',
            'user' => 'root',
            'pass' => 'kudabelang',
        ],
        'table' => 'tenants',
        'fields' => [
            'host' => 'host',
            'name' => 'name',
            'user' => 'user',
            'pass' => 'pass',
        ],
        // if wheres condition 
        'conditions' => [
            'status' => 1
        ]
    ],
    // if array type
    'tenants' => [
        [
            'host' => 'localhost',
            'name' => 'tenant1',
            'user' => 'root',
            'pass' => 'root',
        ],
    ]
];

Running Migrations

To run migrations for a specific tenant, use the following command:

php vendor/bin/phinx-tenant migrate

# different phinx config
php vendor/bin/phinx-tenant migrate -c phinx-master.php

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

Contact

For any questions or inquiries, please contact new.m.tah@gmail.com.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-01-15