function _drush_core_directory

8.0.x core.drush.inc _drush_core_directory($target = 'root', $component = 'path', $local_only = FALSE)
6.x core.drush.inc _drush_core_directory($target = 'root', $component = 'path', $local_only = FALSE)
7.x core.drush.inc _drush_core_directory($target = 'root', $component = 'path', $local_only = FALSE)
3.x core.drush.inc _drush_core_directory($target = 'root')
4.x core.drush.inc _drush_core_directory($target = 'root', $component = 'path', $local_only = FALSE)
5.x core.drush.inc _drush_core_directory($target = 'root', $component = 'path', $local_only = FALSE)
master core.drush.inc _drush_core_directory($target = 'root', $component = 'path', $local_only = FALSE)
1 call to _drush_core_directory()

File

commands/core/core.drush.inc, line 685
Core drush commands.

Code

function _drush_core_directory($target = 'root') {
  // Normalize to a sitealias in the target.
  $normalized_target = $target;
  if (strpos($target, ':') === FALSE) {
    if (substr($target, 0, 1) == '@') {
      $normalized_target = $target; // . ':%site';
    }
    else {
      // @self makes no sense before 'site' level.
      if (!drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE)) {
        return FALSE;
      }
      $normalized_target = '@self:';
      if (substr($target, 0, 1) != '%') {
        $normalized_target .= '%';
      }
      $normalized_target .= $target;
    }
  }

  $additional_options = array();
  $values = drush_sitealias_evaluate_path($normalized_target, $additional_options);

  if (isset($values['path'])) {
    // Hurray, we found the destination
    return $values['path'];
  }
  return NULL;
}