|
cvs: pearweb /include/jpgraph jpgraph.php: msg#00035php.pear.core
cellog Tue Oct 17 15:27:24 2006 UTC Modified files: /pearweb/include/jpgraph jpgraph.php Log: simple fix makes jpgraph php5-compatible (tested in 5.1.6) http://cvs.php.net/viewvc.cgi/pearweb/include/jpgraph/jpgraph.php?r1=1.3&r2=1.4&diff_format=u Index: pearweb/include/jpgraph/jpgraph.php diff -u pearweb/include/jpgraph/jpgraph.php:1.3 pearweb/include/jpgraph/jpgraph.php:1.4 --- pearweb/include/jpgraph/jpgraph.php:1.3 Sat Jun 22 14:37:44 2002 +++ pearweb/include/jpgraph/jpgraph.php Tue Oct 17 15:27:24 2006 @@ -4,7 +4,7 @@ // Description: PHP4 Graph Plotting library. Base module. // Created: 2001-01-08 // Author: Johan Persson (johanp@xxxxxxxxx) -// Ver: $Id: jpgraph.php,v 1.3 2002/06/22 14:37:44 richard Exp $ +// Ver: $Id: jpgraph.php,v 1.4 2006/10/17 15:27:24 cellog Exp $ // // License: This code is released under QPL 1.0 // Copyright (C) 2001,2002 Johan Persson @@ -314,6 +314,23 @@ } } + +// +// Check what version of the GD library is being used +// +if( USE_LIBRARY_GD2 ) { + $GLOBALS['gd2'] = true; + $copyfunc = "imagecopyresampled"; +} elseif(function_exists('imagecopyresized')) { + $copyfunc = "imagecopyresized"; + $GLOBALS['gd2'] = false; +} +else { + JpGraphError::Raise(" Your PHP installation does not seem to + have the required GD library. + Please see the PHP documentation on how to install and enable the GD library."); +} + // // ... and install the default error handler // @@ -328,26 +345,11 @@ // //Check if there were any warnings, perhaps some wrong includes by the //user +// jpgraph is not E_STRICT so this breaks in PHP 5+ // -if( isset($GLOBALS['php_errormsg']) ) { - JpGraphError::Raise("<b>General PHP error:</b><br>".$GLOBALS['php_errormsg']); -} - -// -// Check what version of the GD library is being used -// -if( USE_LIBRARY_GD2 ) { - $gd2 = true; - $copyfunc = "imagecopyresampled"; -} elseif(function_exists('imagecopyresized')) { - $copyfunc = "imagecopyresized"; - $gd2 = false; -} -else { - JpGraphError::Raise(" Your PHP installation does not seem to - have the required GD library. - Please see the PHP documentation on how to install and enable the GD library."); -} +//if( isset($GLOBALS['php_errormsg']) ) { +// JpGraphError::Raise("<b>General PHP error:</b><br>".$GLOBALS['php_errormsg']); +//} // Usefull mathematical function function sign($a) {if( $a>=0) return 1; else return -1;} |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | cvs: pearweb /sql aggregated_package_stats.sql: 00035, Greg Beaver |
|---|---|
| Next by Date: | cvs: pearweb /cron update-stats.php: 00035, Greg Beaver |
| Previous by Thread: | cvs: pearweb /sql aggregated_package_stats.sqli: 00035, Greg Beaver |
| Next by Thread: | cvs: pearweb /cron update-stats.php: 00035, Greg Beaver |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |