Download the PHP package chefhasteeth/pipeline without Composer

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

Pipelines, Supercharged!

Example code showcasing the Pipeline package using the with transaction method and the pipable trait

Installation

Install via composer:

What are pipelines used for?

A Pipeline allows you to pass data through a series of pipes to perform a sequence of operations with the data. Each pipe is a callable piece of code: An invokable class, a closure, etc. Since each pipe operates on the data in isolation (the pipes don't know or care about each other), then that means you can easily compose complex workflows out of reusable actions that are also very easy to test—because they aren't interdependent.

What makes it supercharged?

If Laravel is the batteries included PHP Framework, then this package can be considered the batteries included version of the Illuminate\Pipeline\Pipeline class. It remains (mostly) compatible with Laravel's pipeline, but there are a few differences and added features.

For example, do you see that withTransaction() method above? That will tell the Pipeline that we want to run this within a database transaction, which will automatically commit or roll back at the end, depending on whether the pipeline succeeded or failed. It also comes with a trait that gives you a pipeThrough() method to automatically send the object it's implemented on through a pipeline.

What are the differences?

In Laravel's Pipeline class, pipes are essentially callables that receive two arguments: The $passable, which is the data passed to the pipe, and a $next callback that calls the next pipe.

For the purposes of this package, I wanted my pipes to be used easily from anywhere, not just in the pipeline. (For example, this could take the form of a GenerateThumbnail action that appears as part of a pipeline, but also might appear in a cron job.) In other words, I don't want to have to pass an empty closure to the class or function to satisfy that $next argument.

That's the biggest difference between this package and Laravel's Pipeline: The output of the current pipe is the input of the next pipe.

Sending pipes down the pipeline

When configuring the pipeline, you can send an array of class strings, invokable objects, closures, objects with a handle() method, or any other type that passes is_callable().

Another approach you can take is to implement this as a trait on a data object. (You could even implement it on your FormRequest object if you really wanted.)

To maintain compatibility with Laravel's Pipeline class, the through() method can accept either a single array of callables or multiple parameters, where each parameter is one of the callable types listed previously. However, the pipeThrough() trait method only accepts an array, since it also has a second optional parameter.

Using database transactions

When you want to use database transactions in your pipeline, the method will be different depending on if you're using the trait or the Pipeline class.

Using the Pipeline class:

The withTransaction() method will tell the pipeline to use transactions. When you call the then() or thenReturn() methods, a database transaction will begin before executing the pipes. If an exception is encountered during the pipeline, the transaction will be rolled back so no data is committed to the database. Assuming the pipeline completed successfully, the transaction is committed.

When using the trait, you can pass a second parameter to the pipeThrough() method:

Testing

License

The MIT License (MIT). Please see LICENSE for more information.


All versions of pipeline with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1.0
laravel/framework Version ^9.0|^10.0|^11.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 chefhasteeth/pipeline contains the following files

Loading the files please wait ....