tackk / shover
A lightweight PHP interface for the Pusher API
v1.1.2
2015-05-14 17:43 UTC
Requires
- php: >=5.4.0
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: 3.7.*
Suggests
- guzzle/guzzle: If you are making a lot of requests, use Guzzle.
This package is not auto-updated.
Last update: 2024-10-26 14:10:10 UTC
README
A lightweight PHP interface for the Pusher API.
Installation
Composer
"tackk/shover": "1.1.*"
Transports
All transports must extend the Tackk\Shover\Transport\AbstractTransport
.
Two (2) transports are included by default:
Tackk\Shover\Transport\Curl
- Uses the PHP Curl extension.Tackk\Shover\Transport\Guzzle
- Uses Guzzle.
Curl
<?php use Tackk\Shover\Credentials; use Tackk\Shover\Transport\Curl; use Tackk\Shover\Client; require 'vendor/autoload.php'; $credentials = new Credentials('3', '278d425bdf160c739803', '7ad3773142a6692b25b8'); $transport = new Curl($credentials); $client = new Client($transport); $client->trigger('test_channel', 'send', ['message' => 'test']);
Guzzle
Note: You must have Guzzle installed.
<?php use Tackk\Shover\Credentials; use Tackk\Shover\Transport\Guzzle; use Tackk\Shover\Client; require 'vendor/autoload.php'; $credentials = new Credentials('3', '278d425bdf160c739803', '7ad3773142a6692b25b8'); $transport = new Guzzle($credentials); $client = new Client($transport); $client->trigger('test_channel', 'send', ['message' => 'test']);