Download the PHP package andydune/pipeline without Composer

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

AndyDune\Pipeline

Build Status Packagist Version Total Downloads

This package provides a pipeline pattern implementation. It is based on middleware approach.

Requirements

PHP version >= 7.1

For php 5.6 use version 1:

Installation

Installation using composer:

Or if composer was not installed globally:

Or edit your composer.json:

And execute command:

Usage

Operations in pipeline stages, can be anything that satisfies the callable type-hint. So closures and anything that's invokable is good.

Types of stages

Basically each stage can be Closure:

It can be an instance of class with callable interface:

It can be an instance of class with any method:

It can be a class name with method __invoke or any method you describe:

It can be a class name with any method you describe:

Use object for stage without middleware interface

You can use methods which don't execute $next function. It gets some data and return results. There is special method: 'pipeForContainer'

Example class.

Container provider (service provider)

String can de passed as pipeline stage. By default it is a class name. It's make possible by using default provider: AndyDune\Pipeline\PipeIsClassName
You can set your own provider, with injections you need. Your class must implements interface: Interop\Container\ContainerInterface

If was not found stage with your provider system will try to use default provider. There is stack of providers.

Use your provider as parameter for pipeline constructor:

Additional parameters for stage

Sometimes you need to pass any number of additional parameters to pipe stage during description. It needs for test and it very good for more flexibility of stage. It increases reuse of class.

Lets look at the example. It is very simple example.

Here is example class for stage:

Lets use it:

Dependency injection

You can use default pipeline stage creator with injection into stage objects services or any objects from outside.

There is injection with interfaces.

This use method addInitializer which receive callable parameter.

Exceptions

Package has not integrated exception catch support. It is simple for you to include exception try-catch block into one of pipeline stages.

There is a class you may use as stage for your pipeline for catch exception in this package.

Examples

Caching

You have service for retrieve data. And you don't need to change its code. Just use it as a stage in the pipeline.

Usage within Zend FW 3

By default string as stage for pipeline means name of class. If you create pipeline object without parameters service container implements AndyDune\Pipeline\PipeIsClassName. It only creates instance of given class and return it. If this package is used as part of of Zend FW 3 you can use Zend's services for retrieve instances.

First you must install package with composer. Then copy file vendor/andydune/pipeline/config/pipeline.global.php to config/autoload/pipeline.global.php

Description fot your pipeline in factory:

If you don't work with Zend services use pipeline directly.

Analogues

Laravel pipeline - it do very the same I wanted, but I need more tools for testing purpose. And I don't like laraver service manager. it has not common interface. My pipeline may use service managers based on container-interop with PSR-11 interfaces.

League\Pipeline - it has good documentation. But has bad feature - poor workflow control. To stop execution it need to use exception.


All versions of pipeline with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
container-interop/container-interop Version ^1.1
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 andydune/pipeline contains the following files

Loading the files please wait ....