public function PathLocator::getProjectRoot in Automatic Updates 8.2
Returns the absolute path of the project root.
This is where the project-level composer.json should normally be found, and may or may not be the same path as the Drupal code base.
Return value
string The absolute path of the project root.
2 calls to PathLocator::getProjectRoot()
- PathLocator::getActiveDirectory in src/
PathLocator.php - Returns the path of the active directory, which should be updated.
- PathLocator::getWebRoot in src/
PathLocator.php - Returns the path of the Drupal installation, relative to the project root.
File
- src/
PathLocator.php, line 78
Class
- PathLocator
- Computes file system paths that are needed for automatic updates.
Namespace
Drupal\automatic_updatesCode
public function getProjectRoot() : string {
// Assume that the vendor directory is immediately below the project root.
return realpath($this
->getVendorDirectory() . DIRECTORY_SEPARATOR . '..');
}