mirror of
https://github.com/vrana/adminer.git
synced 2025-08-09 08:06:59 +02:00
Coverage: Fix newlines
This commit is contained in:
@@ -33,9 +33,10 @@ if (!extension_loaded("xdebug")) {
|
|||||||
// highlight single file
|
// highlight single file
|
||||||
$filename = $_GET["coverage"];
|
$filename = $_GET["coverage"];
|
||||||
$coverage = (file_exists($coverage_filename) ? unserialize(file_get_contents($coverage_filename)) : array());
|
$coverage = (file_exists($coverage_filename) ? unserialize(file_get_contents($coverage_filename)) : array());
|
||||||
$file = explode("\n", highlight_file($filename, true));
|
$file = explode("\n", substr(highlight_file($filename, true), 5, -6)); // unwrap <pre></pre>
|
||||||
$prev_color = null;
|
$prev_color = null;
|
||||||
$s = "";
|
$s = "";
|
||||||
|
echo "<pre>";
|
||||||
for ($l=0; $l <= count($file); $l++) {
|
for ($l=0; $l <= count($file); $l++) {
|
||||||
$line = $file[$l];
|
$line = $file[$l];
|
||||||
$color = "#C0FFC0"; // tested
|
$color = "#C0FFC0"; // tested
|
||||||
@@ -59,12 +60,13 @@ if (!extension_loaded("xdebug")) {
|
|||||||
foreach (array_reverse($open_tags) as $tag) {
|
foreach (array_reverse($open_tags) as $tag) {
|
||||||
echo "</" . preg_replace('~ .*~', '', $tag) . ">";
|
echo "</" . preg_replace('~ .*~', '', $tag) . ">";
|
||||||
}
|
}
|
||||||
echo "</div>\n";
|
echo "</div>";
|
||||||
$s = ($open_tags ? "<" . implode("><", $open_tags) . ">" : "");
|
$s = ($open_tags ? "<" . implode("><", $open_tags) . ">" : "");
|
||||||
$prev_color = $color;
|
$prev_color = $color;
|
||||||
}
|
}
|
||||||
$s .= "$line\n";
|
$s .= "$line\n";
|
||||||
}
|
}
|
||||||
|
echo "</pre>";
|
||||||
} else {
|
} else {
|
||||||
if (file_exists($coverage_filename)) {
|
if (file_exists($coverage_filename)) {
|
||||||
// display list of files
|
// display list of files
|
||||||
|
Reference in New Issue
Block a user