Download the PHP package spriebsch/di without Composer

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

DI Container

A lightweight, smart and fast Dependency Injection (DI) container with auto-wiring, supporting custom factories and virtual types. It follows an "as modular as possible" approach and requires no separate build or compilation step.

Installation

Basic Usage

To use the DI container, you need a configuration object (implementing Configuration) and one or more factory classes (extending AbstractFactory).

Autowiring

The container automatically resolves dependencies by inspecting the constructor of the requested class. Dependencies must be type-hinted with a class or interface name.

Scalar dependencies cannot be auto-wired. You must write a factory method to handle them.

Custom Factories

You can define custom factory methods in your factory class. The container looks for methods matching the class name (short name or long name).

Short Name Factory Method

If you request Project\Namespace\MyService, the container looks for a method named MyService in the factory.

Long Name Factory Method

If multiple classes have the same short name, you can use the fully qualified class name with backslashes replaced by underscores.

Virtual Types

Virtual types allow you to request a name that does not correspond to an existing class or interface. This is useful for named instances or configurations.

Passing Parameters

You can pass additional parameters to the get() method. These parameters are passed to the factory method.

Multiple Factories

You can provide multiple factory classes. The container will search for a handling factory in the order they are provided. If the first factory cannot create the type, it delegates to the next one.

This is particularly useful when using frameworks or libraries that have their own factories.

Using Configuration

Factories have access to the configuration object.

License

Copyright (c) 2025-2026, Stefan Priebsch [email protected]

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.


All versions of di with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
ext-sqlite3 Version *
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 spriebsch/di contains the following files

Loading the files please wait ...