function UnishTestCase::convert_path

8.0.x UnishTestCase.php UnishTestCase::convert_path($path)
7.x UnishTestCase.php UnishTestCase::convert_path($path)
master UnishTestCase.php UnishTestCase::convert_path($path)

Converts a Windows path (dir1\dir2\dir3) into a Unix path (dir1/dir2/dir3). Also converts a cygwin "drive emulation" path (/cygdrive/c/dir1) into a proper drive path, still with Unix slashes (c:/dir1).

@copied from Drush's environment.inc

1 call to UnishTestCase::convert_path()
contextCase::setUp in tests/contextTest.php
Try to write a tiny drushrc.php to each place that Drush checks. Also write a sites/dev/aliases.drushrc.php file to the sandbox.

File

tests/Unish/UnishTestCase.php, line 130

Namespace

Unish

Class

UnishTestCase

Code

function convert_path($path) {
  $path = str_replace('\\', '/', $path);
  $path = preg_replace('/^\/cygdrive\/([A-Za-z])(.*)$/', '\1:\2', $path);

  return $path;
}