PHP Extension for Pusher, cutting my teeth with PHP extensions
C
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README
config.m4
hmac_sha2.c
hmac_sha2.h
md5.c
md5.h
php_pusher.c
php_pusher.h
pusher.c
sha2.c
sha2.h

README

Pusher API Extension

Right now, this extension is only designed for Linux systems.  
Perhaps in the future, I'll look at building it on a Win box.

To install it, you must have the PHP source for your version.  Then run the following commands.

$ cd /path/to/php-5.4.0/ext
$ git clone git://github.com/payden/pusher.git
$ cd pusher
$ phpize && ./configure && make
$ sudo make install

Provided there isn't a problem building, this will put pusher.so in your extensions directory.
This is usually in /usr/local/lib/php/extensions somewhere.

You may or may not need to ensure you're 'extension_dir' directive in php.ini points to the correct path.

Then all you have to do is add a 'extension=pusher.so' line to your php.ini and restart php.


Now, to use the class the extension implements.

$pusher = new Pusher('api_key_from_pusher', 'api_secret_from_pusher', app_id_from_pusher);
$pusher->trigger('channel','event','json_encoded_string');

For example:

$obj = new StdClass();
$obj->name = "Payden Sutherland";
$obj->email = "payden@paydensutherland.com";
$pusher = new Pusher('59e7d83ee9fb65bfe028', 'mysecretkey', 16648);
$pusher->trigger('test_channel','weeeee', json_encode($obj));