Documentation

MultipartStream
in package
implements StreamInterface Uses StreamDecoratorTrait

Stream that when read returns bytes for a streaming multipart or multipart/form-data stream.

Tags
final

Interfaces, Classes and Traits

StreamInterface
Describes a data stream.

Table of Contents

$boundary  : mixed
__call()  : mixed
Allow decorators to implement custom methods
__construct()  : mixed
__get()  : StreamInterface
Magic method used to create a new stream if streams are not added in the constructor of a decorator (e.g., LazyOpenStream).
__toString()  : mixed
close()  : mixed
detach()  : mixed
eof()  : mixed
getBoundary()  : string
Get the boundary
getContents()  : mixed
getMetadata()  : mixed
getSize()  : mixed
isReadable()  : mixed
isSeekable()  : mixed
isWritable()  : bool
Returns whether or not the stream is writable.
read()  : mixed
rewind()  : mixed
seek()  : mixed
tell()  : mixed
write()  : mixed
createStream()  : mixed
Create the aggregate stream that will be used to upload the POST data
addElement()  : mixed
createElement()  : array<string|int, mixed>
getHeader()  : mixed
getHeaders()  : mixed
Get the headers needed before transferring the content of a POST file

Properties

Methods

__call()

Allow decorators to implement custom methods

public __call(string $method, array<string|int, mixed> $args) : mixed
Parameters
$method : string

Missing method name

$args : array<string|int, mixed>

Method arguments

Return values
mixed

__construct()

public __construct([array<string|int, mixed> $elements = [] ][, string $boundary = null ]) : mixed
Parameters
$elements : array<string|int, mixed> = []

Array of associative arrays, each containing a required "name" key mapping to the form field, name, a required "contents" key mapping to a StreamInterface/resource/string, an optional "headers" associative array of custom headers, and an optional "filename" key mapping to a string to send as the filename in the part.

$boundary : string = null

You can optionally provide a specific boundary

Tags
throws
InvalidArgumentException
Return values
mixed

__get()

Magic method used to create a new stream if streams are not added in the constructor of a decorator (e.g., LazyOpenStream).

public __get(string $name) : StreamInterface
Parameters
$name : string

Name of the property (allows "stream" only).

Return values
StreamInterface

getBoundary()

Get the boundary

public getBoundary() : string
Return values
string

getMetadata()

public getMetadata([mixed $key = null ]) : mixed
Parameters
$key : mixed = null
Return values
mixed

isWritable()

Returns whether or not the stream is writable.

public isWritable() : bool
Return values
bool

read()

public read(mixed $length) : mixed
Parameters
$length : mixed
Return values
mixed

seek()

public seek(mixed $offset[, mixed $whence = SEEK_SET ]) : mixed
Parameters
$offset : mixed
$whence : mixed = SEEK_SET
Return values
mixed

write()

public write(mixed $string) : mixed
Parameters
$string : mixed
Return values
mixed

createStream()

Create the aggregate stream that will be used to upload the POST data

protected createStream(array<string|int, mixed> $elements) : mixed
Parameters
$elements : array<string|int, mixed>
Return values
mixed

addElement()

private addElement(AppendStream $stream, array<string|int, mixed> $element) : mixed
Parameters
$stream : AppendStream
$element : array<string|int, mixed>
Return values
mixed

createElement()

private createElement(mixed $name, StreamInterface $stream, mixed $filename, array<string|int, mixed> $headers) : array<string|int, mixed>
Parameters
$name : mixed
$stream : StreamInterface
$filename : mixed
$headers : array<string|int, mixed>
Return values
array<string|int, mixed>

getHeader()

private getHeader(array<string|int, mixed> $headers, mixed $key) : mixed
Parameters
$headers : array<string|int, mixed>
$key : mixed
Return values
mixed

getHeaders()

Get the headers needed before transferring the content of a POST file

private getHeaders(array<string|int, mixed> $headers) : mixed
Parameters
$headers : array<string|int, mixed>
Return values
mixed

Search results