Download the PHP package gyselroth/stream-iterator without Composer

On this page you can find all versions of the php package gyselroth/stream-iterator. 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 stream-iterator

php-stream-iterator

Build Status GitHub license Scrutinizer Code Quality Code Coverage GitHub release Latest Stable Version

\StreamIterator\StreamIterator provides a fully PSR-7 compatible stream wrapper for an interator. You may also pass a callback which handles each yielded iterator entry. \StreamIterator is also nicely useable on blocking iterators and/or to create realtime stream responses.

Requirements

Installation

The package is available at packagist an can be installed via composer:

Documentation

The examples use a simple ArrayIterator, of course you may use any kind of traversable object.

Read the whole iterator

Using a callback

Using a callback enables us to operate on each of the yielded iterator elements:

JSON stream example

In this example we create a json output from the example iterator:

(JSON) stream without buffer

This enables a realtime json stream of an iterator. This also allows to operate on blocking iterators where \Iterator::next() blocks until a new entry gets yielded. Each iterator item gets printed as soon as it arrives.

Note Some web server have output buffers or gzip enabled, this will not work with a realtime stream. Be sure that all buffers are completely disabled (For endpoints where a realtime stream is used). For example if you are using Nginx and PHP-FPM you will most likely need to send a header header('X-Accel-Buffering', 'no') to disable the fastcgi nginx buffer. Otherwise nginx will buffer your output.

Changelog

A changelog is available here.

Contribute

We are glad that you would like to contribute to this project. Please follow the given terms.

Thanks

This projects use ideas provided by Matthew Weier O'Phinney phly/psr7examples.


All versions of stream-iterator with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
psr/http-message Version ^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 gyselroth/stream-iterator contains the following files

Loading the files please wait ....