2017 © Pedro Peláez
 

library yii2-sse

Yii2 SSE is a wrapper for the library libSSE-php. Its used for managing Server Sent Events in Yii2.

image

odannyc/yii2-sse

Yii2 SSE is a wrapper for the library libSSE-php. Its used for managing Server Sent Events in Yii2.

  • Thursday, July 28, 2016
  • by odannyc
  • Repository
  • 1 Watchers
  • 3 Stars
  • 2,470 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 20 % Grown

The README.md

yii2-sse

Yii2 SSE is a wrapper for the library libSSE-php. Its used for managing Server Sent Events in Yii2., (*1)

Installation

You'll be installing this package through composer., (*2)

Run this command within your project folder: composer require odannyc/yii2-sse, (*3)

Usage

These steps are for the simple/basic Yii2 project., (*4)

Edit your web.php config file which is located usually in app/config/web.php, (*5)

``` php 'components' => [ ... 'sse' => [ 'class' => \odannyc\Yii2SSE\LibSSE::class ] ... ];, (*6)


You'll have to create a handler for your SSE instance. Usually located in `app/sse/`. ```php use odannyc\Yii2SSE\SSEBase; class MessageEventHandler extends SSEBase { public function check() { return true; } public function update() { return "Something Cool"; } }

Then, anywhere in your controller:, (*7)

php public function actionIndex() { $sse = Yii::$app->sse; $sse->addEventListener('message', new MessageEventHandler()); $sse->start(); }, (*8)

More information

For more information on using the SSE functionalites of this package visit: https://github.com/licson0729/libSSE-php, (*9)

The Versions

28/07 2016

dev-master

9999999-dev

Yii2 SSE is a wrapper for the library libSSE-php. Its used for managing Server Sent Events in Yii2.

  Sources   Download

The Requires

 

by Danny Carrillo

28/07 2016

v0.1

0.1.0.0

Yii2 SSE is a wrapper for the library libSSE-php. Its used for managing Server Sent Events in Yii2.

  Sources   Download

The Requires

 

by Danny Carrillo