Download the PHP package lumax/dependency-injection-component without Composer
On this page you can find all versions of the php package lumax/dependency-injection-component. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lumax/dependency-injection-component
More information about lumax/dependency-injection-component
Files in lumax/dependency-injection-component
Package dependency-injection-component
Short Description A Dependency Injection Package
License GPL-3.0-or-later
Informations about the package dependency-injection-component
Luma | Dependency Injection Component
A PHP package for managing dependencies and dependency injection.
Installation
You can install this package via Composer:
Usage
DependencyContainer
The DependencyContainer
class provides a simple way to manage and retrieve dependencies. You can add and retrieve
dependencies as follows:
DependencyManager
The DependencyManager
class allows you to load dependencies from a YAML configuration file and register them in a
DependencyContainer
. Here's an example of how to use it:
In your YAML configuration file (dependencies.yaml
), you can define services and their arguments for injection.
Setting Up Your Services/Dependencies Definitions
Here's an example of a dependencies.yaml
file that demonstrates how to define services and their arguments for injection:
Here's a breakdown of the elements in the dependencies.yaml file:
services
: This section defines the services and their configurations.alias
: Your chosen alias for the service -myService
.class
: The fully qualified class name of the service class.arguments
: An array of constructor arguments. Use "@" to reference other services.
Once you've set up your dependencies.yaml
file with the desired services and configurations, you can load and manage
these dependencies using the Dependency Injection Package.
License
This package is open-source software licensed under the GNU General Public License, version 3.0 (GPL-3.0).
All versions of dependency-injection-component with dependencies
psr/container Version ^2.0
lumax/framework-component Version ^1.1