In the Drush Configuration section of the official documentation it is said:
drush.yml files are discovered as below, in order of precedence:
- Drupal site folder (e.g. sites/{example.com}/drush.yml).
- sites/all/drush, WEBROOT/drush, or PROJECTROOT/drush.
- ...
There you can see "WEBROOT" and "PROJECTROOT", but there's no explanation on what they are. In the Drush code there's no mention either apart from the configuration itself:
$ grep PROJECTROOT * -r
drush/docs/using-drush-configuration.md:2. `sites/all/drush`, `WEBROOT/drush`, or `PROJECTROOT/drush`.
$ grep WEBROOT * -r
drush/docs/using-drush-configuration.md:2. `sites/all/drush`, `WEBROOT/drush`, or `PROJECTROOT/drush`.
How Drush determines the values of PROJECTROOT and WEBROOT?
The questions is what those names means, but how Drush decide what they are. If they are used to search for different configuration files it means that Drush resolved those names to actual folders or paths in the current system. How Drush resolves them?
My guess is that Drush takes the root folder of the site (defined ion the Drush alias. If that folder is a Drupal root then WEBROOT and PROJECTROOT are the same, the defined root folder. If the configured root folder has a composer.json
and a web
folder then PROJECTROOT is the confiugred root path, and the web
folder is the WEBROOT... but it is just a guess.