root/trunk/examples/ExampleCollection.php

Revision 129, 1.0 kB (checked in by mikey, 1 year ago)

renamed XJConfLoader to XJConf

Line 
1 <?php
2 /**
3  * Example that shows how to use arrays.
4  *
5  * @author  Stephan Schmidt <stephan.schmidt@schlund.de>
6  * @author  Frank Kleine <frank.kleine@schlund.de>
7  */
8 require_once '../XJConf/XJConf.php';
9 use net::xjconf::DefinitionParser;
10 use net::xjconf::XmlParser;
11 require 'Color.php';
12 require 'Complex.php';
13 require 'UpperString.php';
14 /**
15  * Example that shows how to use arrays.
16  *
17  * @package     XJConf
18  * @subpackage  examples
19  */
20 class ExampleCollection
21 {
22     public static function main()
23     {
24         $tagParser = new DefinitionParser();
25         $defs      = $tagParser->parse(getcwd() . '/xml/defines-collection.xml');
26
27         $conf = new XmlParser();
28         try {
29             $conf->setTagDefinitions($defs);
30     
31             $conf->parse(getcwd() . '/xml/test-collection.xml');
32         } catch (Exception $e) {
33             echo $e->getTraceAsString();
34             exit(0);
35         }
36         
37         $list = $conf->getConfigValue('list');
38         var_dump($list);
39     }
40 }
41 ExampleCollection::main();
42 ?>
Note: See TracBrowser for help on using the browser.