FileSystem
Most of this code is thankfully taken from \Composer\Util\Filesystem
Only to be used in TYPO3\CMS\Core\SystemResource namespace
Table of Contents
Methods
- findShortestPath() : string
- Returns the shortest path from $from to $to
- isJunction() : bool
- Returns whether the target directory is a Windows NTFS Junction.
- isSymlinkedDirectory() : bool
- Return true if that directory is a symlink.
- junction() : void
- Creates an NTFS junction.
- relativeSymlink() : bool
- Creates a relative symlink from $link to $target
Methods
findShortestPath()
Returns the shortest path from $from to $to
public
findShortestPath(string $from, string $to[, bool $directories = false ]) : string
Parameters
- $from : string
- $to : string
- $directories : bool = false
-
If true, the source/target are considered to be directories
Tags
Return values
stringisJunction()
Returns whether the target directory is a Windows NTFS Junction.
public
isJunction(string $junction) : bool
We test if the path is a directory and not an ordinary link, then check that the mode value returned from lstat (which gives the status of the link itself) is not a directory, by replicating the POSIX S_ISDIR test.
Parameters
- $junction : string
-
Path to check.
Return values
boolisSymlinkedDirectory()
Return true if that directory is a symlink.
public
isSymlinkedDirectory(string $directory) : bool
Parameters
- $directory : string
Return values
booljunction()
Creates an NTFS junction.
public
junction(string $target, string $junction) : void
Parameters
- $target : string
- $junction : string
relativeSymlink()
Creates a relative symlink from $link to $target
public
relativeSymlink(string $target, string $link) : bool
Parameters
- $target : string
-
The path of the binary file to be symlinked
- $link : string
-
The path where the symlink should be created