Overview

Namespaces

  • PHP
  • XSLTBenchmarking
    • Reports
    • RunnerConsole
    • TestsGenerator
    • TestsRunner

Classes

  • EasyXmlGeneratorDriver
  • Generator
  • Params
  • SimpleTemplatingDriver
  • SmartyTemplatingDriver
  • SmartyXmlGeneratorDriver
  • Templating
  • Test
  • ToxgeneTemplatingDriver
  • ToxgeneXmlGeneratorDriver
  • XmlGenerator
  • XmlParamsDriver

Interfaces

  • IParamsDriver
  • ITemplatingDriver
  • IXmlGeneratorDriver
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo
 1: <?php
 2: 
 3: /**
 4:  * XSLT Benchmarking
 5:  * @link https://github.com/masicek/XSLT-Benchmarking
 6:  * @author Viktor Mašíček <viktor@masicek.net>
 7:  * @license "New" BSD License
 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:  * Driver for generating XML files by Smarty.
21:  *
22:  * @author Viktor Mašíček <viktor@masicek.net>
23:  */
24: class SmartyXmlGeneratorDriver extends SmartyTemplatingDriver implements IXmlGeneratorDriver
25: {
26: 
27: 
28:     /**
29:      * Object configuration
30:      *
31:      * @param string $tmpDirectory The path of the temporary directory
32:      */
33:     public function __construct($tmpDirectory)
34:     {
35:         parent::__construct($tmpDirectory);
36:     }
37: 
38: 
39:     /**
40:      * Generate xml file
41:      *
42:      * @param string $outputPath The path of the output xml file
43:      * @param array $settings The list of settings specific by selected xml generator
44:      *
45:      * @return void
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: 
XSTL Benchmarking API documentation generated by ApiGen.
Generated using the TokenReflection library.