This is a simple library that wraps the Pusher PHP library and give you access to the Pusher methods using regular CodeIgniter syntax.
- CodeIgniter 3+
- Pusher PHP SDK
- Composer
- PHP 5.3.2+
- Download the library files and add the them to your CodeIgniter installation. Only the library, config and composer.js files are required.
- In CodeIgniter
/application/config/config.php
set$config['composer_autoload']
toTRUE
. - Update the pusher.php config file in
/application/config/pusher.php
with you app details. - Install the Pusher PHP SDK by navigating to your applications folder and execute
composer install
. - Autoload the library in
application/config/autoload.php
or load it where you need it with$this->load->library('ci_pusher');
. - Enjoy!
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
- 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.
- Initial release.