Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imi v3.0 开发计划 #589

Open
24 of 42 tasks
Yurunsoft opened this issue Oct 13, 2023 · 1 comment
Open
24 of 42 tasks

imi v3.0 开发计划 #589

Yurunsoft opened this issue Oct 13, 2023 · 1 comment
Assignees
Labels
3.0 Plan version 3.0
Milestone

Comments

@Yurunsoft
Copy link
Member

Yurunsoft commented Oct 13, 2023

imi v2.1 是一个优秀的版本,经受住了众多项目实际生产环境的考验,已经十分可靠。

imi v3.0 正式提上日程,主要是升级依赖版本和解决一些旧版本中的设计问题,并且适当引入一些新特性。

开发的同时,v2.1 也会继续开发和支持,imi 的版本支持计划详见:https://doc.imiphp.com/v2.1/base/version/support.html

imi v3.0 开发分支:3.0,提 PR 请选择这个分支!

文档:https://doc.imiphp.com/v3.0/

升级

新特性

改进

更改默认行为

废弃

以上不代表最终变动内容,还有一些想法需要仔细考虑后再贴上来。
需求列表随时会有改动,也欢迎大家提出更多好的想法~

@Yurunsoft Yurunsoft added the 3.0 Plan version 3.0 label Oct 13, 2023
@Yurunsoft Yurunsoft pinned this issue Oct 13, 2023
@NHZEX
Copy link
Member

NHZEX commented Oct 14, 2023

关于模型生成命令配置的一个建议,定义起来比较灵活:
ps: 主要出发角度是老表和老架构迁移,能更灵活规划。

// 模型生成路径自动使用 Psr4 规范映射,确保命名空间都已经声明

return [
    // 映射时默认继承基类
    'baseClass'      => \app\Model\Base::class,
    // 映射时默认命名空间
    'baseNamespace'  => 'app\\Model',
    // 映射时的默认连接,空表示使用db配置指定
    'defaultConnect' => null,
    // 生成文件是否使用严格类型
    'strictTypes'    => true,

    'exclude' => [
        '_phinxlog',
    ],

    // 单个模型绑定跟踪
    'single' => [
        [
            'table' => 'activity_log',
            'class' => \app\Service\Auth\Record\RecordModel::class,
        ],
    ],

    // 批量模型绑定跟踪
    'mapping' => [
        [
            // 匹配指定表
            'table'     => [
                'admin_*',
                'user_role_*',
            ],
            'namespace' => 'app\\Model\\Admin',
        ],
        [
            // 匹配指定表,空代表任意表
            'table'     => null,
            // 模型映射关联的连接
            'connect'   => 'cat',
            // 模型映射使用的命名空间
            'namespace' => 'app\\CatApp\\Model',
            // 模型映射指定继承基类
            'baseClass' => \app\CatApp\Model\CatBase::class,
        ],
    ],
];

@Yurunsoft Yurunsoft added this to the 3.0.0 milestone Oct 31, 2023
@Yurunsoft Yurunsoft self-assigned this Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 Plan version 3.0
Projects
None yet
Development

No branches or pull requests

2 participants