ovo-container


PHP Inversion of Control/Dependency Injection Framework

The projects has been moved to https://github.com/db80/ovo-container'>github.

Introduction to Ovo Container, a Dependency Injection Framework

Ovo Container is a lightweight Dependency Injection / Inversion of control Framework for php5.

It is inspired by spring framework but it is pure php5 implementation.

On the net, you can find a lot of documentation on how to use this pattern. Some of the best articles are: * http://martinfowler.com/articles/injection.html * http://www.theserverside.com/news/1321158/A-beginners-guide-to-Dependency-Injection * http://www.vogella.de/articles/SpringDependencyInjection/article.html

Main Goals

The goals are: * Separates behaviour from dependency resolution, thus decoupling highly dependent components. * Easy unit-test and reusability of the code * lightweight! the "bean" can be any php class (No need to implement interface or respect some requirement) * Scope management. A single class can have different "beans" scope 1. Singleton: Scopes a single bean definition to untill the http's request ending 1. Session: Scopes a single bean definition to the lifecycle of a HTTP Session. 1. Prototype: Scopes a single bean definition to any number of object instances. * All beans with scope singleton or prototype can be created at application loading or lazily created (bean and its dependencies are created only when you call the getBean("myBean") method on the container) * Differents way to resolve dependencies * Minimal XML Configuration (reflection is used to resolve dependencies) * XML Properties (available all over the application) and INI file configuration * Hooks pre bean creation * Filters after bean creation * Filters and Hooks are extendible * Easy to install. Just include one single file * Easy integration with other framework as Zend Framework, Symfony,Cakephp, ecc * Focuses your application only on the business logic * Example and unit test (PHPUnit) are available on download section

Project Information

Labels:
PHP DI IOC InversionofControl Framework DependencyInjection PHP5 Container