root/branches/PRE_NAMESPACES/examples/ExampleCollection.php

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

converted ExampleCollection?

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/XJConfLoader.php';
9 XJConfLoader::load('DefinitionParser',
10                    'XmlParser'
11 );
12 require 'Color.php';
13 require 'Complex.php';
14 require 'UpperString.php';
15 /**
16  * Example that shows how to use arrays.
17  *
18  * @package     XJConf
19  * @subpackage  examples
20  */
21 class ExampleCollection
22 {
23     public static function main()
24     {
25         $tagParser = new DefinitionParser();
26         $defs      = $tagParser->parse(getcwd() . '/xml/defines-collection.xml');
27
28         $conf = new XmlParser();
29         try {
30             $conf->setTagDefinitions($defs);
31     
32             $conf->parse(getcwd() . '/xml/test-collection.xml');
33         } catch (Exception $e) {
34             echo $e->getTraceAsString();
35             exit(0);
36         }
37         
38         $list = $conf->getConfigValue('list');
39         var_dump($list);
40     }
41 }
42 ExampleCollection::main();
43 ?>
Note: See TracBrowser for help on using the browser.