yuncms / composer
该包已被废弃且不再维护。未建议替代包。
yuncms模块安装器的Composer插件
2.0.1
2018-04-28 10:39 UTC
Requires
- composer-plugin-api: ^1.0
Requires (Dev)
- composer/composer: ^1.0
This package is auto-updated.
Last update: 2022-07-09 17:21:30 UTC
README
YUNCMS Composer Installer
这是YUNCMS模块的Composer安装器。它实现了一个名为yii2-extension
的新Composer包类型,如果所有Yii 2扩展作为Composer包分发,则应使用此类型。
有关许可证信息,请查看LICENSE文件。
使用方法
当通过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=>'', ], ];