Property | Type | Description | |
---|---|---|---|
$VERSION |
Method | Description | |
---|---|---|
__construct ( string $auth_key, string $secret, integer $app_id, boolean $options = [], string $host = null, integer $port = null, integer $timeout = null ) | PHP5 Constructor. | |
array_implode ( string $glue, string $separator, array $array ) : string | Implode an array with the key and value pair giving a glue, a separator between pairs and the array to implode. | |
build_auth_query_string ( string $auth_key, string $auth_secret, string $request_method, string $request_path, array $query_params = [], string $auth_version = '1.0', string $auth_timestamp = null ) : string | Build the required HMAC'd auth string. | |
get ( $path, $params = [] ) : See | GET arbitrary REST API resource using a synchronous http client. | |
getSettings ( ) : array | Fetch the settings. | |
get_channel_info ( string $channel, array $params = [] ) : object | Fetch channel information for a specific channel. | |
get_channels ( array $params = [] ) : array | Fetch a list containing all channels. | |
notify ( array $interests, $data = [], boolean $debug = false ) : boolean | string | Send a native notification via the Push Notifications Api. | |
presence_auth ( $channel, string $socket_id, string $user_id, mixed $user_info = null ) : string | Creates a presence signature (an extension of socket signing). | |
set_logger ( $logger ) | Set a logger to be informed of internal log messages. | |
socket_auth ( $channel, string $socket_id, string $custom_data = null ) : string | Creates a socket signature. | |
trigger ( array $channels, string $event, mixed $data, string $socket_id = null, boolean $debug = false, boolean $already_encoded = false ) : boolean | string | Trigger an event by providing event name and payload. | |
triggerBatch ( array $batch = [], boolean $debug = false, boolean $already_encoded = false ) : boolean | string | Trigger multiple events at the same time. |
Method | Description | |
---|---|---|
check_compatibility ( ) | Check if the current PHP setup is sufficient to run this class. | |
create_curl ( $domain, $s_url, $request_method = 'GET', $query_params = [] ) | Utility function used to create the curl object with common settings. | |
ddn_domain ( ) : string | Build the ddn domain. | |
exec_curl ( $ch ) | Utility function to execute curl and create capture response information. | |
log ( string $msg ) | Log a string. | |
notification_domain ( ) : string | Build the notification domain. | |
validate_channel ( $channel ) | Ensure a channel name is valid based on our spec. | |
validate_channels ( string[] $channels ) | Validate number of channels and channel name format. | |
validate_socket_id ( string $socket_id ) | Ensure a socket_id is valid based on our spec. |
public __construct ( string $auth_key, string $secret, integer $app_id, boolean $options = [], string $host = null, integer $port = null, integer $timeout = null ) | ||
$auth_key | string | |
$secret | string | |
$app_id | integer | |
$options | boolean | [optional] Options to configure the Pusher instance. Was previously a debug flag. Legacy support for this exists if a boolean is passed. scheme - e.g. http or https host - the host e.g. api.pusherapp.com. No trailing forward slash. port - the http port timeout - the http timeout encrypted - quick option to use scheme of https and port 443. cluster - cluster name to connect to. notification_host - host to connect to for native notifications. notification_scheme - scheme for the notification_host. |
$host | string | [optional] - deprecated |
$port | integer | [optional] - deprecated |
$timeout | integer | [optional] - deprecated |
public static build_auth_query_string ( string $auth_key, string $auth_secret, string $request_method, string $request_path, array $query_params = [], string $auth_version = '1.0', string $auth_timestamp = null ) : string | ||
$auth_key | string | |
$auth_secret | string | |
$request_method | string | |
$request_path | string | |
$query_params | array | |
$auth_version | string | [optional] |
$auth_timestamp | string | [optional] |
return | string |
public get ( $path, $params = [] ) : See | ||
return | See | Pusher API docs |
public get_channels ( array $params = [] ) : array | ||
$params | array | Additional parameters for the query e.g. $params = array( 'info' => 'connection_count' ) |
return | array |
public set_logger ( $logger ) |
public trigger ( array $channels, string $event, mixed $data, string $socket_id = null, boolean $debug = false, boolean $already_encoded = false ) : boolean | string | ||
$channels | array | An array of channel names to publish the event on. |
$event | string | |
$data | mixed | Event data |
$socket_id | string | [optional] |
$debug | boolean | [optional] |
$already_encoded | boolean | [optional] |
return | boolean | string |