diff --git a/ChangeLog b/ChangeLog index b8d3bdd12..8d1b7d405 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,9 @@ $Source$ * tbl_replace_fields.php3, libraries/build_dump.lib.php3, libraries/display_tbl.lib.php3: Don't hexify BLOB if it is empty (bug #741599). + * Documentation, config.inc.php3, libraries/config_import.lib.php3, + libraries/defines_php.lib.php3: Improved GD 2 detection (bugs #736111, + #741192). 2003-05-22 Garvin Hicking * sql.php3, libraries/common.lib.php3: Bug #692854: Never execute diff --git a/Documentation.html b/Documentation.html index 60223df45..f631d0482 100755 --- a/Documentation.html +++ b/Documentation.html @@ -1345,6 +1345,24 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'

+
$cfg['GD2Available'] string
+
+ Specifies whether GD >= 2 is available. If yes it can be used for + MIME transformations.
+ Possible values are:
+ + Default is auto. +

+
+
$cfg['LeftWidth'] integer
Left frame width in pixel. diff --git a/Documentation.txt b/Documentation.txt index c2a981ce7..97437611a 100644 --- a/Documentation.txt +++ b/Documentation.txt @@ -14,8 +14,8 @@ + Version history: ChangeLog + General notes: README + License: LICENSE - * Documentation version: $Id: Documentation.html,v 1.442 2003/05/14 - 12:39:42 garvinhicking Exp $ + * Documentation version: $Id: Documentation.html,v 1.445 2003/05/19 + 17:11:33 lem9 Exp $ Requirements @@ -376,6 +376,8 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' privileges rules of the MySQL database server. If set, it just means only these databases will be displayed but not at all other databases can't be used. + An example of using more that one database: + $cfg['Servers'][$i]['only_db'] = array('db1', 'db2'); $cfg['Servers'][$i]['verbose'] string Only useful when using phpMyAdmin with multiple server entries. @@ -898,6 +900,19 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' here listed, so if you frequently use some of these move them to the top. + $cfg['GD2Available'] string + Specifies whether GD >= 2 is available. If yes it can be used + for MIME transformations. + Possible values are: + + + auto - automatically detect, this is a bit expensive + operation for php < 4.3.0 so it is preffered to change this + according to your server real possibilities + + yes - GD 2 functions can be used + + no - GD 2 function can not be used + + Default is auto. + $cfg['LeftWidth'] integer Left frame width in pixel. @@ -1066,7 +1081,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' $cfg['MaxExactCount'] integer Determines for how large tables phpMyAdmin should get exact row - count by SELECT COUNT. If approximate row cound is smaller than + count by SELECT COUNT. If approximate row count is smaller than this value, SELECT COUNT will be used, otherwise only value returned by SHOW TABLE STATUS. diff --git a/config.inc.php3 b/config.inc.php3 index b2748070b..7e7b0f8d2 100755 --- a/config.inc.php3 +++ b/config.inc.php3 @@ -446,6 +446,13 @@ $cfg['SaveDir'] = ''; // for example, './save/'; you must // directory +/** + * Misc. settings + */ +$cfg['GD2Available'] = 'auto'; // Is GD >= 2 available? Set to yes/no/auto. 'auto' + // does autodetection, which is a bit expensive for + // php < 4.3.0, but it is the only safe vay how to + // determine GD version. /** * SQL Parser Settings */ diff --git a/libraries/config_import.lib.php3 b/libraries/config_import.lib.php3 index eb336f38c..ce2a81565 100644 --- a/libraries/config_import.lib.php3 +++ b/libraries/config_import.lib.php3 @@ -1063,6 +1063,9 @@ if (!defined('PMA_CONFIG_IMPORT_LIB_INCLUDED')) { if (!isset($cfg['PmaNoRelation_DisableWarning'])) { $cfg['PmaNoRelation_DisableWarning'] = FALSE; } + if (!isset($cfg['GD2Available'])) { + $cfg['GD2Available'] = 'auto'; + } } // $__PMA_CONFIG_IMPORT_LIB__ diff --git a/libraries/defines_php.lib.php3 b/libraries/defines_php.lib.php3 index 15af53393..97e4229e4 100644 --- a/libraries/defines_php.lib.php3 +++ b/libraries/defines_php.lib.php3 @@ -64,11 +64,51 @@ if (!defined('PMA_IS_WINDOWS')) { // Whether GD2 is present if (!defined('PMA_IS_GD2')) { - $testGD = @imagecreatetruecolor(12,12); - if ($testGD) { + if ($cfg['GD2Available'] == 'yes') { define('PMA_IS_GD2', 1); - } else { + } elseif ($cfg['GD2Available'] == 'no') { define('PMA_IS_GD2', 0); + } else { + if (((PMA_PHP_INT_VERSION >= 40000 && !@ini_get('safe_mode') && @ini_get('enable_dl')) + || (PMA_PHP_INT_VERSION < 40000 && PMA_PHP_INT_VERSION > 30009 && !@get_cfg_var('safe_mode'))) + && @function_exists('dl')) { + if (PMA_IS_WINDOWS) { + $suffix = '.dll'; + } else { + $suffix = '.so'; + } + if (!@extension_loaded('gd')) { + @dl('gd' . $suffix); + } + } + if (!@function_exists('imagecreatetruecolor')) { + define('PMA_IS_GD2', 0); + } else { + if (@function_exists('gd_info')) { + $gd_nfo = gd_info(); + if (strstr($gd_nfo["GD Version"], '2.')) { + define('PMA_IS_GD2', 1); + } else { + define('PMA_IS_GD2', 0); + } + } else { + /* We must do hard way... */ + ob_start(); + phpinfo(8); /* Only modules */ + $a = ob_get_contents(); + ob_end_clean(); + /* Get GD version string from phpinfo output */ + if (ereg(']*>[^>]*GD Version[^<]*]*>\([^<]*\)', $a, $v)) { + if (strstr($v, '2.')) { + define('PMA_IS_GD2', 1); + } else { + define('PMA_IS_GD2', 0); + } + } else { + define('PMA_IS_GD2', 0); + } + } + } } } // $__PMA_DEFINES_PHP_LIB__