- class
Stream
(php\io\Stream
) - package
std
- source
php/io/Stream.php
Child Classes
Description
Class Stream
Stream ::
of()
Stream ::
getContents()
- Create a stream, call and return the result of the readFully() method, finally call the close() method.Stream ::
putContents()
- Create a stream, call and return the result of the write() method, finally call the close() method.Stream ::
tryAccess()
- Open a stream and close it after calling $onAccess automatically.Stream ::
exists()
- Checks stream is exists. It tries to open a stream and if all is ok, returns true and closes it.Stream ::
register()
Stream ::
unregister()
->
getPath()
->
getMode()
->
read()
->
readFully()
->
readAll()
- Alias of readFully().->
write()
->
parseAs()
- Alias of readFormatted().->
readFormatted()
->
writeFormatted()
->
eof()
->
seek()
->
getPosition()
->
close()
->
__construct()
->
setContext()
->
getContext()
->
__toString()
- Alias of readFully() with converting to string always.->
eachLine()
- Each line of stream.
Stream::of(string $path, string $mode): Stream
Stream::getContents(string $path, string $mode): string
Create a stream, call and return the result of the readFully() method, finally call the close() method.
Stream::putContents(string $path, string $data, string $mode): void
Create a stream, call and return the result of the write() method, finally call the close() method.
Stream::tryAccess(string $path, callable $onAccess, string $mode): void
Open a stream and close it after calling $onAccess automatically.
Stream::exists(string $path): bool
Checks stream is exists. It tries to open a stream and if all is ok, returns true and closes it.
Stream::register(string $protocol, string $className): void
Stream::unregister(mixed $protocol): void
getPath(): string
getMode(): string
read(int $length): mixed
readFully(): mixed
readAll(): mixed
Alias of readFully().
write(string $value, null|int $length): int
parseAs(string $format, int $flags): mixed
Alias of readFormatted().
readFormatted(string $format, int $flags): mixed
writeFormatted(mixed $value, string $format, int $flags): mixed
eof(): bool
seek(int $position): mixed
getPosition(): int
close(): mixed
__construct(string $path, null|string $mode): Stream
setContext(mixed $context): void
getContext(): mixed
__toString(): string
Alias of readFully() with converting to string always.
eachLine(callable $callback, string|null $encoding): void
Each line of stream.