root/tags/RELEASE_0_2_0/examples/TestPrimitives.php

Revision 18, 0.9 kB (checked in by schst, 2 years ago)

Removed obsolete property, added E_STRICT checks in examples.

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 /**
10  * @author Stephan Schmidt <stephan.schmidt@schlund.de>
11  */
12 class TestPrimitives
13 {
14
15     public static function main()
16     {
17
18         $tagParser = new DefinitionParser();
19         $defs = $tagParser->parse(getcwd() . '/xml/defines-primitives.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 TestPrimitives::main();
41 ?>
Note: See TracBrowser for help on using the browser.