library simple-container
SimpleContainer is a simple service container with dependency injection.
stanlemon/simple-container
SimpleContainer is a simple service container with dependency injection.
- Thursday, December 27, 2012
- by stanlemon
- Repository
- 0 Watchers
- 1 Stars
- 4 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 4 Versions
- 0 % Grown
SimpleContainer
, (*1)
SimpleContainer is a basic service container, it can store key => value objects and lazily load them using Closures. It also includes a newInstance() method which allows you to inject dependencies through constructors and setters providing for very basic dependency injection., (*2)
Example usages
Basic loading of services and retrieving of them
// Create the SimpleContainer
$container = new SimpleContainer();
// Set a service
$container->set('foo', function(){
return new Foo();
});
// Get the service
$foo = $container->get('foo');
// Create a new class with services populaed
$bar = $container->newInstance('bar');
$bar->getFoo();
dev-master
9999999-dev
http://stanlemon.net
SimpleContainer is a simple service container with dependency injection.
Sources
Download
MIT
The Requires
dependency injection
di
autowire
v0.1.1
0.1.1.0
http://stanlemon.net
SimpleContainer is a simple service container with dependency injection.
Sources
Download
MIT
The Requires
dependency injection
di
autowire
dev-develop
dev-develop
http://stanlemon.net
SimpleContainer is a simple service container with dependency injection.
Sources
Download
MIT
The Requires
dependency injection
di
autowire
v0.1.0
0.1.0.0
http://stanlemon.net
SimpleContainer is a simple service container with dependency injection.
Sources
Download
MIT
The Requires
dependency injection
di
autowire