1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 16:40:05 +01:00

fix open for symlinks

This commit is contained in:
Taylor Otwell
2016-05-12 21:24:28 -05:00
parent 399de8bfff
commit 62ba72a77a
2 changed files with 26 additions and 11 deletions

View File

@@ -22,6 +22,23 @@ function __construct(Configuration $config, CommandLine $cli, Filesystem $files)
$this->config = $config;
}
/**
* Get the real hostname for the given path, checking links.
*
* @param string $path
* @return string|null
*/
function hostForDirectory($path)
{
foreach ($this->files->scandir($this->sitesPath()) as $link) {
if ($resolved = realpath($this->sitesPath().'/'.$link) == $path) {
return $link;
}
}
return basename($path);
}
/**
* Link the current working directory with the given name.
*