PHPackages                             machinateur/php-sse - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. machinateur/php-sse

ActiveLibrary

machinateur/php-sse
===================

This package implements Server-sent events in PHP, in a framework-agnostic, low-dependency and object-oriented way.

1.0.0(3y ago)113MITPHPPHP &gt;=5.6

Since May 22Pushed 3y ago2 watchersCompare

[ Source](https://github.com/machinateur/php-sse)[ Packagist](https://packagist.org/packages/machinateur/php-sse)[ Docs](https://github.com/machinateur/php-sse)[ RSS](/packages/machinateur-php-sse/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

php-sse
=======

[](#php-sse)

This package implements Server-sent events in PHP, in a framework-agnostic, low-dependency and object-oriented way.

Prerequisites
-------------

[](#prerequisites)

- [PHP 5.6](https://www.php.net/downloads.php) or newer
- [Composer](https://getcomposer.org/download/)

Yes, you've read that right, PHP 5.6 is the minimum version requirement to be able to use this package. That way, even legacy projects can provide SSE support to client applications.

It might also be a good idea to gobble up all information on [SSE](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events) from the MDN web docs to get yourself up to speed on the technology. I found it to be an excellent starting point on this topic along with low-level examples.

Installation
------------

[](#installation)

Via composer:

```
# install the latest version
composer require "machinateur/php-sse"
```

Usage
-----

[](#usage)

The following is a simple use-case in plain PHP. For a full example (with client code), have a look around the [demo](/demo) directory.

```
