1: <?php
2:
3: 4: 5: 6: 7: 8:
9:
10: namespace XSLTBenchmarking\TestsGenerator;
11:
12: require_once __DIR__ . '/IXmlGeneratorDriver.php';
13: require_once ROOT . '/TestsGenerator/Templating/SmartyTemplatingDriver.php';
14: require_once LIBS . '/PhpPath/PhpPath.min.php';
15: require_once ROOT . '/Exceptions.php';
16:
17: use PhpPath\P;
18:
19: 20: 21: 22: 23:
24: class SmartyXmlGeneratorDriver extends SmartyTemplatingDriver implements IXmlGeneratorDriver
25: {
26:
27:
28: 29: 30: 31: 32:
33: public function __construct($tmpDirectory)
34: {
35: parent::__construct($tmpDirectory);
36: }
37:
38:
39: 40: 41: 42: 43: 44: 45: 46:
47: public function generate($outputPath, $templateDir, array $settings)
48: {
49: try
50: {
51: $templatePath = P::m($templateDir, $settings['template']);
52: parent::generate($templatePath, $outputPath, $settings);
53: }
54: catch (\XSLTBenchmarking\GenerateTemplateException $e)
55: {
56: throw new \XSLTBenchmarking\GenerateXmlException($e->getMessage());
57: }
58: }
59:
60:
61: }
62: