yuncms/composer

该包已被废弃且不再维护。未建议替代包。

yuncms模块安装器的Composer插件

安装次数: 2,446

依赖者: 1

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 0

开放性问题: 0

类型:composer-plugin

2.0.1 2018-04-28 10:39 UTC

This package is auto-updated.

Last update: 2022-07-09 17:21:30 UTC


README

68747470733a2f2f676574636f6d706f7365722e6f72672f696d672f6c6f676f2d636f6d706f7365722d7472616e73706172656e74332e706e67

YUNCMS Composer Installer


这是YUNCMS模块的Composer安装器。它实现了一个名为yii2-extension的新Composer包类型,如果所有Yii 2扩展作为Composer包分发,则应使用此类型。

有关许可证信息,请查看LICENSE文件。

Latest Stable Version Total Downloads

使用方法

当通过Composer安装框架时,Yii 2 Composer安装器会自动安装。

要使用Yii 2 composer安装器,只需在您的composer.json中将包的type设置为yii2-extension,如下所示

{
    "type": "yii2-extension",
    "require": {
        "yiisoft/yii2": "~2.0.0"
    },
    ...
}

您可以在extra部分指定引导类。每次Yii 2应用响应请求时,都会执行类的init()方法。例如

{
    "type": "yii2-extension",
    ...,
    "extra": {
        "yuncms": {
            "id": "framework",
            "migrationPath": "@vendor/yuncms/framework/migrations"
        }
    }
}

{
    "type": "yii2-extension",
    ...,
    "extra": {
        "yuncms": "mainfest.php"
    }
}

manifest.php

return [
    'id'=> 'user',
    'migrationPath'=> '@vendor/....',
    'events'=> [
    [etc],
        [etc1]
    ],
    'tasks'=> [
        [etc],
        [etc1]
    ],
    'translations'=> [
        'yuncms/user'=> [
            'class' => 'yii\i18n\PhpMessageSource',
            //'basePath' => '@app/messages',
            'sourceLanguage' => 'en-US',
            'fileMap' => [
                'app' => 'app.php',
                'app/error' => 'error.php',
            ],
        ]
    ],
    'frontend'=> [
        'class=>'',
        'etc'
    ],
    'backend'=> [
        'class=>'',
    ],
];