We are trying to use composer to deal with dependencies for a wordpress site. I would like to include wordpress itself in these dependencies. I am trying to install wordpress to the root of the project. all the other plugins etc are installing correctly based on the installer-paths..
I have tried using fancyguy/webroot-installer, but that wipes the directory that the package is installed to also tried mnsami/composer-custom-directory-installer, but that also wipes the directory.
I have a number of files in the root which i do not want to delete - such as the composer.json for one, .tfignore and suchlike.
is the only option I have to let it install to /vendor and then run a post-install script to move it where I want it? or is there another option I am missing
here is the one i tried for 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": { ...}
}
here is the composer.json using composer-custom-directory-installer.
{
"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": { ... }
}