Debian, Mantis 1.1.0a2, PHP5, JPGraph

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
srouleau
Posts: 16
Joined: 03 Aug 2005, 02:30

Debian, Mantis 1.1.0a2, PHP5, JPGraph

Post by srouleau »

Hey,

I'm in the process of upgrading our installation from 1.0.0rc5 (no, really) to 1.1.0a2 (again, really). At the same time, I'm moving the server downstream on our LAN, and putting a reverse apache proxy to access it through our NAT firewall. Loads of fun.

Anyway, I was getting strange results with the images in 1.1.0a2; turns out that the PHP5 in Debian does not have the imageantialias function compiled in. 1.1.0a2 enables it for most of its graphs, so in the end it was easier to tweak jpgraph to ignore the request:

/usr/share/jpgraph-2.1.4/src/jpgraph.php:

Change

Code: Select all

    
function SetAntiAliasing($aFlg=true) {
   $this->use_anti_aliasing = $aFlg;
   imageantialias($this->img,$aFlg);
}

to

Code: Select all

function SetAntiAliasing($aFlg=true) {
    $this->use_anti_aliasing = $aFlg;
    if( function_exists('imageantialias') ) {
        imageantialias($this->img,$aFlg);
    }
}

Ideally we'd want to have a flag in config_inc.php to enable or not anti aliasing, which may be a performance hit anyway, but this was a lot more changes than I cared for at this point. Yes, I know the object will lie about using anti aliasing with the code change above, but this way client code is oblivious to the lack of support.

Alright, back to figuring out the last nagging problems caused by the proxy....

Stephane
vboctor
Site Admin
Posts: 1293
Joined: 13 Feb 2005, 22:11
Location: Redmond, Washington
Contact:

Post by vboctor »

An easier option would be to change core/graph_api.php and wherever else we set this flag to only set it to true if the function exists. Lets say, moving the check to Mantis code.

In the meantime, it may be worth reporting this to jpgraph so that they keep the flag set to false if the function is not defined or come up with a solution that they like.
srouleau
Posts: 16
Joined: 03 Aug 2005, 02:30

Post by srouleau »

vboctor wrote:An easier option would be to change core/graph_api.php and wherever else we set this flag to only set it to true if the function exists. Lets say, moving the check to Mantis code.
Depends on your setup; since I control the server completely, and the server (a VM actually) is setup to only run Mantis, it was much easier for me to change jpgraph in this instance, and I won't have to change Mantis after every upgrade. Plus it just felt wrong to check it in Mantis, since Mantis doesn't actually call this PHP function directly, it would've been kind of odd to do that check.
vboctor wrote: In the meantime, it may be worth reporting this to jpgraph so that they keep the flag set to false if the function is not defined or come up with a solution that they like.
Good idea. I'll give them a link to this thread, they can do what they want with it afterwards.
Post Reply