Documentation

FileStream
in package
implements StreamInterface

Stream that wraps PHP files.

Tags
see
https://www.php.net/manual/en/function.fopen.php

Table of Contents

Interfaces

StreamInterface

Properties

$metadata  : array<string|int, mixed>|null
$stream  : resource|null

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

Methods

__construct()

Wrap a PHP stream into a PSR stream interface.

public __construct(resource $stream) : mixed
Parameters
$stream : resource
Tags
throws
InvalidArgumentException

__destruct()

Auto-close the stream when the object is destroyed.

public __destruct() : void

__toString()

public __toString() : string
Tags
inheritdoc
Return values
string

detach()

public detach() : mixed
Tags
inheritdoc

eof()

public eof() : bool
Tags
inheritdoc
Return values
bool

getContents()

public getContents() : string
Tags
inheritdoc
Return values
string

getMetadata()

public getMetadata([mixed $key = null ]) : mixed
Parameters
$key : mixed = null
Tags
inheritdoc

getSize()

public getSize() : int|null
Tags
inheritdoc
Return values
int|null

isReadable()

public isReadable() : bool
Tags
inheritdoc
Return values
bool

isSeekable()

public isSeekable() : bool
Tags
inheritdoc
Return values
bool

isWritable()

public isWritable() : bool
Tags
inheritdoc
Return values
bool

open()

public static open(string $filename, string $mode) : FileStream
Parameters
$filename : string
$mode : string
Tags
throws
RuntimeException
Return values
FileStream

read()

public read(mixed $length) : string
Parameters
$length : mixed
Tags
inheritdoc
Return values
string

rewind()

public rewind() : void
Tags
inheritdoc

seek()

public seek(mixed $offset[, mixed $whence = SEEK_SET ]) : void
Parameters
$offset : mixed
$whence : mixed = SEEK_SET
Tags
inheritdoc

tell()

public tell() : int
Tags
inheritdoc
Return values
int

write()

public write(mixed $string) : int
Parameters
$string : mixed
Tags
inheritdoc
Return values
int
On this page

Search results