|
Revision 18, 1.0 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 |
'ext.xinc.XInclude' |
|---|
| 6 |
); |
|---|
| 7 |
error_reporting(E_ALL | E_STRICT); |
|---|
| 8 |
|
|---|
| 9 |
require 'ColorPrimitives.php'; |
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
class TestPrimitives |
|---|
| 14 |
{ |
|---|
| 15 |
|
|---|
| 16 |
public static function main() |
|---|
| 17 |
{ |
|---|
| 18 |
|
|---|
| 19 |
$tagParser = new DefinitionParser(); |
|---|
| 20 |
$defs = $tagParser->parse(getcwd() . '/xml/defines-primitives.xml'); |
|---|
| 21 |
|
|---|
| 22 |
$conf = new XmlParser(); |
|---|
| 23 |
$conf->setTagDefinitions($defs); |
|---|
| 24 |
$conf->addExtension(new XInclude()); |
|---|
| 25 |
|
|---|
| 26 |
try { |
|---|
| 27 |
$conf->parse(getcwd() . '/xml/test-xinclude.xml'); |
|---|
| 28 |
} catch (Exception $e) { |
|---|
| 29 |
throw $e; |
|---|
| 30 |
exit(); |
|---|
| 31 |
} |
|---|
| 32 |
|
|---|
| 33 |
$color = $conf->getConfigValue('color'); |
|---|
| 34 |
var_dump($color); |
|---|
| 35 |
|
|---|
| 36 |
var_dump($conf->getConfigValue('bool')); |
|---|
| 37 |
var_dump($conf->getConfigValue('zahl')); |
|---|
| 38 |
|
|---|
| 39 |
} |
|---|
| 40 |
} |
|---|
| 41 |
TestPrimitives::main(); |
|---|
| 42 |
?> |
|---|