2.7. Setup with DICON file

Let's set up the before-mentioned all setting by DICON file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container//EN" "components21.dtd">
    <component class="Action"/>
    <component class="Service">
        <aspect pointcut="/^add$/">trace</aspect>
    <component class="Dao">
        <aspect pointcut="/^findById$/">trace</aspect>
    <component class="seasar\aop\interceptor\TraceInterceptor" name="trace"/>

Reading of the DICON file is performed by the s2import function. Requiring of the classes of the classes directory is performed by the import method of seasar\util\ClassLoader class.

use seasar\util\ClassLoader as s2loader;

s2loader::import(dirname(__FILE__) . '/classes');
s2import(dirname(__FILE__) . '/quickstart050.dicon');

$action = s2get('Action');

This Example is located at "examples/quickstart/quickstart050.php".

© Copyright The Seasar Foundation and the others 2005-2010, all rights reserved.