PubNub 3.6 Real-time Push Cloud API
| package |
Pubnub |
|---|
__construct(string|array $first_argument = '', string $subscribe_key = '', boolean|string $secret_key = false, boolean $cipher_key = false, boolean $ssl = false, boolean|string $origin = false, boolean $pem_path = false, boolean $uuid = false, boolean $proxy = false, boolean $auth_key = false)
You can create client instance using named or positional arguments
| throws | |
|---|---|
string|arraypublish_key to send messages or associative config array.
stringrequired key to receive messages.
boolean|stringoptional key to sign messages.
boolean
booleanrequired for 2048 bit encrypted messages.
boolean|stringoptional setting for cloud origin.
boolean
boolean
boolean
boolean
audit(string|null $channel = null, string|null $auth_key = null) : array
string|null
string|null
array
defaultQueryArray() : array
array
detailedHistory()
| deprecated | 3.7.0 |
|---|---|
| see |
\Pubnub\Pubnub->history()
Use history() instead |
getState(string $channel, string $uuid) : array|null
| throws |
|---|
string
string
array|null
getUUID() : string
stringUUID
grant(boolean $read, boolean $write, string|null $channel = null, string|null $auth_key = null, integer|null $ttl = null) : array
boolean
boolean
string|null
string|null
integer|null
array
handleError(\Exception $error)
for internal error handling
\Exception
hereNow(string $channel = null, boolean $disable_uuids = false, boolean $state = false) : array
| throws |
|---|
string
boolean
boolean
arrayof uuids and occupancies.
history(string $channel, integer $count = 100, boolean $include_token = null, integer $start = null, integer $end = null, boolean $reverse = false) : array
| throws |
|---|
string
integermessage limit
booleanfor each message
integertime token
integertime token
boolean
array
leave( $channel)
pipeline(Callback $callback)
For PHP <= 5.3 use pipelineStart() and pipelineEnd() functions instead.
Callback
pipelineEnd()
pipelineStart()
presence(string $channel, callback $callback, integer $timeToken)
This is BLOCKING. Listen for a message on a presence channel.
string
callback
integer
publish(string $channel, string $messageOrg) : array
Sends a message to a channel.
| throws |
|---|
string
string
arraysuccess information.
request(array $path, array $query = array(), boolean $useDefaultQueryArray = true) : array|null
In pipelined mode null is returned for every query In non-pipelined mode response array is returned
| throws |
|---|
array
array
boolean
array|null
revoke(string|null $channel = null, string|null $auth_key = null) : array
string|null
string|null
array
setAuthKey( $auth_key)
setState(string $channel, array|null $state, string|null $uuid = null) : mixed|null
| throws |
|---|
string
array|null
string|null
mixed|null
setUUID(string $uuid)
| throws | |
|---|---|
string
subscribe(string $channel, string $callback, integer $timeToken, boolean $presence = false)
This is BLOCKING. Listen for a message on a channel.
| throws | |
|---|---|
stringfor channel name
stringfor callback definition.
integerfor current time token value.
boolean
throwAndResetTimeToken( $callback, $errorMessage) : string
string
time() : integer
Timestamp from PubNub Cloud.
integertimestamp.
uuid() : string
UUID generator
stringUUID
whereNow(string $uuid = "") : array
| throws |
|---|
string
array
PNSDK
ORIGIN :
PUBLISH_KEY :
SUBSCRIBE_KEY :
SECRET_KEY :
CIPHER_KEY :
AUTH_KEY :
SSL :
SESSION_UUID :
PROXY :
NEW_STYLE_RESPONSE :
pipelinedFlag :
defaultClient :
pipelinedClient :
AES :
PAM :