An example using Pusher with the Silex PHP framework. The examples make use of the Pusher PHP library.
It was built upon the Getting Started with PHP on Heroku example.
The code in this repository provides examples of how to:
- Trigger Events
- Authenticate Private Channel Subscriptions
All the code can be found in web/index.php.
- Authenticating Presence Channel Subscriptions
- Get a list of channels from the Pusher HTTP API
- Handle incoming WebHooks
Make sure you have PHP, Apache and Composer installed. Also, install the Heroku Toolbelt.
$ git clone git@github.com:pusher/pusher-php-silex-auth.git # or clone your own fork
$ cd pusher-php-silex-auth
$ composer update
$ foreman start web
Your app should now be running on localhost:5000.
$ heroku create
$ git push heroku master
$ heroku open
For more information on authenticating Pusher channel subscription see:
- Triggering Events
- Implementing Private Authentication Endpoints
- Implementing Presence Authentication Endpoints
For more information about using PHP on Heroku, see these Dev Center articles: