Download the PHP package uma/dic without Composer

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

uma/dic

CI Code Coverage

A PSR-11 container focused on human readability and comprehension.

Installation

Design Goals

Simplicity

A dependency injection container is a rather simple concept and its implementation should be simple, too.

PSR-11 compliance

It must implement the PSR-11 spec, and be usable wherever a PSR-11 container is to be expected.

Setter

It must have a standard way to add dependencies to the container as well as retrieve them. Using a Dependency Injection Container involves these two operations, not just getting them (I'm looking at you PSR-11).

To that end the Container class has a set method and also accepts an optional array of type string => mixed in its constructor, which is equivalent to calling set($id, $entry) with each of its key-value pairs.

Moreover, definitions have to be overridable, because definition overrides are a common approach in testing contexts.

Lazy loading

It must be possible to register lazy services. These are services that are not instantiated until they are actually retrieved for the first time.

This library implements lazy services with anonymous functions. Whenever the container is asked for a service that is actually an anonymous function, that function is executed (passing the container itself as the first parameter) and the result is stored under the same id where the anonymous function used to be.

In addition, the container has a resolved method that returns whether a given service is an anonymous function or not. This can be useful when you need to assert whether a given service has been actually called (or not) on test code.

Providers

When a project involves large numbers of services these can be organized in Provider classes.

These classes implement UMA\DIC\ServiceProvider and receive an instance of the container in their provide method. They are then expected to register sets of related services in it. This concept is borrowed from Pimple.

Service Factories

In a few niche cases it can be desirable to create a new instance of the service every time it's requested from the container.

Like lazy loading, service factories are implemented using anonymous functions. However, they are registered with the factory method instead of set.


All versions of dic with dependencies

PHP Build Version
Package Version
Requires php Version ~8.2.0 || ~8.3.0 || ~8.4.0
psr/container Version ^2.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 uma/dic contains the following files

Loading the files please wait ....