Download the PHP package kris-ro/php-dependency-injection without Composer

On this page you can find all versions of the php package kris-ro/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 Container

Dependency injection container class for php. Extends kris-ro/php-config functionality and relies on it for configuration.

Installation

Use composer to install PHP Dependency Injection Container.

Configuration

The Container reads the definitoin for the requested service from the config array built by Container::buildConfig().\ All services must be defined in the services branch of the configuration array. Each service is identified by its service idendifier (service_identifier in the example below).\ First key in the definition array must be the class containing the class name prefixed by the namespace and optionally sufixed with the method name. Valid examples:

The class can be followed by other entries in the definition array representing the methods of the created service that will be executed (in the same order as they are listed in the definition) by the container before the service is delivered. Valid examples:

As you can see above, for myPDO the _construct is specified because it needs those three arguments.\ The second definition validator also specifies a method to be executed with one argument rules.

The names of the arguments in the definition are taken from the method.\ If you look at the PDO definition above you'll see that _constructor has three arguments dsn, username and password that are maped to PDO's constructor arguments $pdo, $username and $password respectively.

There are three types of argument values:

Service as argument\ Value of credentialsOrPDO references myPDO service.

Entry path from config array\ Value of rules references validator > rules entry in configuration array.

Usage

Once the service is defined it is as simple as:


All versions of php-dependency-injection with dependencies

PHP Build Version
Package Version
Requires php Version 8.*
kris-ro/php-config Version ^1.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 kris-ro/php-dependency-injection contains the following files

Loading the files please wait ...