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 LIBS . '/PhpPath/PhpPath.min.php';
13: require_once ROOT . '/DriversContainer.php';
14: 
15: use PhpPath\P;
16: 
17: /**
18:  * Object for generating xml files by different xml generator.
19:  *
20:  * @author Viktor Mašíček <viktor@masicek.net>
21:  */
22: class XmlGenerator extends \XSLTBenchmarking\DriversContainer
23: {
24: 
25: 
26:     /**
27:      * Generate xml file
28:      *
29:      * @param string $outputPath The path of the output xml file
30:      * @param array $settings The list of settings specific by selected xml generator
31:      *
32:      * @return void
33:      */
34:     public function generate($outputPath, $templateDir, array $settings)
35:     {
36:         $omitXmlDeclaration = FALSE;
37:         if (isset($settings['omitXmlDeclaration']))
38:         {
39:             if ($settings['omitXmlDeclaration'] == 1)
40:             {
41:                 $omitXmlDeclaration = TRUE;
42:             }
43:             unset($settings['omitXmlDeclaration']);
44:         }
45: 
46:         $this->driver->generate($outputPath, $templateDir, $settings);
47: 
48:         if ($omitXmlDeclaration)
49:         {
50:             $output = file_get_contents($outputPath);
51:             $output = preg_replace('/<\?xml[^?]+\?>/', '', $output);
52:             file_put_contents($outputPath, $output);
53:         }
54:     }
55: 
56: 
57: }
58: 
XSTL Benchmarking API documentation generated by ApiGen.
Generated using the TokenReflection library.