SendFile
extends Endpoint
in package
Table of Contents
Constants
- RESPONSE_IS_JSON = true
Properties
- $boundary : string
- $cachedTransports : array<string|int, mixed>
- $channel : string
- $customHost : mixed
- $customParamMapping : array<string|int, mixed>
- $envelope : PNEnvelope
- $fileContent : mixed
- $fileHandle : mixed
- $fileName : string
- $fileUploadEnvelope : mixed
- $followRedirects : mixed
- $message : mixed
- $meta : mixed
- $pubnub : PubNub
- $shouldCompress : bool
- $shouldStore : bool
- $ttl : int
Methods
- __construct() : mixed
- channel() : mixed
- clear() : mixed
- Clear cached envelope
- envelope() : PNEnvelope
- Returns an Envelope that contains both result and status.
- fileContent() : mixed
- fileHandle() : mixed
- fileName() : mixed
- message() : mixed
- meta() : mixed
- requestTimeout() : mixed
- shouldStore() : mixed
- sync() : mixed
- Return a Result only.
- ttl() : mixed
- buildData() : null|string
- buildParams() : array<string|int, mixed>
- Params build flow: signed <- custom <- default
- buildPath() : string
- buildPayload() : mixed
- connectTimeout() : mixed
- createResponse() : PNPublishResult
- customHeaders() : mixed
- customParams() : array<string|int, mixed>
- defaultHeaders() : mixed
- defaultParams() : array<string|int, mixed>
- encryptPayload() : mixed
- fetchPayload() : array<string|int, mixed>
- getAffectedChannelGroups() : mixed
- getAffectedChannels() : mixed
- getAffectedUsers() : mixed
- getBoundary() : mixed
- getConnectTimeout() : int
- getName() : string
- getOperationType() : int
- getRequestTimeout() : int
- getTransport() : mixed
- httpMethod() : string
- invokeRequest() : PNEnvelope
- invokeRequestAndCacheIt() : PNEnvelope
- isAuthRequired() : bool
- requestOptions() : array<string|int, mixed>
- uploadFile() : mixed
- validateChannel() : void
- validateChannelGroups() : mixed
- validateParams() : mixed
- validatePublishKey() : mixed
- validateSecretKey() : mixed
- validateSubscribeKey() : mixed
- createStatus() : PNStatus
- getDefaultTransport() : Transport
Constants
RESPONSE_IS_JSON
protected
mixed
RESPONSE_IS_JSON
= true
Properties
$boundary
protected
string
$boundary
$cachedTransports
protected
static array<string|int, mixed>
$cachedTransports
= []
$channel
protected
string
$channel
$customHost
protected
mixed
$customHost
= null
$customParamMapping
protected
array<string|int, mixed>
$customParamMapping
= []
$envelope
protected
PNEnvelope
$envelope
$fileContent
protected
mixed
$fileContent
$fileHandle
protected
mixed
$fileHandle
$fileName
protected
string
$fileName
$fileUploadEnvelope
protected
mixed
$fileUploadEnvelope
$followRedirects
protected
mixed
$followRedirects
= true
$message
protected
mixed
$message
$meta
protected
mixed
$meta
$pubnub
protected
PubNub
$pubnub
$shouldCompress
protected
bool
$shouldCompress
= false
$shouldStore
protected
bool
$shouldStore
$ttl
protected
int
$ttl
Methods
__construct()
public
__construct(PubNub $pubnubInstance) : mixed
Parameters
- $pubnubInstance : PubNub
channel()
public
channel(mixed $channel) : mixed
Parameters
- $channel : mixed
clear()
Clear cached envelope
public
clear() : mixed
envelope()
Returns an Envelope that contains both result and status.
public
envelope() : PNEnvelope
All Errors are wrapped, so no need to use try/catch blocks
Return values
PNEnvelopefileContent()
public
fileContent(mixed $fileContent) : mixed
Parameters
- $fileContent : mixed
fileHandle()
public
fileHandle(mixed $fileHandle) : mixed
Parameters
- $fileHandle : mixed
fileName()
public
fileName(mixed $fileName) : mixed
Parameters
- $fileName : mixed
message()
public
message(mixed $message) : mixed
Parameters
- $message : mixed
meta()
public
meta(mixed $meta) : mixed
Parameters
- $meta : mixed
requestTimeout()
public
requestTimeout() : mixed
shouldStore()
public
shouldStore(mixed $shouldStore) : mixed
Parameters
- $shouldStore : mixed
sync()
Return a Result only.
public
sync() : mixed
Errors are thrown explicitly, so catch them with try/catch block
ttl()
public
ttl(mixed $ttl) : mixed
Parameters
- $ttl : mixed
buildData()
protected
buildData() : null|string
Return values
null|stringbuildParams()
Params build flow: signed <- custom <- default
protected
buildParams() : array<string|int, mixed>
Return values
array<string|int, mixed>buildPath()
protected
buildPath() : string
Tags
Return values
stringbuildPayload()
protected
buildPayload(mixed $data, mixed $fileName, mixed $fileContent) : mixed
Parameters
- $data : mixed
- $fileName : mixed
- $fileContent : mixed
connectTimeout()
protected
connectTimeout() : mixed
createResponse()
protected
createResponse(array<string|int, mixed> $result) : PNPublishResult
Parameters
- $result : array<string|int, mixed>
-
Decoded json
Return values
PNPublishResultcustomHeaders()
protected
customHeaders() : mixed
customParams()
protected
customParams() : array<string|int, mixed>
Return values
array<string|int, mixed>defaultHeaders()
protected
defaultHeaders() : mixed
defaultParams()
protected
defaultParams() : array<string|int, mixed>
Return values
array<string|int, mixed>encryptPayload()
protected
encryptPayload() : mixed
fetchPayload()
protected
static fetchPayload(mixed $json) : array<string|int, mixed>
Parameters
- $json : mixed
Tags
Return values
array<string|int, mixed>getAffectedChannelGroups()
protected
getAffectedChannelGroups() : mixed
getAffectedChannels()
protected
getAffectedChannels() : mixed
getAffectedUsers()
protected
getAffectedUsers() : mixed
getBoundary()
protected
getBoundary() : mixed
getConnectTimeout()
protected
getConnectTimeout() : int
Return values
intgetName()
protected
getName() : string
Return values
stringgetOperationType()
protected
getOperationType() : int
Return values
intgetRequestTimeout()
protected
getRequestTimeout() : int
Return values
intgetTransport()
protected
getTransport() : mixed
httpMethod()
protected
httpMethod() : string
Return values
stringinvokeRequest()
protected
invokeRequest() : PNEnvelope
Return values
PNEnvelopeinvokeRequestAndCacheIt()
protected
invokeRequestAndCacheIt() : PNEnvelope
Tags
Return values
PNEnvelopeisAuthRequired()
protected
isAuthRequired() : bool
Return values
boolrequestOptions()
protected
requestOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>uploadFile()
protected
uploadFile() : mixed
validateChannel()
protected
validateChannel() : void
validateChannelGroups()
protected
validateChannelGroups(array<string|int, string>|string $channels, array<string|int, string>|string $groups) : mixed
Parameters
- $channels : array<string|int, string>|string
- $groups : array<string|int, string>|string
Tags
validateParams()
protected
validateParams() : mixed
Tags
validatePublishKey()
protected
validatePublishKey() : mixed
Tags
validateSecretKey()
protected
validateSecretKey() : mixed
Tags
validateSubscribeKey()
protected
validateSubscribeKey() : mixed
Tags
createStatus()
private
createStatus(int $category, mixed $response, ResponseInfo|null $responseInfo, PubNubException|null $exception) : PNStatus
Parameters
- $category : int
- $response : mixed
- $responseInfo : ResponseInfo|null
- $exception : PubNubException|null
Return values
PNStatusgetDefaultTransport()
private
getDefaultTransport() : Transport