Copied!

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

CloneableFinalInstantiable
Methods
public __call(string $method, array $args)
 

Allow decorators to implement custom methods

  • return mixed
public __construct(array $elements = [], ?string $boundary = NULL)
 
  • param array $elements 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. string to send as the filename in the part.
  • param string $boundary You can optionally provide a specific boundary
  • throws \InvalidArgumentException
public __get(string $name)
 

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

  • return \StreamInterface
public __toString() : string
public close() : void
public detach()
public eof() : bool
public getBoundary() : string
public getContents() : string
public getMetadata( $key = NULL)
 
  • return mixed
public getSize() : ?int
public isReadable() : bool
public isSeekable() : bool
public isWritable() : bool
public read( $length) : string
public rewind() : void
public seek( $offset, $whence = 0GuzzleHttp\Psr7\SEEK_SET) : void
public tell() : int
public write( $string) : int
Methods
protected createStream(array $elements = []) : Psr\Http\Message\StreamInterface
 

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

Properties
private $boundary = NULL
 
  • var string
private $stream = NULL
 
  • var \StreamInterface
Methods
private addElement(GuzzleHttp\Psr7\AppendStream $stream, array $element) : void
private createElement(string $name, Psr\Http\Message\StreamInterface $stream, ?string $filename, array $headers) : array
 
  • param string[] $headers
  • return array{0: \StreamInterface, 1: string[]}
private static getHeader(array $headers, string $key) : ?string
 
  • param string[] $headers
private getHeaders(array $headers) : string
 

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

  • param string[] $headers
Methods
private static getHeader(array $headers, string $key) : ?string
 
  • param string[] $headers
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration