Download the PHP package undercloud/reservoir without Composer

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

Reservoir

Build Status

Inspired by Laravel's Service Container

In software engineering, dependency injection is a technique whereby one object (or static method) supplies the dependencies of another object. A dependency is an object that can be used (a service).

Installation

composer require undercloud/reservoir

Usage

Create container instance:

Instance

You may bind an existing object instance into the container using the instance method. The given instance will always be returned on subsequent calls into the container:

Singleton

The singleton method binds a class or interface into the container that should only be resolved one time. Once a singleton binding is resolved, the same object instance will be returned on subsequent calls into the container:

Bind

We can register a binding using the bind method, passing the class or interface name that we wish to register along with a Closure that returns an instance of the class:

A very powerful feature of the service container is its ability to bind an interface to a given implementation:

Alias

To support both a class/interface and a short name simultaneously, use alias:

Decorator

If you want to add additional functionality to an existing binding in the container, use the decorator method:

Fork

Sometimes it is required to create a copy of an existing entity in a container, it is possible to do this via the fork method, the existing binding will be retrieved from the container and cloned:

Resolve

make

Simple entity extraction:

Resolve class:

Resolve method:

Magic __invoke

Extract entity by Closure:

Extra parameters

The make method has a second $additional argument that helps pass parameters that are not in the container:

makes

Retrieving entity list:

Binding Primitives

Sometimes you may have a class that receives some injected classes, but also needs an injected primitive value such as an integer. You may easily use contextual binding to inject any value your class may need:

Contextual Binding

Sometimes you may have two classes that utilize the same interface, but you wish to inject different implementations into each class:

ServiceProvider

All service providers extend the Reservoir\ServiceProvider class. Most service providers contain a register method:

Register service provider:

Deferred providers

If your provider is only registering bindings in the service container, you may choose to defer its registration until one of the registered bindings is actually needed. Deferring the loading of such a provider will improve the performance of your application, since it is not loaded from the filesystem on every request:

Register deferred service provider:

Utils

has

Check if key registered:

keys

Get all registered keys:

forget

Remove instance:

flush

Clear all registered keys:


All versions of reservoir with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
phpunit/phpunit Version ~4.8|~5.7
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 undercloud/reservoir contains the following files

Loading the files please wait ....