【发布时间】:2017-11-04 00:17:35
【问题描述】:
我们正在尝试使用 composer 来处理 wordpress 网站的依赖关系。我想将 wordpress 本身包含在这些依赖项中。我正在尝试将 wordpress 安装到项目的根目录。所有其他插件等都根据安装程序路径正确安装..
我尝试过使用 fancyguy/webroot-installer,但这会擦除安装包的目录 还尝试了 mnsami/composer-custom-directory-installer,但这也会擦除目录。
我在根目录中有一些我不想删除的文件 - 例如 composer.json 一个,.tfignore 等等。
是我必须让它安装到 /vendor 然后运行安装后脚本将其移动到我想要的位置的唯一选择吗?还是我缺少另一个选项
这是我为 webroot-installer 尝试过的一个
{
"name": "the/name",
"description": "description",
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
},
{
"type": "package",
"package": {
"name": "wordpress",
"type": "webroot",
"version": "4.7.5",
"dist": {
"type": "zip",
"url": "https://github.com/WordPress/WordPress/archive/4.7.5.zip"
},
"require": {
"fancyguy/webroot-installer": "1.0.0"
}
}
}
],
"require-dev": {
"wpackagist-plugin/query-monitor": "2.13.4",
"wordpress": "4.7.5",
"fancyguy/webroot-installer": "1.0.0"
},
"require": {
"wpackagist-plugin/advanced-custom-fields": "4.4.11",
...etc
},
"extra": {
"webroot-dir": ".",
"webroot-package": "wordpress",
"installer-paths": {
"library/plugins/{$name}": [ "type:wordpress-plugin" ]
}
},
"scripts": { ...}
}
这是使用 composer-custom-directory-installer 的 composer.json。
{
"name": "the/name",
"description": "description",
"repositories": [
{
"type": "composer",
"url": "https://wpackagist.org"
},
{
"type": "package",
"package": {
"name": "wordpress",
"type": "library",
"version": "4.7.5",
"dist": {
"type": "zip",
"url": "https://github.com/WordPress/WordPress/archive/4.7.5.zip"
}
}
}
],
"require-dev": {
"mnsami/composer-custom-directory-installer": "1.1.*",
"wordpress": "4.7.5"
},
"require": {
"wpackagist-plugin/advanced-custom-fields": "4.4.11",
...etc
},
"extra": {
"installer-paths": {
"library/plugins/{$name}": [ "type:wordpress-plugin" ],
"./": [ "wordpress" ]
}
},
"scripts": { ... }
}
【问题讨论】: