pusher/pusher-php-server
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
guzzlehttp/guzzle | 7.8.1 | 112.34 kB | MIT | prod | |
paragonie/sodium_compat | v1.21.1 | - | ISC | prod | |
psr/log | 3.0.0 | 6.77 kB | MIT | prod dev |
The "pusher/pusher-php-server" is a PHP library for interacting with the Pusher REST API. It offers the potential to create real-time, live-updating user interfaces, without needing to poll a server for updates. This library makes it easy to trigger real-time events on different channels, authenticate and authorize users, encrypt messages, and query application state information.
Using "pusher/pusher-php-server" starts with installing the library via a composer package. This can be achieved by running the command: $ composer require pusher/pusher-php-server
. Another option is to add the "pusher/pusher-php-server" requirement in your composer.json
file and running composer update
. The library can be integrated into PHP applications, Laravel, and other PHP frameworks.
Here's a simple code example on how to trigger an event on a channel using this library:
$app_id = 'YOUR_APP_ID';
$app_key = 'YOUR_APP_KEY';
$app_secret = 'YOUR_APP_SECRET';
$app_cluster = 'YOUR_APP_CLUSTER';
$pusher = new Pusher\Pusher($app_key, $app_secret, $app_id, ['cluster' => $app_cluster]);
$pusher->trigger('my-channel', 'my_event', 'hello world');
This code will trigger the 'my_event' event on 'my-channel' with the data 'hello world'.
The documentation for "pusher/pusher-php-server" is available on the package's GitHub repository. You can access the complete documentation and learn more about its various functionalities by visiting https://github.com/pusher/pusher-http-php.git. This documentation provides a comprehensive guide on how to install, configure, and use this library in your PHP applications effectively.