Download the PHP package moro/container7 without Composer

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

Container7

Latest Version 1.4 Build Status

Container7 is a medium Dependency Injection Container for PHP-7.

This package is compliant with PSR-1, PSR-2, PSR-4 and PSR-11. If you notice compliance oversights, please send a patch via pull request.

Features: providers, singletons, factories, parameters, aliases, tags, configuration, serialization.

Install

Via composer

$ composer require moro/container7

Requirements

Usage

Creating a container is a matter of creating a Container instance:

As many other dependency injection containers, Container7 manages two different kind of data: services and parameters. Services receives from container by their class or alias. Parameters stores in their service "parameters".

For service definition used Service Providers.

Service Providers allow you to package code or configuration for packages that you reuse regularly.

Service provider

Any Service Provider is simple PHP class. Services are defined by methods that return an instance of an object. You must define results of this methods as class or interface. And then you can receive service by that class or interface.

Singleton

Factory

If you want define factory - add variadic argument.

Dependencies

When your service require other, you can add this dependency to method arguments.

Remember, that parameters is service too:

Modifying Services after Definition

In some cases you may want to modify a service definition after it has been defined. You can use method that receive service object and can return null.

If you need to replace the service instance use that definition:

You can add dependencies here as in the definition of factories.

Parameters

Add default parameters.

Set current values of parameters, that replace default values.

And use it.

Aliases

When you can not get service by class or interface, then you must define alias for class, interface or method.

Now you can get service by alias.

Tags

You can group services by setting a common tag for them.

And then get a collection of the services.

Collection implements Iterator interface and you can use it in foreach.

Manipulation with collection

Configuration

Container7 support configuration files in JSON format. You can create provider from that files.

Configuration files can be nested.

Singleton

Factory

Dependencies

Modifying Services after Definition

If you need to replace the service instance use that definition:

Parameters, Aliases and Tags

Dynamic services

License

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


All versions of container7 with dependencies

PHP Build Version
Package Version
Requires psr/container Version 1.0.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 moro/container7 contains the following files

Loading the files please wait ....