Skip to content

Commit

Permalink
fix graphiz_api indentation and syntax error
Browse files Browse the repository at this point in the history
Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
  • Loading branch information
Gulacsi Tamas authored and davidhicks committed Oct 22, 2010
1 parent 71ad8c6 commit 0ed2472
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions core/graphviz_api.php 100644 → 100755
Expand Up @@ -338,33 +338,32 @@ function output( $p_format = 'dot', $p_headers = false ) {
2 => array( 'file', 'php://stderr', 'w', ),
);

$t_pipes = array();
$t_proccess = proc_open( $t_command, $t_descriptors, $t_pipes );

if( is_resource( $t_proccess ) ) {
# Filter generated output through dot
fwrite( $t_pipes[0], $t_dot_source );
fclose( $t_pipes[0] );

if( $p_headers ) {
# Headers were requested, use another output buffer to
# retrieve the size for Content-Length.
ob_start();
while( !feof( $t_pipes[1] ) ) {
echo fgets( $t_pipes[1], 1024 );
}
header( 'Content-Length: ' . ob_get_length() );
ob_end_flush();
} else {
# No need for headers, send output directly.
while( !feof( $t_pipes[1] ) ) {
print( fgets( $t_pipes[1], 1024 ) );
}
$t_pipes = array();
$t_proccess = proc_open( $t_command, $t_descriptors, $t_pipes );

if( is_resource( $t_proccess ) ) {
# Filter generated output through dot
fwrite( $t_pipes[0], $t_dot_source );
fclose( $t_pipes[0] );

if( $p_headers ) {
# Headers were requested, use another output buffer to
# retrieve the size for Content-Length.
ob_start();
while( !feof( $t_pipes[1] ) ) {
echo fgets( $t_pipes[1], 1024 );
}
header( 'Content-Length: ' . ob_get_length() );
ob_end_flush();
} else {
# No need for headers, send output directly.
while( !feof( $t_pipes[1] ) ) {
print( fgets( $t_pipes[1], 1024 ) );
}

fclose( $t_pipes[1] );
proc_close( $t_proccess );
}

fclose( $t_pipes[1] );
proc_close( $t_proccess );
}
}

Expand Down

0 comments on commit 0ed2472

Please sign in to comment.