Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Filesystem.php

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\Util

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal