Output git diff info if we have it too

This commit is contained in:
Matt Pass
2019-10-06 12:24:20 +01:00
committed by GitHub
parent ab2f7d78c8
commit a03cf9ea43

View File

@@ -222,5 +222,17 @@ if (!isset($_GET['timestamp']) || !isset($prevIndexData["timestamps"]) || $_GET[
];
}
// If we have a data/git-diff.php file
if (file_exists($docRoot.$ICEcoderDir."/data/git-diff.php")) {
// Get serialized array back out of PHP file inside a comment block as git data for git diff display
$gitData = file_get_contents($docRoot.$ICEcoderDir."/data/git-diff.php");
if (strpos($gitData, "<?php") !== false) {
$gitData = str_replace("<?php\n/*\n\n", "", $gitData);
$gitData = str_replace("\n\n*/\n?>", "", $gitData);
$gitData = unserialize($gitData);
$output["git"] = $gitData;
}
}
// Output the JSON
echo json_encode($output, JSON_PRETTY_PRINT);