function drush_valid_root

8.0.x environment.inc drush_valid_root($path)
7.x environment.inc drush_valid_root($path)
master environment.inc drush_valid_root($root)

Checks whether given path qualifies as a Drupal root.

Parameters

string: Path to check.

Return value

string The relative path to common.inc (varies by Drupal version), or FALSE if not a Drupal root.

5 calls to drush_valid_root()
DrupalBoot::bootstrap_drupal_root_validate in lib/Drush/Boot/DrupalBoot.php
Validate the DRUSH_BOOTSTRAP_DRUPAL_ROOT phase.
drush_locate_root in includes/environment.inc
Exhaustive depth-first search to try and locate the Drupal root directory. This makes it possible to run Drush from a subdirectory of the drupal root.
drush_site_path in includes/environment.inc
Like Drupal conf_path, but searching from beneath. Allows proper site uri detection in site sub-directories.
_drush_find_local_sites_at_root in includes/sitealias.inc
Return a list of all of the local sites at the specified drupal root.
_drush_sitealias_get_record in includes/sitealias.inc
This is a continuation of drush_sitealias_get_record, above. It is not intended to be called directly.

File

includes/environment.inc, line 360
Functions used by drush to query the environment and setting the current configuration.

Code

function drush_valid_root($path) {
  $bootstrap_class = drush_bootstrap_class_for_root($path);
  return $bootstrap_class != NULL;
}