Seasar DI Container with AOP

Setup

Extract files from s2container.php5.version.zip. Following folders will be created:

s2container.php5/
  +-- docs/                ----- Document folder
  +-- src/                 ----- Source code folder
  +-- test/                ----- Test folder
  +-- SEASAR-LICENSE.TXT   ----- Seasar license
  +-- s2container.inc.php  ----- S2Container.PHP5 configuration file

Open the s2container.inc.php file to enable S2Container.PHP5.

<?php
require_once('/path/to/s2container.php5/s2container.inc.php');
?>

About Class Definition AutoLoad

S2Container.PHP5 uses __autoload function to read class definition files.
__autoload function is defined in the s2container.inc.php file.

<?php
...
function __autoload($class=null){
    if(S2ContainerClassLoader::load($class)){return;}
}
...
?>
If __autoload function is already defined by another program, comment out __autoload function in the s2container.inc.php file as follows:
<?php
...
/*
function __autoload($class=null){
    if(S2ContainerClassLoader::load($class)){return;}
}
*/
...
?>
After commenting out the __autoload functin, insert the following 1 for before the __autoload function defined by another program.
if(S2ContainerClassLoader::load($class)){return;}
*** Note: Before __autoload function is loaded, do items in the "required" in the s2container.inc.php file.
*** Note: pass an argument in __autoload function to argument ($class) in S2ContainerClassLoader::load method.