| 1 |
lars |
1 |
--TEST--
|
|
|
2 |
regression test for bug #10185
|
|
|
3 |
--FILE--
|
|
|
4 |
<?php
|
|
|
5 |
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'setup.php.inc';
|
|
|
6 |
|
|
|
7 |
$conf = 'LogFormat "%h %l %u %t \"%r\" %>s %b" common'.PHP_EOL;
|
|
|
8 |
$conf .= '<Directory "/foo/bar">'.PHP_EOL;
|
|
|
9 |
$conf .= ' CustomLog "/foo/bar/access.log" common'.PHP_EOL;
|
|
|
10 |
$conf .= '</Directory>'.PHP_EOL;
|
|
|
11 |
$conf .= '<Directory "\foo\bar\">'.PHP_EOL;
|
|
|
12 |
$conf .= ' CustomLog "\foo\bar\access.log" common'.PHP_EOL;
|
|
|
13 |
$conf .= '</Directory>'.PHP_EOL;
|
|
|
14 |
$conf .= '<Directory "\\\foo\\\bar">'.PHP_EOL;
|
|
|
15 |
$conf .= ' CustomLog "\\\foo\\\bar\\\access.log" common'.PHP_EOL;
|
|
|
16 |
$conf .= '</Directory>'.PHP_EOL;
|
|
|
17 |
file_put_contents('bug10185.httpd.conf.old', $conf);
|
|
|
18 |
|
|
|
19 |
$conf1 = new Config;
|
|
|
20 |
$root1 =& $conf1->parseConfig('bug10185.httpd.conf.old', 'apache');
|
|
|
21 |
$conf1->writeConfig('bug10185.httpd.conf.new.php', 'phparray',
|
|
|
22 |
array('name' => 'test'));
|
|
|
23 |
|
|
|
24 |
$conf2 = new Config;
|
|
|
25 |
$root2 =& $conf2->parseConfig('bug10185.httpd.conf.new.php', 'phparray',
|
|
|
26 |
array('name' => 'test'));
|
|
|
27 |
$conf2->writeConfig('bug10185.httpd.conf.new', 'apache');
|
|
|
28 |
readfile('bug10185.httpd.conf.new');
|
|
|
29 |
|
|
|
30 |
?>
|
|
|
31 |
--CLEAN--
|
|
|
32 |
<?php
|
|
|
33 |
unlink('bug10185.httpd.conf.new.php');
|
|
|
34 |
unlink('bug10185.httpd.conf.new');
|
|
|
35 |
unlink('bug10185.httpd.conf.old');
|
|
|
36 |
?>
|
|
|
37 |
--EXPECT--
|
|
|
38 |
LogFormat "%h %l %u %t \"%r\" %>s %b" common
|
|
|
39 |
<Directory "/foo/bar">
|
|
|
40 |
CustomLog "/foo/bar/access.log" common
|
|
|
41 |
</Directory>
|
|
|
42 |
<Directory "\foo\bar\">
|
|
|
43 |
CustomLog "\foo\bar\access.log" common
|
|
|
44 |
</Directory>
|
|
|
45 |
<Directory "\\foo\\bar">
|
|
|
46 |
CustomLog "\\foo\\bar\\access.log" common
|
|
|
47 |
</Directory>
|