Skip to content

Commit 1ee7941

Browse files
committed
Merge branch 'fix-graphviz-windows' into 0.7.x
2 parents c0a588c + 101dbb1 commit 1ee7941

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ you spot any mistakes.
1010
to a temporary file fails and remove its debugging output
1111
([#77](https://github.com/clue/graph/issues/77) and [#78](https://github.com/clue/graph/issues/78) @Metabor)
1212

13+
* Fix: Improved GraphViz support for MS Windows
14+
([#99](https://github.com/clue/graph/issues/99))
15+
1316
## 0.7.0 (2013-09-11)
1417

1518
* Feature: Add new `Set\Vertices` and `Set\Edges` classes that handle common

lib/Fhaculty/Graph/GraphViz.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ public function display()
133133
}
134134

135135
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
136-
//echo "ausgabe\n";
137-
exec($tmp . ' >NUL');
136+
// open image in untitled, temporary background shell
137+
exec('start "" ' . escapeshellarg($tmp) . ' >NUL');
138138
} elseif (strtoupper(PHP_OS) === 'DARWIN') {
139139
// open image in background (redirect stdout to /dev/null, sterr to stdout and run in background)
140140
exec('open ' . escapeshellarg($tmp) . ' > /dev/null 2>&1 &');
@@ -259,7 +259,7 @@ public function createImageFile()
259259
$ret = 0;
260260

261261
$executable = $this->getExecutable();
262-
system($executable . ' -T ' . escapeshellarg($this->format) . ' ' . escapeshellarg($tmp) . ' -o ' . escapeshellarg($tmp . '.' . $this->format), $ret);
262+
system(escapeshellarg($executable) . ' -T ' . escapeshellarg($this->format) . ' ' . escapeshellarg($tmp) . ' -o ' . escapeshellarg($tmp . '.' . $this->format), $ret);
263263
if ($ret !== 0) {
264264
throw new UnexpectedValueException('Unable to invoke "' . $executable .'" to create image file (code ' . $ret . ')');
265265
}

0 commit comments

Comments
 (0)