FsUtils
final class FsUtils (View source)
Methods
Return path to the backup directory.
Get the base dir where our backup directories will be stored. Also stores CLI history file.
Determine if the specified location is writable, or if a writable directory could be created at that path.
Prepare a temporary directory that will be deleted on exit.
Add the given directory to a list to be deleted on exit.
Delete all of the files registered for deletion.
Prepare a backup directory.
Returns canonicalized absolute pathname.
Check whether a file is a supported tarball.
Determines the MIME content type of the specified file.
Details
static string
getBackupDir(string|null $subdir = null)
Return path to the backup directory.
static
getBackupDirParent()
Get the base dir where our backup directories will be stored. Also stores CLI history file.
static bool|string
isUsableDirectory(string|null $dir)
Determine if the specified location is writable, or if a writable directory could be created at that path.
static string
tmpDir(string $subdir = null)
Prepare a temporary directory that will be deleted on exit.
static
registerForDeletion(string $dir)
Add the given directory to a list to be deleted on exit.
static
cleanup()
Delete all of the files registered for deletion.
static string
prepareBackupDir(string $subdir = null)
Prepare a backup directory.
static string
realpath(string $path)
Returns canonicalized absolute pathname.
The difference between this and PHP's realpath() is that this will return the original path even if it doesn't exist.
static string|bool
isTarball(string $path)
Check whether a file is a supported tarball.
static string|bool|null
getMimeContentType(string $path)
Determines the MIME content type of the specified file.
The power of this function depends on whether the PHP installation has either mime_content_type() or finfo installed -- if not, only tar, gz, zip and bzip2 types can be detected.