mattjmattj/manioc
最新稳定版本:1.0
Composer 安装命令:
composer require mattjmattj/manioc
包简介
An IoC container based on Maybe and Pimple
README 文档
README
An IoC container based on Maybe and Pimple. Manioc actually directly depends on Pimple 3 and extends it with Maybe.
Installation
with composer
composer.phar require mattjmattj/manioc ~1.0
Basic usage
use Manioc\Container; [...] $container = new Container(); // A Manioc container is a Pimple 3 container $container['feature.foo.enabled'] = false; $container['Cache'] = function($c) { new Cache(); } // ...but with Maybe! Here we use a feature switch to build an instance of Foo // and wrap it with Maybe. If feature.foo is disabled, Maybe will provide a fake // object $container['Foo'] = $container->maybe('Foo',function($c) { if ($c['feature.foo.enabled']) { return new Foo(); } }); // we can also register factories: $container['Foo'] = $container->maybeFactory('Foo',function($c) { if ($c['feature.foo.enabled']) { return new Foo(); } });
License
Manioc is licensed under BSD-2-Clause license.
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-2-Clause
- 更新时间: 2015-03-21