Documentation

Stream extends AbstractHandler
in package

HTTP client stream handler class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
5.2.0

Table of Contents

Properties

$context  : mixed
Stream context
$contextOptions  : array<string|int, mixed>
Stream context options
$contextParams  : array<string|int, mixed>
Stream context parameters
$httpResponseHeaders  : array<string|int, mixed>|null
HTTP response headers
$httpVersion  : string
HTTP version
$mode  : string
Stream mode
$resource  : mixed
Client resource object
$uri  : string|null
URI string

Methods

__construct()  : mixed
Constructor
addContextOption()  : Stream
Add a context options
addContextParam()  : Stream
Add a context parameter
allowSelfSigned()  : Stream
Set Stream context option to set to allow self-signed certs (verify host)
create()  : Stream
Factory method to create a Curl client
createContext()  : Stream
Create stream context
disconnect()  : void
Close the handler connection
getContext()  : mixed
Get the context resource
getContextOption()  : mixed
Get a context option
getContextOptions()  : array<string|int, mixed>
Get the context options
getContextParam()  : mixed
Get a context parameter
getContextParams()  : array<string|int, mixed>
Get the context parameters
getHttpVersion()  : string
Get the URI string
getMode()  : string
Get the mode
getResource()  : mixed
Get the resource
getUri()  : string|null
Get the URI string
getUriObject()  : Uri
Get the URI as an object
hasContextOption()  : bool
Determine if a context option has been set
hasContextParam()  : bool
Determine if a context parameter has been set
hasResource()  : bool
Determine whether or not resource is available
hasUri()  : bool
Determine whether or not there is a URI string
isAllowSelfSigned()  : bool
Check if Stream is set to allow self-signed certs
isVerifyPeer()  : bool
Check if Stream is set to verify peer
parseResponse()  : Response
Parse the response
prepare()  : Stream
Method to prepare the handler
reset()  : Stream
Method to reset the handler
resource()  : mixed
Get the resource (alias method)
send()  : Response
Method to send the request
setContextOptions()  : Stream
Set the context options
setContextParams()  : Stream
Set the context parameters
setMethod()  : Stream
Set the method
setMode()  : Stream
Set the mode
setVerifyPeer()  : Stream
Set Stream context option to set verify peer (verifies the domain's SSL cert)
stream()  : mixed
Return stream resource (alias to $this->getResource())

Properties

$context

Stream context

protected mixed $context = null

$contextOptions

Stream context options

protected array<string|int, mixed> $contextOptions = []

$contextParams

Stream context parameters

protected array<string|int, mixed> $contextParams = []

$httpResponseHeaders

HTTP response headers

protected array<string|int, mixed>|null $httpResponseHeaders = null

$mode

Stream mode

protected string $mode = 'r'

Methods

__construct()

Constructor

public __construct([string $mode = 'r' ][, array<string|int, mixed> $options = [] ][, array<string|int, mixed> $params = [] ]) : mixed

Instantiate the stream handler object

Parameters
$mode : string = 'r'
$options : array<string|int, mixed> = []
$params : array<string|int, mixed> = []

addContextOption()

Add a context options

public addContextOption(string $name, mixed $option) : Stream
Parameters
$name : string
$option : mixed
Return values
Stream

addContextParam()

Add a context parameter

public addContextParam(string $name, mixed $param) : Stream
Parameters
$name : string
$param : mixed
Return values
Stream

allowSelfSigned()

Set Stream context option to set to allow self-signed certs (verify host)

public allowSelfSigned([bool $allow = true ]) : Stream
Parameters
$allow : bool = true
Return values
Stream

create()

Factory method to create a Curl client

public static create([string $method = 'GET' ][, string $mode = 'r' ][, array<string|int, mixed> $options = [] ][, array<string|int, mixed> $params = [] ]) : Stream
Parameters
$method : string = 'GET'
$mode : string = 'r'
$options : array<string|int, mixed> = []
$params : array<string|int, mixed> = []
Return values
Stream

disconnect()

Close the handler connection

public disconnect() : void

getContext()

Get the context resource

public getContext() : mixed

getContextOption()

Get a context option

public getContextOption(string $name) : mixed
Parameters
$name : string

getContextOptions()

Get the context options

public getContextOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getContextParam()

Get a context parameter

public getContextParam(string $name) : mixed
Parameters
$name : string

getContextParams()

Get the context parameters

public getContextParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

getHttpVersion()

Get the URI string

public getHttpVersion() : string
Return values
string

getMode()

Get the mode

public getMode() : string
Return values
string

getUri()

Get the URI string

public getUri() : string|null
Return values
string|null

hasContextOption()

Determine if a context option has been set

public hasContextOption(string $name) : bool
Parameters
$name : string
Return values
bool

hasContextParam()

Determine if a context parameter has been set

public hasContextParam(string $name) : bool
Parameters
$name : string
Return values
bool

hasResource()

Determine whether or not resource is available

public hasResource() : bool
Return values
bool

hasUri()

Determine whether or not there is a URI string

public hasUri() : bool
Return values
bool

isAllowSelfSigned()

Check if Stream is set to allow self-signed certs

public isAllowSelfSigned() : bool
Return values
bool

isVerifyPeer()

Check if Stream is set to verify peer

public isVerifyPeer() : bool
Return values
bool

resource()

Get the resource (alias method)

public resource() : mixed

setContextOptions()

Set the context options

public setContextOptions(array<string|int, mixed> $options) : Stream
Parameters
$options : array<string|int, mixed>
Return values
Stream

setContextParams()

Set the context parameters

public setContextParams(array<string|int, mixed> $params) : Stream
Parameters
$params : array<string|int, mixed>
Return values
Stream

setMethod()

Set the method

public setMethod(string $method) : Stream
Parameters
$method : string
Return values
Stream

setMode()

Set the mode

public setMode(string $mode) : Stream
Parameters
$mode : string
Return values
Stream

setVerifyPeer()

Set Stream context option to set verify peer (verifies the domain's SSL cert)

public setVerifyPeer([bool $verify = true ]) : Stream
Parameters
$verify : bool = true
Return values
Stream

stream()

Return stream resource (alias to $this->getResource())

public stream() : mixed

        
On this page

Search results