- 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): StreamStream::getContents(string $path, string $mode): stringCreate a stream, call and return the result of the readFully() method, finally call the close() method.
Stream::putContents(string $path, string $data, string $mode): voidCreate a stream, call and return the result of the write() method, finally call the close() method.
Stream::tryAccess(string $path, callable $onAccess, string $mode): voidOpen a stream and close it after calling $onAccess automatically.
Stream::exists(string $path): boolChecks 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): voidStream::unregister(mixed $protocol): voidgetPath(): stringgetMode(): stringread(int $length): mixedreadFully(): mixedreadAll(): mixedAlias of readFully().
write(string $value, null|int $length): intparseAs(string $format, int $flags): mixedAlias of readFormatted().
readFormatted(string $format, int $flags): mixedwriteFormatted(mixed $value, string $format, int $flags): mixedeof(): boolseek(int $position): mixedgetPosition(): intclose(): mixed__construct(string $path, null|string $mode): StreamsetContext(mixed $context): voidgetContext(): mixed__toString(): stringAlias of readFully() with converting to string always.
eachLine(callable $callback, string|null $encoding): voidEach line of stream.