PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
|
Static Public Member Functions | |
static | addCleanedPath (string $path, string $replacement) |
static | cleanPath (string $path) |
static | createLockFile (string $lockFilePath) |
static | fileGetContents (string $fileName, bool $useIncludePath=false, $context=null, int $offset=0, ?int $length=null) |
static | getCleanedPaths () |
static | recursiveCopy (string $origin, string $destination) |
static | recursiveUnlink (string $dir) |
static | releaseLockFile (string $lockFilePath) |
static | safeFilePutContents (string $fileName, string $contents, int $flags=0, $context=null) |
Public Attributes | |
const | CLEAN_PATH_PLUGINS_PREFIX = "plugins" |
const | CLEAN_PATH_SRC_PREFIX = "pmsrc" |
Definition at line 63 of file Filesystem.php.
|
static |
Definition at line 150 of file Filesystem.php.
|
static |
Definition at line 163 of file Filesystem.php.
|
static |
Attempts to get a lock on the specified file, creating it if it does not exist. This is typically used for IPC to inform other processes that some file or folder is already in use, to avoid data corruption. If this function succeeds in gaining a lock on the file, it writes the current PID to the file.
InvalidArgumentException if the lock file path is invalid (e.g. parent directory doesn't exist, permission denied)
Definition at line 185 of file Filesystem.php.
|
static |
Wrapper around file_get_contents() which throws an exception instead of generating E_* errors.
@phpstan-param resource|null $context @phpstan-param 0|positive-int $offset @phpstan-param 0|positive-int|null $length
RuntimeException
Definition at line 305 of file Filesystem.php.
|
static |
Definition at line 161 of file Filesystem.php.
|
static |
Recursively copies a directory to a new location. The parent directories for the destination must exist.
Definition at line 103 of file Filesystem.php.
|
static |
Definition at line 81 of file Filesystem.php.
|
static |
Releases a file lock previously acquired by createLockFile() and deletes the lock file.
InvalidArgumentException if the lock file path is invalid (e.g. parent directory doesn't exist, permission denied)
Definition at line 214 of file Filesystem.php.
|
static |
Wrapper around file_put_contents() which writes to a temporary file before overwriting the original. If the disk is full, writing to the temporary file will fail before the original file is modified, leaving it untouched.
This is necessary because file_put_contents() destroys the data currently in the file if it fails to write the new contents.
resource | null | $context | Context to pass to file_put_contents |
RuntimeException if the operation failed for any reason
Definition at line 238 of file Filesystem.php.
const pocketmine\utils\Filesystem::CLEAN_PATH_PLUGINS_PREFIX = "plugins" |
Definition at line 75 of file Filesystem.php.
const pocketmine\utils\Filesystem::CLEAN_PATH_SRC_PREFIX = "pmsrc" |
Definition at line 74 of file Filesystem.php.