function drush_is_nested_directory

8.0.x drush_is_nested_directory($base_dir, $test_is_nested)
master 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/
Handle any command preprocessing that may need to be done, including potentially redispatching the command immediately (e.g. for remote commands).


includes/, line 735
Filesystem utilities.


function drush_is_nested_directory($base_dir, $test_is_nested) {
  // Ensure there is always exactly one '/' at the end of $base_dir
  $base_dir = rtrim($base_dir, '/') . '/';
  return substr($test_is_nested, 0, strlen($base_dir)) == $base_dir;