Merge branch '975-dot-and-plain-files-path-in-windows-dev' into 'develop'

Added OS filter

See merge request !557
This commit is contained in:
vgilc 2017-06-14 10:48:44 +02:00
commit 9b35a7f5ba
1 changed files with 25 additions and 6 deletions

View File

@ -122,7 +122,16 @@ function networkmap_process_networkmap($id = 0) {
null,
$old_mode);
$filename_dot = sys_get_temp_dir() . "/networkmap_" . $filter;
switch (PHP_OS) {
case "WIN32":
case "WINNT":
case "Windows":
$filename_dot = sys_get_temp_dir() . "\\networkmap_" . $filter;
break;
default:
$filename_dot = sys_get_temp_dir() . "/networkmap_" . $filter;
break;
}
if ($simple) {
$filename_dot .= "_simple";
@ -133,11 +142,21 @@ function networkmap_process_networkmap($id = 0) {
$filename_dot .= "_" . $id . ".dot";
file_put_contents($filename_dot, $graph);
$filename_plain = sys_get_temp_dir() . "/plain.txt";
$cmd = "$filter -Tplain -o " . $filename_plain . " " .
$filename_dot;
switch (PHP_OS) {
case "WIN32":
case "WINNT":
case "Windows":
$filename_plain = sys_get_temp_dir() . "\\plain.txt";
$cmd = $config['graphviz_win'] . "$filter -Tplain -o " . $filename_plain . " " .
$filename_dot;
break;
default:
$filename_plain = sys_get_temp_dir() . "/plain.txt";
$cmd = "$filter -Tplain -o " . $filename_plain . " " .
$filename_dot;
break;
}
system ($cmd);