Download the PHP package phpnomad/di-container without Composer

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

phpnomad/di-container

Latest Version Total Downloads PHP Version License

phpnomad/di-container is the concrete dependency injection container that ships with PHPNomad. It's a single class, PHPNomad\Di\Container\Container, that does reflection-based autowiring and needs no configuration files to work.

The split between interfaces and implementation is deliberate. phpnomad/di defines the contracts (InstanceProvider, HasBindings, DiException). phpnomad/di-container provides the class that implements them. Most applications install both, and installing phpnomad/core pulls them in transitively. PHPNomad has been running in production for years powering Siren and several MCP servers, so this container has been resolving real dependency graphs the whole time.

Installation

Composer will pull in phpnomad/di automatically as a required dependency, so there's nothing else to install for a minimal setup.

Quick Start

Construct the container, bind your abstracts to their concretes, and ask for what you need. Constructor dependencies are resolved recursively by reflection.

If PostRepository's constructor takes a Database parameter, the container hands it the Database instance produced by the factory. Any other typed, non-built-in constructor parameters get resolved the same way, all the way down. A second get(PostRepositoryInterface::class) call returns the same repository instance the first call returned.

Key Concepts

Documentation

Full documentation lives at phpnomad.com. The bootstrapping guide shows how the container composes with Bootstrapper and initializers in a complete application, which is how most PHPNomad projects actually wire their dependency graph.

License

MIT, see LICENSE.txt for the full text.


All versions of di-container with dependencies

PHP Build Version
Package Version
Requires phpnomad/di Version ^2.0
phpnomad/utils 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 phpnomad/di-container contains the following files

Loading the files please wait ...