@@ -18,7 +18,7 @@ Or add to `composer.json`:
18
18
19
19
``` json
20
20
"require" : {
21
- "pusher/pusher-php-server" : " ^2.6 "
21
+ "pusher/pusher-php-server" : " ^3.0 "
22
22
}
23
23
```
24
24
@@ -41,7 +41,7 @@ $app_key = 'YOUR_APP_KEY';
41
41
$app_secret = 'YOUR_APP_SECRET';
42
42
$app_cluster = 'YOUR_APP_CLUSTER';
43
43
44
- $pusher = new Pusher( $app_key, $app_secret, $app_id, array('cluster' => $app_cluster) );
44
+ $pusher = new Pusher\Pusher ( $app_key, $app_secret, $app_id, array('cluster' => $app_cluster) );
45
45
```
46
46
47
47
The fourth parameter is an ` $options ` array. The additional options are:
@@ -167,12 +167,12 @@ if (isset($_SESSION['user_id'])) {
167
167
$stmt->execute();
168
168
$user = $stmt->fetch();
169
169
} else {
170
- die('aaargh, no-one is logged in')
170
+ die('aaargh, no-one is logged in');
171
171
}
172
172
173
173
header('Content-Type: application/json');
174
174
175
- $pusher = new Pusher($key, $secret, $app_id);
175
+ $pusher = new Pusher\Pusher ($key, $secret, $app_id);
176
176
$presence_data = array('name' => $user['name']);
177
177
178
178
echo $pusher->presence_auth($_POST['channel_name'], $_POST['socket_id'], $user['id'], $presence_data);
@@ -292,7 +292,7 @@ The native notifications API is hosted at `nativepush-cluster1.pusher.com` and o
292
292
If you wish to provide a different host you can do:
293
293
294
294
``` php
295
- $pusher = new Pusher($app_key, $app_secret, $app_id, array('notification_host' => 'custom notifications host'))
295
+ $pusher = new Pusher\Pusher ($app_key, $app_secret, $app_id, array('notification_host' => 'custom notifications host'))
296
296
```
297
297
However, note that ` notification_host ` defaults to ` nativepush-cluster1.pusher.com ` and it is the only supported endpoint.
298
298
0 commit comments