So I recently started to use Composer with WordPress based on this tutorial.
This is my composer.json
file:
{
"repositories": [
{
"type": "package",
"package": {
"name": "wordpress",
"type": "webroot",
"version": "4.3",
"dist": {
"type": "zip",
"url": "https://github.com/WordPress/WordPress/archive/4.3.zip"
},
"require" : {
"fancyguy/webroot-installer": "1.0.0"
}
}
}
],
"require": {
"wordpress": "4.*",
"fancyguy/webroot-installer": "1.0.0"
},
"extra": {
"webroot-dir": "public/wp",
"webroot-package": "wordpress"
}
}
It worked fine, I got this folder structure:
As it was mentioned in the tutorial, I copied index.php
, wp-config.php
and the wp-content
directory outside the wp
directory and replaced the paths.
Everything worked perfect until this point:
Regarding housekeeping with your source code management tool. You’d want to ignore the composer.phar file and public/wp directory. Everything else can be committed and pushed.
So it seems like that besides the public/wp
folder, everything can be committed and pushed. (including wp-content folder)
Here is the thing that I don't understand. We must commit/push the wp-content
directory because it has a different location that it use to have, but in the same time this wp-content
folder contains the plugins
and themes
folder in which our plugins and themes will be added using composer which should not be committed/pushed right ?.
The plugins and themes will be added on the development enviroment also using composer, so we must not commit them, but they are in the wp-content
directory which should be committed ?
In another similar tutorial the wp-content
is set into the .gitignore
file, meaning that it should not be commited/pushed. But If it's like this, who will move (and how) the wp-content
outside wp
directory on the development enviroment.
Can somebody clarify this aspect please?