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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user