MINOR Removed faulty detection of "digraph" binary from ModelViewer

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81584 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-07-10 03:21:48 +00:00
parent b459d489a3
commit 79912f6ba6

View File

@ -26,10 +26,10 @@ class ModelViewer extends Controller {
// check for graphviz dependencies // check for graphviz dependencies
$returnCode = 0; $returnCode = 0;
$output = array(); $output = array();
exec("which digraph && which neato", $output, $returnCode); exec("which neato", $output, $returnCode);
if($returnCode != 0) { if($returnCode != 0) {
user_error( user_error(
'You don\'t seem to have the GraphViz library (http://graphviz.org/) or the "digraph" and "neato" command-line utility available', 'You don\'t seem to have the GraphViz library (http://graphviz.org/) and the "neato" command-line utility available',
E_USER_ERROR E_USER_ERROR
); );
} }
@ -99,7 +99,7 @@ class ModelViewer_Module extends ModelViewer {
SSViewer::set_source_file_comments(false); SSViewer::set_source_file_comments(false);
$dotContent = $this->renderWith("ModelViewer_dotsrc"); $dotContent = $this->renderWith("ModelViewer_dotsrc");
$CLI_dotContent = escapeshellarg($dotContent); $CLI_dotContent = escapeshellarg($dotContent);
$output= `echo $CLI_dotContent | neato -Tpng:gd &> /dev/stdout`; $output= `echo $CLI_dotContent | neato -Tpng:gd &> /dev/stdout`;
if(substr($output,1,3) == 'PNG') header("Content-type: image/png"); if(substr($output,1,3) == 'PNG') header("Content-type: image/png");
else header("Content-type: text/plain"); else header("Content-type: text/plain");