root/trunk/examples/TestPrimitives.php

Revision 129, 0.9 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 /**
9  * @author Stephan Schmidt <stephan.schmidt@schlund.de>
10  */
11 class TestPrimitives
12 {
13
14     public static function main()
15     {
16
17         $tagParser = new DefinitionParser();
18         $defs = $tagParser->parse(getcwd() . '/xml/defines-primitives.xml');
19
20         $conf = new XmlParser();
21         $conf->setTagDefinitions($defs);
22
23         try {
24             $conf->parse(getcwd() . '/xml/test-primitives.xml');
25         } catch (Exception $e) {
26             throw $e;
27             exit();
28         }
29
30         $color = $conf->getConfigValue('color');
31         echo $color->getRGB();
32         var_dump($color);
33
34         var_dump($conf->getConfigValue('bool'));
35         var_dump($conf->getConfigValue('zahl'));
36
37     }
38 }
39 TestPrimitives::main();
40 ?>
Note: See TracBrowser for help on using the browser.