Overview
Namespaces
Classes
- AMemoryUsageDriver
- AProcessorDriver
- Controlor
- Libxslt1123phpProcessorDriver
- Libxslt1126phpProcessorDriver
- LinuxMemoryUsageDriver
- MemoryUsage
- MSXML30ProcessorDriver
- MSXML60ProcessorDriver
- Params
- Processor
- Runner
- Sablotron103cmdProcessorDriver
- Saxon655ProcessorDriver
- SaxonHE9402ProcessorDriver
- Test
- TestRunner
- WindowsMemoryUsageDriver
- Xalan271ProcessorDriver
- XmlParamsDriver
- Xsltproc1123ProcessorDriver
- Xsltproc1126ProcessorDriver
- XT20051206ProcessorDriver
Interfaces
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\TestsRunner;
11:
12: // @codeCoverageIgnoreStart
13: require_once __DIR__ . '/AProcessorDriver.php';
14: // @codeCoverageIgnoreEnd
15:
16: /**
17: * Driver for "xsltproc 1.1.23"
18: *
19: * @author Viktor Mašíček <viktor@masicek.net>
20: */
21: class Xsltproc1123ProcessorDriver extends AProcessorDriver
22: {
23:
24:
25: /**
26: * Return flag, if the driver is available.
27: *
28: * @return bool
29: */
30: public function isAvailable()
31: {
32: switch (PHP_OS)
33: {
34: case self::OS_WIN:
35: return TRUE;
36: break;
37:
38: case self::OS_LINUX:
39: exec('xsltproc --version 2> /dev/null | grep \'libxslt 10123\' | wc -l', $output);
40: if ($output[0] == '0')
41: {
42: return FALSE;
43: }
44: else
45: {
46: return TRUE;
47: }
48: break;
49:
50: default:
51: return FALSE;
52: break;
53: }
54: }
55:
56:
57: /**
58: * Return template of command
59: *
60: * Templates substitutions:
61: * [XSLT] = path of XSLT template for transformation
62: * [INPUT] = path of input XML file
63: * [OUTPUT] = path of generated output XML file
64: * [ERROR] = path of file for eventual generated error message
65: * [LIBS] = path of directory containing XSLT processors (libraries, command-line program etc.)
66: *
67: * @return string
68: */
69: public function getCommandTemplate()
70: {
71: switch (PHP_OS)
72: {
73: case self::OS_WIN:
74: $commandTemplate = '"[PROCESSORS]\libxslt\1.1.23\xsltproc\xsltproc.exe" -o "[OUTPUT]" "[XSLT]" "[INPUT]" 2> "[ERROR]"';
75: break;
76:
77: case self::OS_LINUX:
78: // we assume installing xsltproc 1.1.23
79: $commandTemplate = 'xsltproc -o [OUTPUT] [XSLT] [INPUT] 2> [ERROR]';
80: break;
81: }
82:
83: return $commandTemplate;
84: }
85:
86:
87: /**
88: * Full name of processor (with version)
89: *
90: * @return string
91: */
92: public function getFullName()
93: {
94: return 'xsltproc 1.1.23';
95: }
96:
97:
98: /**
99: * Return name of processor kernel.
100: * Available kernels are const of this class with prefix "KERNEL_"
101: *
102: * Examples:
103: * Saxon 6.5.5 -> Saxon
104: * xsltproc -> libxslt
105: *
106: * @return string
107: */
108: public function getKernel()
109: {
110: return self::KERNEL_LIBXSLT;
111: }
112:
113:
114: }
115: