Skip to content

CodeIgniter library for Pusher PHP SDK

License

Notifications You must be signed in to change notification settings

darkwhispering/pusher-for-codeigniter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Not maintained

This library is no longer activly maintained or updated. It might still work, but use at your own risk.

Pusher PHP SDK for CodeIgniter

This is a simple library that wraps the Pusher PHP library and give you access to the Pusher methods using regular CodeIgniter syntax.

Requirements

Install

  1. Download the library files and add the them to your CodeIgniter installation. Only the library, config and composer.js files are required.
  2. In CodeIgniter /application/config/config.php set $config['composer_autoload'] to TRUE.
  3. Update the pusher.php config file in /application/config/pusher.php with you app details.
  4. Install the Pusher PHP SDK by navigating to your applications folder and execute composer install.
  5. Autoload the library in application/config/autoload.php or load it where you need it with $this->load->library('ci_pusher');.
  6. Enjoy!

How to use

Example to send a new message to the client

$this->load->library('ci_pusher');
$pusher = $this->ci_pusher->get_pusher();
$pusher->trigger('test_channel', 'my_event', array('message' => 'Hello World'));

More detailed documentation can be found in Pusher PHP SDK documentation

Changelog

v2.0.0 - June 2015
  • Created new function that returns the Pusher object.
  • Removed all of the duplicated Pusher function used in previous version.
  • Made small change to debug class name.
  • Updated example code.
v.1.0.0 - April 2015
  • Initial release.