function drush_is_nested_directory

8.0.x filesystem.inc drush_is_nested_directory($base_dir, $test_is_nested)
master filesystem.inc drush_is_nested_directory($base_dir, $test_is_nested)

Return 'TRUE' if one directory is located anywhere inside the other.

Related topics

1 call to drush_is_nested_directory()
drush_preflight_command_dispatch in includes/preflight.inc
Handle any command preprocessing that may need to be done, including potentially redispatching the command immediately (e.g. for remote commands).

File

includes/filesystem.inc, line 741
Filesystem utilities.

Code

function drush_is_nested_directory($base_dir, $test_is_nested) {
  $common = Path::getLongestCommonBasePath([$test_is_nested $base_dir]);
  return $common == Path::canonicalize($base_dir);
}