function drush_valid_drupal_root

6.x environment.inc drush_valid_drupal_root($path)
3.x environment.inc drush_valid_drupal_root($path)
4.x environment.inc drush_valid_drupal_root($path)
5.x environment.inc drush_valid_drupal_root($path)

Checks whether given path qualifies as a Drupal root.

Parameters

string: Path to check.

Return value

boolean True if given path seems to be a Drupal root, otherwise FALSE.

4 calls to drush_valid_drupal_root()
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_bootstrap_drupal_root_validate in includes/environment.inc
Validate the DRUSH_BOOTSTRAP_DRUPAL_ROOT phase.
_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 1180
Functions used by drush to query the environment and setting the current configuration.

Code

function drush_valid_drupal_root($path) {
  return !empty($path) && is_dir($path) && file_exists($path . '/' . DRUSH_DRUPAL_BOOTSTRAP);
}