Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DrupalFinder.php

function DrupalFinder::getDrupalRoot

Get the Drupal root.

Return value

string|bool The path to the Drupal root, if it was discovered. False otherwise.

2 calls to DrupalFinder::getDrupalRoot()
DrupalFinder::allPathsKnown in vendor/webflo/drupal-finder/src/DrupalFinder.php
Helper function to quickly determine whether or not all paths are known.
DrupalFinder::locateRoot in vendor/webflo/drupal-finder/src/DrupalFinder.php
Locate Drupal, Composer, and vendor directory paths.

File

vendor/webflo/drupal-finder/src/DrupalFinder.php, line 106

Class

DrupalFinder

Namespace

DrupalFinder

Code

public function getDrupalRoot() {
    $environment_path = $this->getValidEnvironmentVariablePath(self::ENV_DRUPAL_ROOT);
    return !empty($environment_path) ? $environment_path : $this->drupalRoot;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal