function _drush_shift_path_up

8.0.x environment.inc _drush_shift_path_up($path)
6.x environment.inc _drush_shift_path_up($path)
7.x environment.inc _drush_shift_path_up($path)
3.x environment.inc _drush_shift_path_up($path)
4.x environment.inc _drush_shift_path_up($path)
5.x environment.inc _drush_shift_path_up($path)
master environment.inc _drush_shift_path_up($path)

Returns parent directory.

Parameters

string: Path to start from.

Return value

string Parent path of given path.

2 calls to _drush_shift_path_up()
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.

File

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

Code

function _drush_shift_path_up($path) {
  if (empty($path)) {
    return FALSE;
  }
  $path = explode('/', $path);
  // Move one directory up.
  array_pop($path);
  return implode('/', $path);
}