bug #2046883 [core] Notices about deprecated dl() (so stop using it)
This commit is contained in:
@@ -6,6 +6,7 @@ $Id$
|
|||||||
$HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/ChangeLog $
|
$HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/ChangeLog $
|
||||||
|
|
||||||
3.1.0.0 (not yet released)
|
3.1.0.0 (not yet released)
|
||||||
|
- bug #2046883 [core] Notices about deprecated dl() (so stop using it)
|
||||||
|
|
||||||
3.0.0.0 (not yet released)
|
3.0.0.0 (not yet released)
|
||||||
+ [export] properly handle line breaks for YAML, thanks to Dan Barry -
|
+ [export] properly handle line breaks for YAML, thanks to Dan Barry -
|
||||||
|
@@ -200,9 +200,6 @@ class PMA_Config
|
|||||||
} elseif ($this->get('GD2Available') == 'no') {
|
} elseif ($this->get('GD2Available') == 'no') {
|
||||||
$this->set('PMA_IS_GD2', 0);
|
$this->set('PMA_IS_GD2', 0);
|
||||||
} else {
|
} else {
|
||||||
if (!@extension_loaded('gd')) {
|
|
||||||
PMA_dl('gd');
|
|
||||||
}
|
|
||||||
if (!@function_exists('imagecreatetruecolor')) {
|
if (!@function_exists('imagecreatetruecolor')) {
|
||||||
$this->set('PMA_IS_GD2', 0);
|
$this->set('PMA_IS_GD2', 0);
|
||||||
} else {
|
} else {
|
||||||
@@ -214,7 +211,7 @@ class PMA_Config
|
|||||||
$this->set('PMA_IS_GD2', 0);
|
$this->set('PMA_IS_GD2', 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* We must do hard way... */
|
/* We must do hard way... but almost no chance to execute this */
|
||||||
ob_start();
|
ob_start();
|
||||||
phpinfo(INFO_MODULES); /* Only modules */
|
phpinfo(INFO_MODULES); /* Only modules */
|
||||||
$a = strip_tags(ob_get_contents());
|
$a = strip_tags(ob_get_contents());
|
||||||
|
@@ -14,7 +14,7 @@ if (! defined('PHPMYADMIN')) {
|
|||||||
|
|
||||||
require './libraries/auth/swekey/swekey.auth.lib.php';
|
require './libraries/auth/swekey/swekey.auth.lib.php';
|
||||||
|
|
||||||
if (function_exists('mcrypt_encrypt') || PMA_dl('mcrypt')) {
|
if (function_exists('mcrypt_encrypt')) {
|
||||||
/**
|
/**
|
||||||
* Uses faster mcrypt library if available
|
* Uses faster mcrypt library if available
|
||||||
* (as this is not called from anywhere else, put the code in-line
|
* (as this is not called from anywhere else, put the code in-line
|
||||||
|
@@ -17,22 +17,16 @@ if (isset($cfg['AllowAnywhereRecoding'])
|
|||||||
&& $allow_recoding) {
|
&& $allow_recoding) {
|
||||||
|
|
||||||
if ($cfg['RecodingEngine'] == 'recode') {
|
if ($cfg['RecodingEngine'] == 'recode') {
|
||||||
if (!@extension_loaded('recode')) {
|
|
||||||
PMA_dl('recode');
|
|
||||||
if (!@extension_loaded('recode')) {
|
if (!@extension_loaded('recode')) {
|
||||||
echo $strCantLoadRecodeIconv;
|
echo $strCantLoadRecodeIconv;
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$PMA_recoding_engine = 'recode';
|
$PMA_recoding_engine = 'recode';
|
||||||
} elseif ($cfg['RecodingEngine'] == 'iconv') {
|
} elseif ($cfg['RecodingEngine'] == 'iconv') {
|
||||||
if (!@extension_loaded('iconv')) {
|
|
||||||
PMA_dl('iconv');
|
|
||||||
if (!@extension_loaded('iconv')) {
|
if (!@extension_loaded('iconv')) {
|
||||||
echo $strCantLoadRecodeIconv;
|
echo $strCantLoadRecodeIconv;
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$PMA_recoding_engine = 'iconv';
|
$PMA_recoding_engine = 'iconv';
|
||||||
} else {
|
} else {
|
||||||
if (@extension_loaded('iconv')) {
|
if (@extension_loaded('iconv')) {
|
||||||
@@ -40,18 +34,8 @@ if (isset($cfg['AllowAnywhereRecoding'])
|
|||||||
} elseif (@extension_loaded('recode')) {
|
} elseif (@extension_loaded('recode')) {
|
||||||
$PMA_recoding_engine = 'recode';
|
$PMA_recoding_engine = 'recode';
|
||||||
} else {
|
} else {
|
||||||
PMA_dl('iconv');
|
|
||||||
if (!@extension_loaded('iconv')) {
|
|
||||||
PMA_dl('recode');
|
|
||||||
if (!@extension_loaded('recode')) {
|
|
||||||
echo $strCantLoadRecodeIconv;
|
echo $strCantLoadRecodeIconv;
|
||||||
exit;
|
exit;
|
||||||
} else {
|
|
||||||
$PMA_recoding_engine = 'recode';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$PMA_recoding_engine = 'iconv';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end load recode/iconv extension
|
} // end load recode/iconv extension
|
||||||
|
@@ -1729,7 +1729,7 @@ $cfg['DefaultCharset'] = 'utf-8';
|
|||||||
* Allow character set recoding of MySQL queries, must be also enabled in language
|
* Allow character set recoding of MySQL queries, must be also enabled in language
|
||||||
* file to make harder using other language files than Unicode.
|
* file to make harder using other language files than Unicode.
|
||||||
* Default value is false to avoid problems on servers without the iconv
|
* Default value is false to avoid problems on servers without the iconv
|
||||||
* extension and where dl() is not supported
|
* extension
|
||||||
*
|
*
|
||||||
* @global boolean $cfg['AllowAnywhereRecoding']
|
* @global boolean $cfg['AllowAnywhereRecoding']
|
||||||
*/
|
*/
|
||||||
@@ -2247,8 +2247,7 @@ $cfg['TempDir'] = '';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Is GD >= 2 available? Set to yes/no/auto. 'auto' does auto-detection,
|
* Is GD >= 2 available? Set to yes/no/auto. 'auto' does auto-detection,
|
||||||
* which is a bit expensive for PHP < 4.3.0, but it is the only safe way how to
|
* which is the only safe way to determine GD version.
|
||||||
* determine GD version.
|
|
||||||
*
|
*
|
||||||
* @global string $cfg['GD2Available']
|
* @global string $cfg['GD2Available']
|
||||||
*/
|
*/
|
||||||
|
@@ -341,71 +341,6 @@ function PMA_get_real_size($size = 0)
|
|||||||
return $size;
|
return $size;
|
||||||
} // end function PMA_get_real_size()
|
} // end function PMA_get_real_size()
|
||||||
|
|
||||||
/**
|
|
||||||
* loads php module
|
|
||||||
*
|
|
||||||
* @uses PHP_OS
|
|
||||||
* @uses extension_loaded()
|
|
||||||
* @uses ini_get()
|
|
||||||
* @uses function_exists()
|
|
||||||
* @uses ob_start()
|
|
||||||
* @uses phpinfo()
|
|
||||||
* @uses strip_tags()
|
|
||||||
* @uses ob_get_contents()
|
|
||||||
* @uses ob_end_clean()
|
|
||||||
* @uses preg_match()
|
|
||||||
* @uses strtoupper()
|
|
||||||
* @uses substr()
|
|
||||||
* @uses dl()
|
|
||||||
* @param string $module name if module to load
|
|
||||||
* @return boolean success loading module
|
|
||||||
*/
|
|
||||||
function PMA_dl($module)
|
|
||||||
{
|
|
||||||
static $dl_allowed = null;
|
|
||||||
|
|
||||||
if (extension_loaded($module)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (null === $dl_allowed) {
|
|
||||||
if (!@ini_get('safe_mode')
|
|
||||||
&& @ini_get('enable_dl')
|
|
||||||
&& @function_exists('dl')) {
|
|
||||||
ob_start();
|
|
||||||
phpinfo(INFO_GENERAL); /* Only general info */
|
|
||||||
$a = strip_tags(ob_get_contents());
|
|
||||||
ob_end_clean();
|
|
||||||
if (preg_match('@Thread Safety[[:space:]]*enabled@', $a)) {
|
|
||||||
if (preg_match('@Server API[[:space:]]*\(CGI\|CLI\)@', $a)) {
|
|
||||||
$dl_allowed = true;
|
|
||||||
} else {
|
|
||||||
$dl_allowed = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$dl_allowed = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$dl_allowed = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$dl_allowed) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Once we require PHP >= 4.3, we might use PHP_SHLIB_SUFFIX here */
|
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
||||||
$module_file = 'php_' . $module . '.dll';
|
|
||||||
} elseif (PHP_OS=='HP-UX') {
|
|
||||||
$module_file = $module . '.sl';
|
|
||||||
} else {
|
|
||||||
$module_file = $module . '.so';
|
|
||||||
}
|
|
||||||
|
|
||||||
return @dl($module_file);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* merges array recursive like array_merge_recursive() but keyed-values are
|
* merges array recursive like array_merge_recursive() but keyed-values are
|
||||||
* always overwritten.
|
* always overwritten.
|
||||||
|
@@ -20,18 +20,14 @@ define('PMA_DBI_GETVAR_SESSION', 1);
|
|||||||
define('PMA_DBI_GETVAR_GLOBAL', 2);
|
define('PMA_DBI_GETVAR_GLOBAL', 2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the mysql extensions if it is not loaded yet
|
* Checks one of the mysql extensions
|
||||||
*
|
*
|
||||||
* @param string $extension mysql extension to load
|
* @param string $extension mysql extension to check
|
||||||
*/
|
*/
|
||||||
function PMA_DBI_checkAndLoadMysqlExtension($extension = 'mysql') {
|
function PMA_DBI_checkMysqlExtension($extension = 'mysql') {
|
||||||
if (! function_exists($extension . '_connect')) {
|
|
||||||
PMA_dl($extension);
|
|
||||||
// check whether mysql is available
|
|
||||||
if (! function_exists($extension . '_connect')) {
|
if (! function_exists($extension . '_connect')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -40,14 +36,14 @@ function PMA_DBI_checkAndLoadMysqlExtension($extension = 'mysql') {
|
|||||||
/**
|
/**
|
||||||
* check for requested extension
|
* check for requested extension
|
||||||
*/
|
*/
|
||||||
if (! PMA_DBI_checkAndLoadMysqlExtension($GLOBALS['cfg']['Server']['extension'])) {
|
if (! PMA_DBI_checkMysqlExtension($GLOBALS['cfg']['Server']['extension'])) {
|
||||||
|
|
||||||
// if it fails try alternative extension ...
|
// if it fails try alternative extension ...
|
||||||
// and display an error ...
|
// and display an error ...
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo 2.7.1: add different messages for alternativ extension
|
* @todo add different messages for alternative extension
|
||||||
* and complete fail (no alternativ extension too)
|
* and complete fail (no alternative extension too)
|
||||||
*/
|
*/
|
||||||
$error =
|
$error =
|
||||||
sprintf(PMA_sanitize($GLOBALS['strCantLoad']),
|
sprintf(PMA_sanitize($GLOBALS['strCantLoad']),
|
||||||
@@ -62,8 +58,8 @@ if (! PMA_DBI_checkAndLoadMysqlExtension($GLOBALS['cfg']['Server']['extension'])
|
|||||||
$alternativ_extension = 'mysql';
|
$alternativ_extension = 'mysql';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! PMA_DBI_checkAndLoadMysqlExtension($alternativ_extension)) {
|
if (! PMA_DBI_checkMysqlExtension($alternativ_extension)) {
|
||||||
// if alternativ fails too ...
|
// if alternative fails too ...
|
||||||
PMA_fatalError(
|
PMA_fatalError(
|
||||||
sprintf($GLOBALS['strCantLoad'],
|
sprintf($GLOBALS['strCantLoad'],
|
||||||
$GLOBALS['cfg']['Server']['extension'])
|
$GLOBALS['cfg']['Server']['extension'])
|
||||||
|
@@ -8,7 +8,7 @@ if (! defined('PHPMYADMIN')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* checks for DBG extension and tries to load if not loaded
|
* checks for DBG extension
|
||||||
*
|
*
|
||||||
* allways use $GLOBALS here, as this script is included by footer.inc.hp
|
* allways use $GLOBALS here, as this script is included by footer.inc.hp
|
||||||
* which can also be included from inside a function
|
* which can also be included from inside a function
|
||||||
@@ -17,7 +17,7 @@ if ($GLOBALS['cfg']['DBG']['php']) {
|
|||||||
/**
|
/**
|
||||||
* Loads the DBG extension if needed
|
* Loads the DBG extension if needed
|
||||||
*/
|
*/
|
||||||
if (! @extension_loaded('dbg') && ! PMA_dl('dbg')) {
|
if (! @extension_loaded('dbg') ) {
|
||||||
$message = PMA_Message::error('strCantLoad');
|
$message = PMA_Message::error('strCantLoad');
|
||||||
$message->addParam('DBG');
|
$message->addParam('DBG');
|
||||||
$message->addMessage('<a href="./Documentation.html#faqdbg" target="documentation">', false);
|
$message->addMessage('<a href="./Documentation.html#faqdbg" target="documentation">', false);
|
||||||
|
@@ -13,7 +13,6 @@
|
|||||||
* The SQL Parser code relies heavily on these functions.
|
* The SQL Parser code relies heavily on these functions.
|
||||||
*
|
*
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @uses PMA_dl()
|
|
||||||
* @uses extension_loaded()
|
* @uses extension_loaded()
|
||||||
* @uses substr()
|
* @uses substr()
|
||||||
* @uses function_exists()
|
* @uses function_exists()
|
||||||
@@ -25,11 +24,6 @@ if (! defined('PHPMYADMIN')) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try to load mbstring */
|
|
||||||
if (!@extension_loaded('mbstring')) {
|
|
||||||
PMA_dl('mbstring');
|
|
||||||
}
|
|
||||||
|
|
||||||
$GLOBALS['PMA_allow_mbstr'] = @function_exists('mb_strlen');
|
$GLOBALS['PMA_allow_mbstr'] = @function_exists('mb_strlen');
|
||||||
|
|
||||||
if ($GLOBALS['PMA_allow_mbstr']) {
|
if ($GLOBALS['PMA_allow_mbstr']) {
|
||||||
@@ -53,10 +47,6 @@ if (defined('PMA_MULTIBYTE_ENCODING') || $GLOBALS['PMA_allow_mbstr']) {
|
|||||||
require './libraries/string_native.lib.php';
|
require './libraries/string_native.lib.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!@extension_loaded('ctype')) {
|
|
||||||
PMA_dl('ctype');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (@extension_loaded('ctype')) {
|
if (@extension_loaded('ctype')) {
|
||||||
require './libraries/string_type_ctype.lib.php';
|
require './libraries/string_type_ctype.lib.php';
|
||||||
} else {
|
} else {
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Grab phpMyAdmin version and PMA_dl function
|
// Grab phpMyAdmin version
|
||||||
define('PMA_MINIMUM_COMMON', TRUE);
|
define('PMA_MINIMUM_COMMON', TRUE);
|
||||||
define('PMA_SETUP', TRUE);
|
define('PMA_SETUP', TRUE);
|
||||||
chdir('..');
|
chdir('..');
|
||||||
@@ -1448,12 +1448,6 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Guess MySQL extension to use, prefer mysqli
|
// Guess MySQL extension to use, prefer mysqli
|
||||||
if (!function_exists('mysql_get_client_info')) {
|
|
||||||
PMA_dl('mysql');
|
|
||||||
}
|
|
||||||
if (!function_exists('mysqli_get_client_info')) {
|
|
||||||
PMA_dl('mysqli');
|
|
||||||
}
|
|
||||||
if (function_exists('mysqli_get_client_info')) {
|
if (function_exists('mysqli_get_client_info')) {
|
||||||
$defaults['extension'] = 'mysqli';
|
$defaults['extension'] = 'mysqli';
|
||||||
} elseif (function_exists('mysql_get_client_info')) {
|
} elseif (function_exists('mysql_get_client_info')) {
|
||||||
@@ -1606,17 +1600,7 @@ switch ($action) {
|
|||||||
} elseif (@extension_loaded('recode')) {
|
} elseif (@extension_loaded('recode')) {
|
||||||
$d['RecodingEngine'] = 'recode';
|
$d['RecodingEngine'] = 'recode';
|
||||||
} else {
|
} else {
|
||||||
PMA_dl('iconv');
|
|
||||||
if (!@extension_loaded('iconv')) {
|
|
||||||
PMA_dl('recode');
|
|
||||||
if (!@extension_loaded('recode')) {
|
|
||||||
message('warning', 'Neither recode nor iconv could be loaded so charset conversion will most likely not work.');
|
message('warning', 'Neither recode nor iconv could be loaded so charset conversion will most likely not work.');
|
||||||
} else {
|
|
||||||
$d['RecodingEngine'] = 'recode';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$d['RecodingEngine'] = 'iconv';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (isset($d['RecodingEngine'])) {
|
if (isset($d['RecodingEngine'])) {
|
||||||
message('notice', 'Autodetected recoding engine: ' . $d['RecodingEngine']);
|
message('notice', 'Autodetected recoding engine: ' . $d['RecodingEngine']);
|
||||||
@@ -1644,10 +1628,7 @@ switch ($action) {
|
|||||||
case 'feat_extensions':
|
case 'feat_extensions':
|
||||||
$d = $configuration;
|
$d = $configuration;
|
||||||
if (!@extension_loaded('mbstring')) {
|
if (!@extension_loaded('mbstring')) {
|
||||||
PMA_dl('mbstring');
|
message('warning', 'Could not find <code>mbstring</code> extension, which is required for work with multibyte strings like UTF-8 ones. Please consider installing it.');
|
||||||
}
|
|
||||||
if (!@extension_loaded('mbstring')) {
|
|
||||||
message('warning', 'Could not load <code>mbstring</code> extension, which is required for work with multibyte strings like UTF-8 ones. Please consider installing it.');
|
|
||||||
}
|
}
|
||||||
if (!isset($d['GD2Available'])) {
|
if (!isset($d['GD2Available'])) {
|
||||||
if (PMA_IS_GD2 == 1) {
|
if (PMA_IS_GD2 == 1) {
|
||||||
@@ -1871,7 +1852,6 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
case 'versioncheck': // Check for latest available version
|
case 'versioncheck': // Check for latest available version
|
||||||
PMA_dl('curl');
|
|
||||||
$url = 'http://phpmyadmin.net/home_page/version.php';
|
$url = 'http://phpmyadmin.net/home_page/version.php';
|
||||||
$data = '';
|
$data = '';
|
||||||
$f = @fopen($url, 'r');
|
$f = @fopen($url, 'r');
|
||||||
|
Reference in New Issue
Block a user