function _drush_shift_path_up

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

Returns parent directory.


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/
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.


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


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