1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-19 04:12:31 +02:00

[3.1.0] When flush fails, fail SimpleTest

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1641 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-04-03 21:24:16 +00:00
parent 1d25be875d
commit e78df4dc9f
5 changed files with 53 additions and 27 deletions

View File

@@ -59,12 +59,17 @@ if ($AC['disable-phpt'] && $AC['only-phpt']) {
// Shell-script code is executed
if ($AC['xml']) {
if (!SimpleReporter::inCli()) header('Content-Type: text/xml;charset=UTF-8');
$reporter = new XmlReporter();
} elseif (SimpleReporter::inCli()) {
$reporter = new TextReporter();
} else {
$reporter = new HTMLPurifier_SimpleTest_Reporter('UTF-8', $AC);
}
if ($AC['flush']) {
if (SimpleReporter::inCli() && !$AC['xml']) {
passthru($AC['php'] . ' ../maintenance/flush.php');
} else {
shell_exec($AC['php'] . ' ../maintenance/flush.php');
}
htmlpurifier_flush($AC['php'], $reporter);
}
// initialize and load HTML Purifier
@@ -157,15 +162,6 @@ if ($AC['file']) {
}
if ($AC['xml']) {
if (!SimpleReporter::inCli()) header('Content-Type: text/xml;charset=UTF-8');
$reporter = new XmlReporter();
} elseif (SimpleReporter::inCli()) {
$reporter = new TextReporter();
} else {
$reporter = new HTMLPurifier_SimpleTest_Reporter('UTF-8', $AC);
}
if ($AC['dry']) $reporter->makeDry();
$test->run($reporter);