final | |
---|---|
extends |
AbstractUtility |
Work with files, directories, streams and paths
Methods with an optional $uri
parameter allow the resource URI reported on
failure to be overridden.
Methods | ||
---|---|---|
public
static
|
isAbsolute(string $path): bool
|
# |
public
static
|
resolvePath(string $path, bool $withEmptySegments = false): string
|
# |
public
static
|
getCleanDir(string $directory): string
|
# |
public
static
|
chdir(string $directory): void
|
# |
public
static
|
mkdir(string $directory, int $permissions = 0777, bool $recursive = false): void
|
# |
public
static
|
chmod(string $filename, int $permissions): void
|
# |
public
static
|
touch(string $filename, ?int $mtime = null, ?int $atime = null): void
|
# |
public
static
|
getClosestPath(string $path): ?string
|
# |
public
static
|
create(string $filename, int $permissions = 0777, int $dirPermissions = 0777): void
|
# |
public
static
|
createDir(string $directory, int $permissions = 0777): void
|
# |
public
static
|
createTempDir(?string $directory = null, ?string $prefix = null): string
|
# |
public
static
|
delete(string $filename): void
|
# |
public
static
|
deleteDir(string $directory): void
|
# |
public
static
|
find(): RecursiveFilesystemIterator
|
# |
public
static
|
getcwd(): string
|
# |
public
static
|
isCreatable(string $path): bool
|
# |
public
static
|
pruneDir(string $directory, bool $delete = false, bool $setPermissions = false): void
|
# |
public
static
|
realpath(string $path): string
|
# |
public
static
|
getRelativePath<TDefault is string|null>(
string $path,
string $parentDirectory,
TDefault $default = null,
): string|TDefault
|
# |
public
static
|
same(string $filename1, string $filename2): bool
|
# |
public
static
|
getIdentifier(string $filename): string
|
# |
public
static
|
size(string $filename): int
|
# |
public
static
|
type(string $filename): 'fifo'|'char'|'dir'|'block'|'link'|'file'|'socket'|'unknown'
|
# |
public
static
|
writeContents(
string $filename,
resource|array<int|float|string|bool|Stringable|null>|string $data,
int-mask-of<FILE_USE_INCLUDE_PATH|FILE_APPEND|LOCK_EX> $flags = 0,
): int
|
# |
public
static
|
checkEof(resource $stream, Stringable|string|null $uri = null): void
|
# |
public
static
|
close(resource $stream, Stringable|string|null $uri = null): void
|
# |
public
static
|
closePipe(resource $pipe, ?string $command = null): int
|
# |
public
static
|
getSeekableStream(resource $stream, Stringable|string|null $uri = null): resource
|
# |
public
static
|
getStreamUri(resource $stream): string|null
|
# |
public
static
|
isSeekableStream(mixed $value): bool
|
# |
public
static
|
isStream(mixed $value): bool
|
# |
public
static
|
open(string $filename, string $mode): resource
|
# |
public
static
|
maybeOpen<TResource is Stringable|string|resource, TUri is Stringable|string|null>(
TResource $resource,
string $mode,
?bool &$close,
TUri &$uri,
): resource
|
# |
public
static
|
openPipe(string $command, string $mode): resource
|
# |
public
static
|
read(resource $stream, int<1, max> $length, Stringable|string|null $uri = null): string
|
# |
public
static
|
readAll(resource $stream, int<0, max> $length, Stringable|string|null $uri = null): string
|
# |
public
static
|
readLine(resource $stream, Stringable|string|null $uri = null): string
|
# |
public
static
|
rewind(resource $stream, Stringable|string|null $uri = null): void
|
# |
public
static
|
maybeRewind(resource $stream, Stringable|string|null $uri = null): void
|
# |
public
static
|
seek(
resource $stream,
int $offset,
SEEK_SET|SEEK_CUR|SEEK_END $whence = SEEK_SET,
Stringable|string|null $uri = null,
): void
|
# |
public
static
|
maybeSeek(
resource $stream,
int $offset,
SEEK_SET|SEEK_CUR|SEEK_END $whence = SEEK_SET,
Stringable|string|null $uri = null,
): void
|
# |
public
static
|
tell(resource $stream, Stringable|string|null $uri = null): int
|
# |
public
static
|
truncate(resource $stream, int<0, max> $size = 0, Stringable|string|null $uri = null): void
|
# |
public
static
|
write(resource $stream, string $data, int<0, max>|null $length = null, Stringable|string|null $uri = null): int
|
# |
public
static
|
writeAll(resource $stream, string $data, int<0, max>|null $length = null, Stringable|string|null $uri = null): int
|
# |
public
static
|
maybeWrite(
resource $stream,
string $data,
?string &$buffer,
int<0, max>|null $length = null,
Stringable|string|null $uri = null,
): int
|
# |
public
static
|
writeCsvLine(
resource $stream,
(int|float|string|bool|null)[] $fields,
string $separator = ',',
string $enclosure = '"',
string $eol = "\n",
Stringable|string|null $uri = null,
): int
|
# |
public
static
|
copy(
Stringable|string|resource $from,
Stringable|string|resource $to,
Stringable|string|null $fromUri = null,
Stringable|string|null $toUri = null,
): void
|
# |
public
static
|
getContents(Stringable|string|resource $resource, ?int $offset = null, Stringable|string|null $uri = null): string
|
# |
public
static
|
getCsv(Stringable|string|resource $resource, Stringable|string|null $uri = null): list<array{null}|list<string>>
|
# |
public
static
|
getEol(Stringable|string|resource $resource, Stringable|string|null $uri = null): string|null
|
# |
public
static
|
getLines(Stringable|string|resource $resource, Stringable|string|null $uri = null): string[]
|
# |
public
static
|
hasPhp(Stringable|string|resource $resource, Stringable|string|null $uri = null): bool
|
# |
public
static
|
stat(Stringable|string|resource $resource, Stringable|string|null $uri = null): int[]
|
# |
public
static
|
writeCsv<TValue>(
Stringable|string|resource $resource,
iterable<TValue> $data,
bool $headerRow = true,
int|float|string|bool|null $nullValue = null,
(callable(TValue, int $index): mixed[])|null $callback = null,
int|null &$count = null,
string $eol = "\r\n",
bool $utf16le = true,
bool $bom = true,
Stringable|string|null $uri = null,
): void
|
# |