class StreamHelper (View source)

The StreamHelper class.

Properties

static StreamOutput $outputObject Property outputClass for test use.

Methods

static void
copy(StreamInterface $src, StreamInterface $dest)

Copy stream to another stream.

static void
copyTo(StreamInterface $src, string $dest)

Copy a stream to target resource.

static void
copyFrom(string $src, StreamInterface $dest)

Copy a stream to target resource.

static void
sendAttachment(string|resource $source, ResponseInterface $response = null, array $options = array())

A simple method to quickly send attachment stream download.

Details

at line line 40
static void copy(StreamInterface $src, StreamInterface $dest)

Copy stream to another stream.

Parameters

StreamInterface $src Source stream.
StreamInterface $dest Target stream.

Return Value

void

at line line 61
static void copyTo(StreamInterface $src, string $dest)

Copy a stream to target resource.

Parameters

StreamInterface $src The source stream to copy.
string $dest The target stream, if is a path or resource, will auto create Stream object.

Return Value

void

at line line 78
static void copyFrom(string $src, StreamInterface $dest)

Copy a stream to target resource.

Parameters

string $src The source stream to copy, if is a path or resource, will auto create Stream object.
StreamInterface $dest The target stream.

Return Value

void

at line line 97
static void sendAttachment(string|resource $source, ResponseInterface $response = null, array $options = array())

A simple method to quickly send attachment stream download.

Parameters

string|resource $source The file source, can be file path or resource.
ResponseInterface $response A custom Response object to contain your headers.
array $options Options to provide some settings, currently supports "delay" and "filename".

Return Value

void