Download the PHP package thesis/di without Composer

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

Thesis Dic

A fresh take on the PHP dependency injection container, with all the features you expect.

Requirements

Contents

Installation

Quick start

This guide covers only a fraction of what Dic can do — just enough to get you started.

Dic

The Thesis\Dic class is the heart of container configuration. It lets you declare services, require modules, subscribe to events and more.

Module

A module is the unit of composition: you compose your application from modules, and the application itself is just the root module.

A module is a class implementing Thesis\Dic\Module: it receives a Dic, declares services, and returns whatever it exports — usually a Ref<T>.

Ref

No string identifiers to invent — they aren't type-safe. Instead, declaring a service returns a Thesis\Dic\Ref<T>, its handle and identifier, with T inferred from configuration:

A ref is the service's identity: a distinct ref is a distinct service. Assign it to a variable and pass it around to inject, import or export.

Declaring services

Use object() to declare an object service, and arg() to override individual constructor arguments:

The $logger ref is passed as a constructor argument — that's how services get wired together. See Arguments for named, positional and variadic arguments.

Putting it all together

A module can depend on services it doesn't declare itself: accept them as constructor arguments and wire them in.

To use a module inside another one, call import() and get whatever that module exports. See Modularity for how import() isolates modules and when to use apply() instead.

To run an application, pass the root module to Dic::run() together with $main — a function that receives the resolved service. The container builds, calls $main, and disposes everything afterwards — even on failure:

For tests and debugging, Dic::build() returns the resolved module's export without disposing anything:

Documentation


All versions of di with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4.12
symfony/polyfill-php85 Version ^1.37
thesis/formatter Version ^0.1
typhoon/type Version ^0.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 thesis/di contains the following files

Loading the files please wait ...