Download the PHP package thecodingmachine/service-provider-registry without Composer

On this page you can find all versions of the php package thecodingmachine/service-provider-registry. 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 service-provider-registry

Scrutinizer Code Quality Build Status Coverage Status

What is it?

This project contains a registry that stores service providers. The registry implements \ArrayAccess and behaves like an array. However, service providers in this object can be instantiated only when the key in the array is fetched, so you don't have to create the instance right away. This is useful for performance considerations, especially for compiled or cached containers.

This class is meant to be used by compiled/cached containers that want to implement container-interop service providers. It is not meant for the mere mortals.

How does it work?

Easy, you create a new Registry object, and then, you push objects in it.

You can also pass parameters to the constructor of the object:

And because we are kind, you can also push into the lazy array an already instantiated object:

Finally, if you are performance oriented (and I'm sure you are, otherwise you wouldn't be looking at this package), you can create the whole registry in one call:

Iterating the registry

The registry implements the \Traversable interface, so iterating it is as simple as a foreach:

Discovery with thecodingmachine/discovery

The registry supports a discovery mechanism based on thecodingmachine/discovery (to automatically find and attach service providers to your application).

As a second parameter, the Registry accepts the Discovery object from thecodingmachine/discovery. Pass this object and thecodingmachine/discovery will be used to fetch service providers from your packages.

Caching of getFactories and getExtensions

You can use the shortcut Registry::getFactories($key) or Registry::getExtensions($key) methods to call the getFactories and getExtensions methods on a service provider. The result is cached: 2 successive calls will not call the getFactories or getExtensions methods twice.

Using the registry to create services

Even better, using the createService method of the registry, you can directly call the service factory:

Using the extendService method of the registry, you can directly call the service extension:

Why?

This was built for improving the performance of service providers loading (in compiled container environment).


All versions of service-provider-registry with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
container-interop/service-provider Version ^0.4
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 thecodingmachine/service-provider-registry contains the following files

Loading the files please wait ....