Download the PHP package denosyscore/container without Composer

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

denosyscore/container

A PSR-11 compliant dependency injection container for PHP 8.2+. Supports autowiring, contextual bindings, tagged services, lazy proxies, scoped lifetimes, method injection, decorators, and built-in testing and profiling utilities.

PHP ^8.2 License MIT

Requirements

Installation

Quick Start

Autowiring

The container inspects constructor type-hints and resolves dependencies automatically. No explicit registration is needed for concrete classes:

Union-typed parameters are tried in order. Nullable and defaulted parameters fall back gracefully without throwing.

Explicit Bindings

bind()

Register an abstract (interface or string key) to a concrete implementation or factory closure:

singleton()

Resolved once; the same instance is returned on every subsequent call:

instance()

Register a pre-built object as a shared instance:

alias()

Create a short name for a bound abstract. The abstract must already be bound or be an instantiable class:

extend()

Wrap an existing binding or resolved instance with additional behavior:

Contextual Bindings

Inject different implementations of the same interface depending on which class is requesting it:

Supply all services tagged with a given tag to a context:

Tagged Services

Group related bindings under a shared tag and resolve all of them at once:

A single abstract can carry multiple tags:

Scoped Bindings

Override bindings within a bounded scope. The original bindings are automatically restored when the callable returns:

Lazy Loading

Defer resolution until the first method call. Useful for expensive services that may not be needed on every request path:

The proxy implements Denosys\Container\LazyProxy and transparently forwards all method calls to the underlying instance once triggered.

Method Injection

call()

Invoke any callable with automatic injection of type-hinted parameters:

callStatic()

Call a static method with automatic injection:

Decorators

decorate()

Wrap a resolved service. Multiple decorators are applied in descending $priority order (higher runs first):

middleware()

Middleware behaves like a decorator without priority ordering. Applied in registration order, after all decorate() layers:

Testing Utilities

mock()

Replace a binding with a test double. Mocks take priority over all other bindings and are never decorated:

spy()

Wrap a real service instance to track its resolution count and timing without replacing it:

Container Validation

Check for misconfigured or unresolvable bindings without instantiating anything:

ValidationIssue severity levels: error, warning, info.

Performance

getPerformanceMetrics()

Returns a PerformanceReport with timing, cache ratios, and memory stats accumulated since the container was constructed:

getResolutionHistory()

Returns a ring-buffer of recent resolution records (default limit: 1000 entries):

Lower the ring-buffer size to reduce memory overhead:

License

MIT


All versions of container with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
psr/container Version ^2.0
denosyscore/contracts Version ^0.2
denosyscore/events Version ^0.2
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 denosyscore/container contains the following files

Loading the files please wait ...