Skip to content

ziic/dcp-di-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

dcp-di-php

Automatically exported from code.google.com/p/dcp-di-php Simple php dependency injection container.

Example:

$con = new DIContainer();

$d = new DependencyItem(); $d->Name = "UserRepository"; $d->Type = "object"; $d->Value = "DAL\UserRepository"; //for objects uses fullname type $d->Dependencies = array("connectionString", "user", "password"); //list names of other "DependencyItem" items $con->RegistrateDependency($d);

$d = new DependencyItem(); $d->Name = "connectionString"; $d->Type = "string"; $d->Value = DBCHAT_CONNECTION_STRING; $con->RegistrateDependency($d);

$d = new DependencyItem(); $d->Name = "user"; $d->Type = "string"; $d->Value = "root"; $con->RegistrateDependency($d);

$d = new DependencyItem(); $d->Name = "password"; $d->Type = "string"; $d->Value = ""; $con->RegistrateDependency($d);

$repository = $con->ResolveType("UserRepository");

About

Automatically exported from code.google.com/p/dcp-di-php

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages