Skip to content

Add and extract SymlinkFileSystem package #151

@BrianHenryIE

Description

@BrianHenryIE

There are currently some file operations that check for symlinks.

Give the filesystem abstraction of FlySystem, including ReadOnlyFileSystem, I think synlinks should be handled in their own proxy layer.

By extracting the class as its own package, it will make it easier to unit test, particularly for Windows users to test and contribute without needing to think of the broader project

if (false !== strpos('WIN', PHP_OS)) {
/**
* `unlink()` will not work on Windows. `rmdir()` will not work if there are files in the directory.
* "On windows, take care that `is_link()` returns false for Junctions."
*
* @see https://www.php.net/manual/en/function.is-link.php#113263
* @see https://stackoverflow.com/a/18262809/336146
*/
rmdir($symlinkPath);
} else {
unlink($symlinkPath);
}

See: #64

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions