HumHub Documentation (unofficial)

SimpleResultStream
in package
implements ResultStream

Simple streamable body used for testing.

Tags
author

Tobias Nyholm tobias.nyholm@gmail.com

Table of Contents

Interfaces

ResultStream
Stream for a Result.

Properties

$data  : string

Methods

__construct()  : mixed
getChunks()  : iterable<string|int, string>
Download the response in chunks.
getContentAsResource()  : resource
Download content into a resource and then return that resource.
getContentAsString()  : string
Download content into a temporary resource and return a string.

Properties

Methods

__construct()

public __construct(string $data) : mixed
Parameters
$data : string

getChunks()

Download the response in chunks.

public getChunks() : iterable<string|int, string>

$fileHandler = fopen('/output.pdf', 'w'); foreach ($result->getBody()->getChunks() as $chunk) { fwrite($fileHandler, $chunk); }

Return values
iterable<string|int, string>

getContentAsResource()

Download content into a resource and then return that resource.

public getContentAsResource() : resource
Return values
resource

getContentAsString()

Download content into a temporary resource and return a string.

public getContentAsString() : string
Return values
string

        
On this page

Search results