Download the PHP package lusito/tiny-sse without Composer

On this page you can find all versions of the php package lusito/tiny-sse. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tiny-sse

TinySSE

License

TinySSE is small helper to publish Server Sent Events aka EventSource.

Why TinySSE?

Fair warning: PHP is not a good language for SSE or any other push-style communication, since it will use one thread per request. So you should keep the use at a minimum (like for a limited number of users).

Example

A simple example:

Setup

Install via composer:

composer require lusito/tiny-sse

Include the autoloader in your php script, unless you've done that already:

Documentation

Constructor

The constructor takes one optional argument: The number of frames (sleep calls) to count until a comment is flushed to keep the connection alive (int, defaults to 10).

After sleep() has been called this many times without sending anything, a 'noop' comment will be send.

The following headers will be set in the constructor:

sleep()

The sleep() method takes two optional parameters:

If you set ignore_user_abort to true and the connection has been disconnected, this will return false. Otherwise, it will call set_time_limit() with the specified time limit, sleep the specified number of seconds and then return true.

sendComment()

This takes a single string parameter to send as comment. This can contain linebreaks.

The comment will be written to output and flushed.

sendEvent()

This takes 3 parameters:

This event will be written to output and flushed.

Report isssues

Something not working quite as expected? Do you need a feature that has not been implemented yet? Check the issue tracker and add a new one if your problem is not already listed. Please try to provide a detailed description of your problem, including the steps to reproduce it.

Contribute

Awesome! If you would like to contribute with a new feature or submit a bugfix, fork this repo and send a pull request. Please, make sure all the unit tests are passing before submitting and add new ones in case you introduced new features.

License

tiny-sse has been released under the zlib/libpng license, meaning you can use it free of charge, without strings attached in commercial and non-commercial projects. Credits are appreciated but not mandatory.


All versions of tiny-sse with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lusito/tiny-sse contains the following files

Loading the files please wait ....