function Filesystem::relativeSymlink
Creates a relative symlink from $link to $target
Parameters
string $target The path of the binary file to be symlinked:
string $link The path where the symlink should be created:
Return value
bool
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ Filesystem.php, line 761
Class
- Filesystem
- @author Jordi Boggiano <j.boggiano@seld.be> @author Johannes M. Schmitt <schmittjoh@gmail.com>
Namespace
Composer\UtilCode
public function relativeSymlink(string $target, string $link) {
if (!function_exists('symlink')) {
return false;
}
$cwd = Platform::getCwd();
$relativePath = $this->findShortestPath($link, $target);
chdir(\dirname($link));
$result = @symlink($relativePath, $link);
chdir($cwd);
return $result;
}