src/Core/Helper/State/Renderer.php
public function runDot($dotString)
    {
        $descriptorSpec = array(
            0 => array("pipe", "r"), // stdin
            1 => array("pipe", "w"), // stdout
            2 => array("pipe", "a") // stderr
        );

        $process = proc_open('dot -Tsvg', $descriptorSpec, $pipes);

        if (is_resource($process)) {
            fwrite($pipes[0], $dotString);
            fclose($pipes[0]);

            $svg = stream_get_contents($pipes[1]);
            fclose($pipes[1]);

            proc_close($process);
            $svg = explode('<svg ', $svg);

            // has it worked out?
            if (count($svg) < 2) {
                return false;
            }

            return '<svg ' . $svg[1];
        }

        return false;
    }
public function runDot($dotString)
    {
        $descriptorSpec = array(
            0 => array("pipe", "r"), // stdin
            1 => array("pipe", "w"), // stdout
            2 => array("pipe", "a") // stderr
        );

        $process = proc_open('dot -Tsvg', $descriptorSpec, $pipes);

        if (is_resource($process)) {
            fwrite($pipes[0], $dotString);
            fclose($pipes[0]);

            $svg = stream_get_contents($pipes[1]);
            fclose($pipes[1]);

            proc_close($process);
            $svg = explode('<svg ', $svg);

            // has it worked out?
            if (count($svg) < 2) {
                return false;
            }

            return '<svg ' . $svg[1];
        }

        return false;
    }
public function runDot ( $ dotString ) { $ descriptorSpec = array ( 0 => array ( "pipe" , "r" ) , // stdin 1 => array ( "pipe" , "w" ) , // stdout 2 => array ( "pipe" , "a" ) // stderr ) ; $ process = proc_open ( 'dot -Tsvg' , $ descriptorSpec , $ pipes ) ; if ( is_resource ( $ process ) ) { fwrite ( $ pipes [ 0 ] , $ dotString ) ; fclose ( $ pipes [ 0 ] ) ; $ svg = stream_get_contents ( $ pipes [ 1 ] ) ; fclose ( $ pipes [ 1 ] ) ; proc_close ( $ process ) ; $ svg = explode ( '<svg ' , $ svg ) ; // has it worked out? if ( count ( $ svg ) < 2 ) { return false ; } return '<svg ' . $ svg [ 1 ] ; } return false ; }
Renders a dot graph into an svg

@param string $dotString The dot graph that is fed into the
@return string|bool the resulting SVG
Renders a dot graph into an svg