Download the PHP package mts7/php-dependency-injection without Composer

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

PHP Dependency Injection

PHP Dependency Injection Container

codecov

Installation

Usage

Set

Getting an instantiated object can only happen after the container knows about the class. One way to tell the container about the definition is to use the set method. set can take an alias or fully-qualified class name as the first parameter and a fully-qualified class name, instantiated object, or null as the second parameter.

Full Example

Load

To make things easier for projects, passing the abstract and concrete values to Container can happen through the load method. Provide an array indexed by the abstract ID (key, class name, etc.) with a value of a concretion.

Load handles a variety of parameters, allowing for most implementations to work out-of-the-box. When both the key and value are present, the list of definitions available adds valid values and their keys. When the config array has no key, load uses the value to determine the key (which should be the fully-qualified class name). Each value goes through validation to determine if the concretion provided is a valid class or object. Check the tests for examples.

Load is best used when combined with a factory that provides auto-loading of a preconfigured list of abstractions and their concretions.

Full Example

Get

When a class has its own dependencies, all dependencies can exist once they are set in the container. The container uses auto-wiring through Reflection to determine which parameters are classes and then instantiate each one.

Full Example


All versions of php-dependency-injection with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 mts7/php-dependency-injection contains the following files

Loading the files please wait ....