Download the PHP package webpt/aquaduck without Composer

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

Aquaduck

This package is heavily inspired by zendframework/zend-strategility zendframework/zend-strategility.

Installation and Requirements

Install this library using composer:

Usage

Creating a processing pipeline is trivially easy:

Middleware

What is middleware?

Middleware is code that exists which can take the incoming value (or object), perform actions based on it, and either return or pass delegation on to the next middleware in the queue.

Within Aquaduck, middleware can be:

Error Handlers

To handle errors, you can write middleware that accepts exactly 3 arguments:

Alternately, you can implement Webpt\Aquaduck\ErrorHandler\ErrorHandlerInterface.

When using Aquaduck, as the queue is executed, if $next() is called with an argument, or if an exception is thrown, middleware will iterate through the queue until the first such error handler is found. That error handler can either complete the request, or itself call $next(). Error handlers that call $next() SHOULD call it with the error it received itself, or with another error.

Error handlers are usually attached at the end of middleware, to prevent attempts at executing non-error-handling middleware, and to ensure they can intercept errors from any other handlers.

Creating Middleware

To create middleware, write a callable capable of receiving minimally a single argument, and optionally a callback to call the next in the chain. If your middleware accepts a second argument, $next, if it is unable to complete the request, or allows further processing, it can call it to return handling to the parent middleware.

Middleware written in this way can be any of the following:

Executing and composing middleware

The easiest way to execute middleware is to write closures and attach them to a Webpt\Aquaduck\Aquaduck instance. You can nest Aquaduck instances to create groups of related middleware.

API

The following make up the primary API of Aquaduck.

Middleware

Webpt\Aquaduck\Aquaduck is the primary application interface, and has been discussed previously. Its API is:

bind() takes up to two arguments. If only one argument is provided, $middleware will be assigned that value, and $priority will be assigned to the value 1.

Middleware is executed in the order in which $priority is determined.

__invoke() is itself middleware. If $out is not provided, an instance of Webpt\Aquaduck\FinalHandler will be created, and used in the event that the pipe stack is exhausted. The callable should use the same signature as Next():

Internally, Aquaduck creates an instance of Webpt\Aquaduck\Next, feeding it its queue, executes it, and returns a response.

Next

Webpt\Aquaduck\Next is primarily an implementation detail of middleware, and exists to allow delegating to middleware registered later in the stack.

As examples:

Providing an altered subject:

Raising an error condition

To raise an error condition, pass a non-null value as the second argument to $next():

FinalHandler

Webpt\Aquaduck\FinalHandler is a default implementation of middleware to execute when the stack exhausts itself. It expects two arguments when invoked: a subject, and an error condition (or null for no error).


All versions of aquaduck with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.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 webpt/aquaduck contains the following files

Loading the files please wait ....