FileStream
in package
implements
StreamInterface
Stream that wraps PHP files.
Tags
Table of Contents
Interfaces
- StreamInterface
Properties
Methods
- __construct() : mixed
- Wrap a PHP stream into a PSR stream interface.
- __destruct() : void
- Auto-close the stream when the object is destroyed.
- __toString() : string
- close() : void
- detach() : mixed
- eof() : bool
- getContents() : string
- getMetadata() : mixed
- getSize() : int|null
- isReadable() : bool
- isSeekable() : bool
- isWritable() : bool
- open() : FileStream
- read() : string
- rewind() : void
- seek() : void
- tell() : int
- write() : int
Properties
$metadata
protected
array<string|int, mixed>|null
$metadata
= null
$stream
protected
resource|null
$stream
= null
Methods
__construct()
Wrap a PHP stream into a PSR stream interface.
public
__construct(resource $stream) : mixed
Parameters
- $stream : resource
Tags
__destruct()
Auto-close the stream when the object is destroyed.
public
__destruct() : void
__toString()
public
__toString() : string
Tags
Return values
stringclose()
public
close() : void
Tags
detach()
public
detach() : mixed
Tags
eof()
public
eof() : bool
Tags
Return values
boolgetContents()
public
getContents() : string
Tags
Return values
stringgetMetadata()
public
getMetadata([mixed $key = null ]) : mixed
Parameters
- $key : mixed = null
Tags
getSize()
public
getSize() : int|null
Tags
Return values
int|nullisReadable()
public
isReadable() : bool
Tags
Return values
boolisSeekable()
public
isSeekable() : bool
Tags
Return values
boolisWritable()
public
isWritable() : bool
Tags
Return values
boolopen()
public
static open(string $filename, string $mode) : FileStream
Parameters
- $filename : string
- $mode : string
Tags
Return values
FileStreamread()
public
read(mixed $length) : string
Parameters
- $length : mixed
Tags
Return values
stringrewind()
public
rewind() : void
Tags
seek()
public
seek(mixed $offset[, mixed $whence = SEEK_SET ]) : void
Parameters
- $offset : mixed
- $whence : mixed = SEEK_SET
Tags
tell()
public
tell() : int
Tags
Return values
intwrite()
public
write(mixed $string) : int
Parameters
- $string : mixed