Extension talk:Graph

From MediaWiki.org
Jump to: navigation, search
The following discussion has been transferred from Meta-Wiki.
Any user names refer to users of that site, who are not necessarily users of MediaWiki.org (even if they share the same username).

installed and working, even though i got a few failed tests, mailed those to you. nice work

Is it possible to use [[bracket]] links inside the graph though? i would like to make the node names clickable links, you know. Nevermind, got it. ([1])

Mutante 16:56, 27 November 2005 (UTC)

[edit] how does this relate to graphviz

please include a comparision between the two extensions

[edit] Windows wamp setup

I tried to install this on a windows server, and I must say it's a really tough thing to do, can you provide a more in-detail walkthrough?

I managed to install it... somehow, but there are many errors, for instance I can't put things on multiple lines, and the graphviz extension isn't working at all... along with many other problems.

I'm willing to help with testing and debugging on a windows server if you ever think about fixing this. --88.52.202.25 09:48, 13 November 2008 (UTC)

I had the same problems under windows and XAMPP. Looks like this plugin is written for Linux and never tested under windows.
But I was able to fix the problems under windows, all in all I needed some hours to do it, in the end I only had to change a few lines...
Here is the code. You must replace the original function renderGraph with this one:
# The callback function for converting the input text to HTML output
function renderGraph( $input ) {
    global $wgInputEncoding;    
    $winOS = ((PHP_OS == "WINNT") || (PHP_OS == "WIN32") || (PHP_OS == "WIN64"));

    if( !($winOS) && !is_executable( "graph/graphcnv" ) ) {
        return "<strong class='error'><code>graph/graphcnv</code> is not executable</strong>";
    }
                
                
    $cmd = "perl graph/graphcnv ".  escapeshellarg($input) . " " . escapeshellarg($wgInputEncoding);
        
    if ($winOS) {
        $cmd = str_replace("\n", "", $cmd);  //Replacing breaks wich are causing problems with the Windows cmd
    }

    $output = `$cmd`;

    if (strlen($output) == 0) {
        return "<strong class='error'>Couldn't execute <code>graph/graphcnv</code></strong>"
        . ' See the <a alt="Graph::Easy online manual" title="Graph::Easy online manual" href="'
        . 'http://bloodgate.com/perl/graph/manual/errors.html#1">manual</a> for help.';
    }

    return $output;
}
I hope this works well on all Windows systems. It's only tested on Windows XP yet. I also only tested some standard diagrams there could be some bugs in some special cases but I don't think so. When this works well, Tels could add the code into his source code. This should work with linux and other OS as well.
To install all the Perl modules under windows OS you can use Strawberry Perl, its really easy to install all the modules with it (I use it together with XAMPP). --Danwe 21:24, 8 February 2009 (UTC)


I can confirm that the above fixes are correct, and definitely need to be put into the source Graph.php. Rook2pawn 03:13, 20 June 2009 (UTC)


2011/06/29 - The link to the example wiki gives this error:

Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING in /usr/www/users/elpair/blood/wiki/includes/Namespace.php on line 46

Mickeyf

Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox