ec-cube2 / plugin-installer
EC-CUBE2 插件/模块安装器,用于 Composer。
1.1.0
2020-10-26 02:20 UTC
Requires
- php: >=5.3.3
- composer-plugin-api: ^1.0|^2.0
- composer/installers: ^1.0
Requires (Dev)
- composer/composer: ^1.0|^2.0
README
使 EC-CUBE2 的插件/模块/模板可以通过 Composer 进行管理。
注意:实际安装 EC-CUBE2 等操作已分离。请使用 ec-cube2/cli
。
安装/使用
1. 执行命令。
例如:安装 ExamplePlugin ( ec-cube2-plugin/example_plugin
)
请按照以下方式执行命令。
当然,也可以指定插件版本。
$ composer require ec-cube2-plugin/example_plugin
当然,也可以像常规 Composer 一样直接指定 GitHub 等外部仓库。
请参阅 Composer 的文档。
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/ec-cube2-plugin/example_plugin"
}
],
"require": {
"ec-cube2-plugin/example_plugin": "dev-master"
}
}
更改要安装的路径
{
"extra": {
"installer-paths": {
"data/downloads/plugin/{$name}/": ["type:eccube2-plugin"],
"data/downloads/module/{$name}/": ["type:eccube2-module"],
"data/Smarty/templates/{$name}/": ["type:eccube2-template"]
}
}
}
2. 执行 Composer 命令。
$ composer install --no-dev
3. 完成。
就这么简单。
composer.json
插件
请按照以下方式准备。如果要在 Packagist 上注册,则需要指定 ec-cube2-plugin
的专属命名空间。
example_plugin
部分需要使用小写指定。安装时将转换为 ExamplePlugin 的驼峰式。
{
"name": "ec-cube2-plugin/example_plugin",
"description": "サンプルプラグイン",
"type": "eccube2-plugin",
"license": "LGPL",
"homepage": "http://www.example.com/",
"require": {
"ec-cube2/plugin-installer": "^1.0"
}
}
模块
请按照以下方式准备。如果要在 Packagist 上注册,则需要指定 ec-cube2-module
的专属命名空间。
mdl_example
部分是模块的代码。需要与其他模块的代码不重复。
注意:通过所有者商店导入的模块与相同名称的模块安装可能会影响操作。
{
"name": "ec-cube2-module/mdl_example",
"description": "サンプルモジュール",
"type": "eccube2-module",
"license": "LGPL",
"homepage": "http://www.example.com/",
"require": {
"ec-cube2/plugin-installer": "^1.0"
}
}
模板
请按照以下方式准备。如果要在 Packagist 上注册,则需要指定 ec-cube-plugin
的专属命名空间。
sample
部分是模板的代码。需要与其他模板的代码不重复。
{
"name": "ec-cube2-template/sample",
"description": "サンプルテンプレート",
"type": "eccube2-template",
"license": "LGPL",
"homepage": "http://www.example.com/",
"require": {
"ec-cube2/plugin-installer": "^1.0"
}
}
需求
PHP 5.3.3 以上