Download the PHP package caridea/container without Composer
On this page you can find all versions of the php package caridea/container. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download caridea/container
More information about caridea/container
Files in caridea/container
Package container
Short Description A shrimp of a dependency injection library
License Apache-2.0
Homepage http://github.com/libreworks/caridea-container
Informations about the package container
caridea-container
Caridea is a miniscule PHP application library. This shrimpy fellow is what you'd use when you just want some helping hands and not a full-blown framework.

This is its PSR-11 compliant dependency injection container.
Installation
You can install this library using Composer:
- The master branch (version 3.x) of this project requires PHP 7.1 and depends on
caridea/event. - Version 2.x of this project requires PHP 7.0 and depends on
caridea/event. - Version 1.x of this project requires PHP 5.5 and depends on
caridea/event.
Compliance
Releases of this library will conform to Semantic Versioning.
Our code is intended to comply with PSR-1, PSR-2, and PSR-4. If you find any issues related to standards compliance, please send a pull request!
Overview
- The
Caridea\Container\Propertiesclass is intended for scalar configuration values that might be used as settings for other components. - The
Caridea\Container\Objectsclass allows for eager, lazy, and prototype objects.- It also implements
Caridea\Event\Publisherand will broadcast events to any managed object which implementsCaridea\Event\Listener.
- It also implements
- The
Caridea\Container\EmptyContainerclass is an empty, no-op container.
You can retrieve contained objects both by name and by type!
Documentation
- Head over to Read the Docs
Examples
Just a few quick examples.
Configuration and Dependencies
Parent Delegation
You can nest Objects containers. For example, you can have a container with service objects and a child container with web controllers.
Events
Any objects returned from an Objects container that implement \Caridea\Event\PublisherAware will receive the container via the setPublisher method.
ContainerAware
Any objects returned from an Objects container that implement \Caridea\Container\ContainerAware will receive the container via the setContainer method.
We provide a trait to make this easier.

