29 lines
808 B
PHP
29 lines
808 B
PHP
<?php
|
|
|
|
$testPath = $_GET["path"];
|
|
$dir = opendir($testPath);
|
|
|
|
while ($file = readdir($dir)) {
|
|
if (eregi("[0-9]{2,3}.json_rv1", $file)) {
|
|
$sourceString = file_get_contents($testPath . $file);
|
|
$source = json_decode($sourceString, true);
|
|
|
|
|
|
$content = "";
|
|
foreach ($source as $key => $value) {
|
|
if ($key == 0) {
|
|
continue;
|
|
}
|
|
$content .= $key . "\t" . $value . "\n";
|
|
}
|
|
|
|
file_put_contents($testPath . $file. ".dat", $content);
|
|
|
|
$script = "set terminal svg;set xrange [1:];set style data lines;set out \"$testPath$file.svg\";plot \"$testPath$file.dat\";";
|
|
file_put_contents($testPath . $file. ".pl", $script);
|
|
exec("gnuplot $testPath$file.pl");
|
|
}
|
|
}
|
|
?>
|
|
|