Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Creates a symbolic link
<?php symlink(string $target, string $link): bool
<?php     {

        $adapter = new LocalFilesystemAdapter(static::ROOT, null, LOCK_EX, LocalFilesystemAdapter::SKIP_LINKS);

        file_put_contents(static::ROOT . '/file.txt', 'content');

        symlink(static::ROOT . '/file.txt', static::ROOT . '/link.txt');




        $contentListing = $adapter->listContents('/', true);
<?php         $this->expectException(SymbolicLinkEncountered::class);

        $adapter = new LocalFilesystemAdapter(static::ROOT, null, LOCK_EX, LocalFilesystemAdapter::DISALLOW_LINKS);

        file_put_contents(static::ROOT . '/file.txt', 'content');

        symlink(static::ROOT . '/file.txt', static::ROOT . '/link.txt');




        $contentListing = $adapter->listContents('/', true);
<?php         mkdir(static::ROOT . '/directory/subdir/', 0744, true);

        $this->assertDirectoryExists(static::ROOT . '/directory/subdir/');

        file_put_contents(static::ROOT . '/directory/subdir/file.txt', 'content');

        symlink(static::ROOT . '/directory/subdir/file.txt', static::ROOT . '/directory/subdir/link.txt');

        $adapter->deleteDirectory('directory/subdir');

        $this->assertDirectoryDoesNotExist(static::ROOT . '/directory/subdir/');

        $adapter->deleteDirectory('directory');