root/trunk/examples/TestPrimitivesFactory.php

Revision 129, 1.0 kB (checked in by mikey, 10 months ago)

renamed XJConfLoader to XJConf

Line 
1 <?php
2 require_once '../XJConf/XJConf.php';
3 use net::xjconf::DefinitionParser;
4 use net::xjconf::XmlParser;
5 error_reporting(E_ALL | E_STRICT);
6
7 require 'ColorPrimitives.php';
8 require 'ColorPrimitivesFactory.php';
9 /**
10  * @author Stephan Schmidt <stephan.schmidt@schlund.de>
11  */
12 class TestPrimitivesFactory
13 {
14
15     public static function main()
16     {
17
18         $tagParser = new DefinitionParser();
19         $defs = $tagParser->parse(getcwd() . '/xml/defines-primitives-factory.xml');
20         
21         $conf = new XmlParser();
22         $conf->setTagDefinitions($defs);
23
24         try {
25             $conf->parse(getcwd() . '/xml/test-primitives.xml');
26         } catch (Exception $e) {
27             throw $e;
28             exit();
29         }
30
31         $color = $conf->getConfigValue('color');
32         echo $color->getRGB();
33         var_dump($color);
34
35         var_dump($conf->getConfigValue('bool'));
36         var_dump($conf->getConfigValue('zahl'));
37
38     }
39 }
40 TestPrimitivesFactory::main();
41 ?>
Note: See TracBrowser for help on using the browser.