root/tags/RELEASE_0_1_2/examples/TestPrimitivesFactory.php

Revision 24, 1.0 kB (checked in by mikey, 2 years ago)

moved ColorPrimitivesFactory? out of ColorPrimitives? class file

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