After doing this successfully I pulled in Wordpress core using composer install which generated the foloowing output:
PS C:\Users\Justin\Documents\Sites\test.com\site> composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update
Package operations: 8 installs, 0 updates, 0 removals
- Installing johnpbloch/wordpress-core-installer (184.108.40.206): Loading from cache
- Installing composer/installers (v1.5.0): Loading from cache
- Installing johnpbloch/wordpress-core (4.9.4): Loading from cache
- Installing johnpbloch/wordpress (4.9.4): Loading from cache
- Installing oscarotero/env (v1.1.0): Loading from cache
- Installing roots/wp-password-bcrypt (1.0.0): Loading from cache
- Installing vlucas/phpdotenv (v2.4.0): Loading from cache
- Installing squizlabs/php_codesniffer (3.2.2): Loading from cache
Generating autoload files
The question is, what is the difference between running composer create-project roots/bedrock and composer install?
It seems that both pull in wordpress core files but composer create-project roots/bedrock installs roots bedrock and pulls in a “.env” file and composer install does not install roots/bedrock and pulls in additional files.
Which method should I use to set up the initial recommended folder structure?
Are you using Trellis for local development? Because if you are, when you run vagrant up it installs Bedrock including creation of .env based on the variables you set in Trellis’ group_vars. Following the Trellis docs verbatim will get you what you want:
If you are using Bedrock on its own, using composer create-project is what the docs recommend:
Also, like you described, running composer create-project will create an .env file from the example one:
In the case of installing Bedrock without Trellis, you’ll need to update the .env with the correct variables for the environment.
No, vagrant up is only used for the initial local dev server setup and for spinning up existing Trellis boxes. Trellis uses Vagrant locally to setup a virtual machine and then, on the VM, Ansible provisions it and sets up application — which includes installings the composer dependencies for Bedrock (i.e. WordPress). For remote environments (staging/productions) it’s a bit different, but there is a guide in the docs:
And since you are on Windows — which Ansible does not support — you will need to follow the Windows docs for this as well. It involves running the Ansible commands from the VM (Ubuntu).
Also, I would really recommend you read @swalkinshaw’s series of blog posts regarding some of the philosophy behind the Roots ecosystem. I’m sure it will be enlightening.
Send me a DM if you would like further clarification. I would be glad to help.