Create the symlink.

@param string $symlinkTarget The Target
@param string $symlinkName The Name

@throws \Exception
195416
public static function createSymlink($symlinkTarget, $symlinkName)
    {
        if (false === @symlink($symlinkTarget, $symlinkName)) {
            throw new \Exception("An error occurred while creating symlink" . $symlinkName);
        }
        if (false === $target = readlink($symlinkName)) {
            throw new \Exception("Symlink $symlinkName points to target $target");
        }
    }
172935
public function addTarget(Target $target, string $name = null)
    {
        if ($name === null) {
            $this->_targets[] = $target;
        } else {
            $this->_targets[$name] = $target;
        }
    }
927752
def symlink(target, link):
    
    if islink(link):
        unlink(link)
    if platform.system() == "Windows":
        if sys.version_info[:2] < (3, 5):
            with open(os.devnull, "w") as nul:
                subprocess.check_call(["mklink", "/J", link, target], shell=True, stdout=nul)
        else:
            _winapi.CreateJunction(target, link)
    else:
        os.symlink(target, link)
1315331
def symlink_to(self, target, target_is_directory=False):
        
        self._accessor.symlink(target, self, target_is_directory)
955787
@Override
    public ComponentBuilder addSymbolicLink(String target, String linkTarget) throws IOException
    {
        checkTarget(target);
        checkTarget(linkTarget);
        FileBuilder fb = new FileBuilder(target, linkTarget);
        fileBuilders.add(fb);
        return fb;
    }
62888
function symlinkAsUser($target, $link)
    {
        if ($this->exists($link)) {
            $this->unlink($link);
        }

        CommandLineFacade::runAsUser('ln -s '.escapeshellarg($target).' '.escapeshellarg($link));
    }
289385
protected static function createLink( $source, $target )
	{
		if( file_exists( $target ) === false && @symlink( $source, $target ) === false )
		{
			$source = realpath( __DIR__ . '/' . $source );

			if( symlink( $source, $target ) === false ) {
				throw new \RuntimeException( sprintf( 'Failed to create symlink for "%1$s" to "%2$s"', $source, $target ) );
			}
		}
	}
320638
protected function _createSymlink($target, $link)
    {
        // @codingStandardsIgnoreStart
        $result = @symlink($target, $link);
        // @codingStandardsIgnoreEnd

        if ($result) {
            $this->out('Created symlink ' . $link);

            return true;
        }

        return false;
    }
315065
public function link($target, $link)
    {
        if (! windows_os()) {
            return symlink($target, $link);
        }

        $mode = $this->isDirectory($target) ? 'J' : 'H';

        exec("mklink /{$mode} \"{$link}\" \"{$target}\"");
    }
593465
protected function symlinkCE($source, $targetDir, $name) {
		return (!$this->encoding)? $this->_symlink($source, $targetDir, $name) : $this->convEncOut($this->_symlink($this->convEncIn($source), $this->convEncIn($targetDir), $this->convEncIn($name)));
	}
63682
def symlink(self, source, target):
        ''

        return self.operations('symlink', target.decode(self.encoding),
                                          source.decode(self.encoding))
179217
public function GetNamedLink($name, $link, $target = null)
    {
        $result = '';
        if (strlen($name) != 0) {
            $result = $name;
            if (strlen($link) != 0) {
                $result = "<a href=\"".$link."\"".(is_null($target) ? "" : " target=\"".$target."\"").">".$result."</a>";
            }
        }
        return $result;
    }
97323
public function copy(PhingFile $src, PhingFile $dest)
    {
        global $php_errormsg;

        if (!$src->isLink()) {
            parent::copy($src, $dest);
            return;
        }

        $srcPath = $src->getAbsolutePath();
        $destPath = $dest->getAbsolutePath();

        $linkTarget = $src->getLinkTarget();
        if (false === @symlink($linkTarget, $destPath)) {
            $msg = "FileSystem::copy() FAILED. Cannot create symlink from $destPath to $linkTarget.";
            throw new Exception($msg);
        }
    }
850361
private function symlink(string $originDir, string $targetDir, bool $relative = false)
    {
        if ($relative) {
            $this->filesystem->mkdir(\dirname($targetDir));
            $originDir = $this->filesystem->makePathRelative($originDir, realpath(\dirname($targetDir)));
        }
        $this->filesystem->symlink($originDir, $targetDir);
        if (!file_exists($targetDir)) {
            throw new IOException(sprintf('Symbolic link "%s" was created but appears to be broken.', $targetDir), 0, null, $targetDir);
        }
    }
1124219
public function createLink($from, $to)
    {
        if (File::exists($from)) {
            if (!File::exists($to)) {
                try {
                    symlink($from, $to);
                } catch (\Exception $e) {
                    throw new \Exception("Cannot create symlink from $from to $to");
                }
            }
        }
    }
1057249
public function asLink($href=NULL,$target=NULL) {
		if (isset($href)) {
			$_target="";
			if(isset($target))
				$_target="target='{$target}'";
			$this->wrap("<a href='" . $href . "' {$_target}>", "</a>");
		}
		return $this->addToProperty("class", "link");
	}
980865
public function processSymlink(Symlink $symlink): bool
    {
        if ($symlink->isForceCreate() && $this->isToUnlink($symlink->getLink())) {
            try {
                if (\is_dir($symlink->getLink())) {
                    $result = $this->filesystem->removeDirectory($symlink->getLink());
                } else {
                    $result = $this->filesystem->remove($symlink->getLink());
                }
                if (!$result) {
                    throw new RuntimeException('Unknown error');
                }
            } catch (\Exception $exception) {
                throw new RuntimeException(sprintf(
                    'Cant unlink %s: %s',
                    $symlink->getLink(),
                    $exception->getMessage()
                ));
            }
        }

        if ($this->isToUnlink($symlink->getLink())) {
            throw new LinkDirectoryError('Link ' . $symlink->getLink() . ' already exists');
        }

        if ($symlink->isAbsolutePath()) {
            return @symlink($symlink->getTarget(), $symlink->getLink());
        }
        return $this->filesystem->relativeSymlink($symlink->getTarget(), $symlink->getLink());
    }