function drush_valid_root

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

Checks whether given path qualifies as a Drupal root.


string: Path to check.

Return value

string The relative path to (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
drush_locate_root in includes/
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/
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/
Return a list of all of the local sites at the specified drupal root.
_drush_sitealias_get_record in includes/
This is a continuation of drush_sitealias_get_record, above. It is not intended to be called directly.


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


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