17 lines
326 B
PHP
17 lines
326 B
PHP
<?php
|
|||
|
|
require 'pusher/pusher-http-php-master/lib/Pusher.php';
|
||
|
|
|
||
|
|
$options = [
|
||
|
|
'cluster' => 'your_cluster',
|
||
|
|
'useTLS' => true
|
||
|
|
];
|
||
|
|
$pusher = new Pusher\Pusher(
|
||
|
|
'your_app_key',
|
||
|
|
'your_app_secret',
|
||
|
|
'your_app_id',
|
||
|
|
$options
|
||
|
|
);
|
||
|
|
|
||
|
|
$data['message'] = 'hello world';
|
||
|
|
$pusher->trigger('my-channel', 'my-event', $data);
|