|
Revision 53, 1.1 kB
(checked in by mikey, 2 years ago)
|
added possibility of dynamic types (proof of concept, more work has to be put into this if it gets approved)
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
require_once '../XJConf/XJConfLoader.php'; |
|---|
| 9 |
XJConfLoader::load('DefinitionParser', |
|---|
| 10 |
'XmlParser' |
|---|
| 11 |
); |
|---|
| 12 |
|
|---|
| 13 |
require_once 'AnotherClass.php'; |
|---|
| 14 |
require_once 'MyClass.php'; |
|---|
| 15 |
require_once 'MyCollector.php'; |
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
class TestDynamicTypes |
|---|
| 24 |
{ |
|---|
| 25 |
public static function main() |
|---|
| 26 |
{ |
|---|
| 27 |
$tagParser = new DefinitionParser(); |
|---|
| 28 |
$defs = $tagParser->parse(getcwd() . '/xml/defines-dynamic-types.xml'); |
|---|
| 29 |
|
|---|
| 30 |
$conf = new XmlParser(); |
|---|
| 31 |
$conf->setTagDefinitions($defs); |
|---|
| 32 |
|
|---|
| 33 |
try { |
|---|
| 34 |
$conf->parse(getcwd() . '/xml/test-dynamic-types.xml'); |
|---|
| 35 |
} catch (Exception $e) { |
|---|
| 36 |
echo $e->getMessage(); |
|---|
| 37 |
var_dump($e->getTrace()); |
|---|
| 38 |
exit(0); |
|---|
| 39 |
} |
|---|
| 40 |
|
|---|
| 41 |
$foo = $conf->getConfigValue('foo'); |
|---|
| 42 |
var_dump($foo); |
|---|
| 43 |
} |
|---|
| 44 |
} |
|---|
| 45 |
TestDynamicTypes::main(); |
|---|
| 46 |
?> |
|---|