S2Container.PHP Project
% cat quickstart.php <?php require_once('S2Container.php'); class Action { public $service; } class Service { public $dao; } class Dao { private $pdo; public function setPdo(PDO $pdo) { $this->pdo = $pdo; } } s2component('PDO')->construct(function(){ return new PDO('sqlite::memory:'); }); var_dump(s2get('Action')); % |
% % php quickstart.php object(Action)#36 (1) { ["service"]=> object(Service)#51 (1) { ["dao"]=> object(Dao)#67 (1) { ["pdo":"Dao":private]=> object(PDO)#72 (0) { } } } } % |
Download
- 2010-03-08
Full Package : s2container.php-2.0.3.tar.gz Pear Package : S2Container-2.0.3.tgz - 2009-11-21
Full Package : s2container.php-2.0.2.tar.gz Pear Package : S2Container-2.0.2.tgz - 2009-08-02
Full Package : s2container.php-2.0.1.tar.gz Pear Package : S2Container-2.0.1.tgz - 2009-07-11
Full Package : s2container.php-2.0.0.tar.gz Pear Package : S2Container-2.0.0.tgz - ChangeLog (japanese)
Environment
S2Container.PHP is tested on the following environment.
- CentOS 5.2 : php-5.3.2