Menu

Document

Link

PHP Project

Seasar.PHP

PEAR package installation

Download S2Container.version.tgz and execute pear install command.

% pear install /path/to/S2Container.version.tgz
install ok: channel://pear.php.net/S2Container-version

% pear list 
・・・
S2Container             version       state
・・・
%

Require the S2Container.php and S2ContainerSplAutoLoad.php file to enable S2Container.PHP5.

<?php
require_once('S2Container/S2Container.php');
require_once('S2ContainerSplAutoLoad.php');
?>

S2Container.PHP5 uses __autoload function to read class definition files. __autoload function is defined in the S2ContainerSplAutoLoad.php as follows.

<?php
S2ContainerClassLoader::import(S2CONTAINER_PHP5);
if (function_exists('__autoload')) {
    spl_autoload_register('__autoload');
}
spl_autoload_register(array('S2ContainerClassLoader', 'load'));
?>

Full package installation

Download s2container.php5.version.zip and extract files from s2container.php5.version.zip. Following folders will be created:

s2container.php5/
  +-- build/
  +-- docs/
  +-- etc/
  +-- examples/
  +-- src/
  +-- test/
  +-- Apache_Software_License_2.0.txt
  +-- build.xml
  +-- ChangeLog
  +-- S2Container.php

Require the S2Container.php and S2ContainerSplAutoLoad.php file to enable S2Container.PHP5.

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

S2Container.PHP5 uses __autoload function to read class definition files. __autoload function is defined in the S2ContainerSplAutoLoad.php as follows.

<?php
S2ContainerClassLoader::import(S2CONTAINER_PHP5);
if (function_exists('__autoload')) {
    spl_autoload_register('__autoload');
}
spl_autoload_register(array('S2ContainerClassLoader', 'load'));
?>