* fixed again the socket patch
* modified the way defines.inc.php3 is loaded
This commit is contained in:
42
lib.inc.php3
42
lib.inc.php3
@@ -13,7 +13,8 @@ if (!defined('__LIB_INC__')){
|
|||||||
*
|
*
|
||||||
* some functions need the constants of defines.inc.php3
|
* some functions need the constants of defines.inc.php3
|
||||||
*
|
*
|
||||||
* the include of defines.inc.php3 must be after the connection to db
|
* the include of defines.inc.php3 must be after the connection to db to
|
||||||
|
* get the MySql version
|
||||||
*
|
*
|
||||||
* the auth() function must be before the connection to db
|
* the auth() function must be before the connection to db
|
||||||
*
|
*
|
||||||
@@ -24,10 +25,13 @@ if (!defined('__LIB_INC__')){
|
|||||||
*
|
*
|
||||||
* - definition of auth()
|
* - definition of auth()
|
||||||
* - parsing of the configuration file
|
* - parsing of the configuration file
|
||||||
|
* - first load of the define.lib.php3 library (won't get the MySQL
|
||||||
|
* release number)
|
||||||
* - load of mysql extension (if necessary)
|
* - load of mysql extension (if necessary)
|
||||||
* - definition of mysql_die()
|
* - definition of mysql_die()
|
||||||
* - db connection
|
* - db connection
|
||||||
* - defines.inc.php3
|
* - second load of the define.lib.php3 library to get the MySQL release
|
||||||
|
* number)
|
||||||
* - other functions, respecting dependencies
|
* - other functions, respecting dependencies
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -78,7 +82,8 @@ if (!defined('__LIB_INC__')){
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses the configuration file
|
* Parses the configuration file and gets some constants used to define
|
||||||
|
* versions of phpMyAdmin/php/mysql...
|
||||||
*/
|
*/
|
||||||
include('./config.inc.php3');
|
include('./config.inc.php3');
|
||||||
// For compatibility with old config.inc.php3
|
// For compatibility with old config.inc.php3
|
||||||
@@ -88,20 +93,21 @@ if (!defined('__LIB_INC__')){
|
|||||||
if (!isset($cfgTextareaRows)) {
|
if (!isset($cfgTextareaRows)) {
|
||||||
$cfgTextareaRows = 7;
|
$cfgTextareaRows = 7;
|
||||||
}
|
}
|
||||||
|
include('./defines.inc.php3');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the mysql extensions if it is not loaded yet
|
* Loads the mysql extensions if it is not loaded yet
|
||||||
* staybyte - 26. June 2001
|
* staybyte - 26. June 2001
|
||||||
*/
|
*/
|
||||||
if ((intval(phpversion()) == 3 && substr(phpversion(), 4) > 9)
|
if (PHP_INT_VERSION >= 30009) {
|
||||||
|| intval(phpversion()) == 4) {
|
if (PMA_WINDOWS) {
|
||||||
if (defined('PHP_OS') && eregi('win', PHP_OS)) {
|
|
||||||
$suffix = '.dll';
|
$suffix = '.dll';
|
||||||
} else {
|
} else {
|
||||||
$suffix = '.so';
|
$suffix = '.so';
|
||||||
}
|
}
|
||||||
if (intval(phpversion()) == 3) {
|
if (PHP_INT_VERSION < 40000) {
|
||||||
$extension = 'MySQL';
|
$extension = 'MySQL';
|
||||||
} else {
|
} else {
|
||||||
$extension = 'mysql';
|
$extension = 'mysql';
|
||||||
@@ -266,10 +272,9 @@ if (!defined('__LIB_INC__')){
|
|||||||
$server_port = (empty($cfgServer['port']))
|
$server_port = (empty($cfgServer['port']))
|
||||||
? ''
|
? ''
|
||||||
: ':' . $cfgServer['port'];
|
: ':' . $cfgServer['port'];
|
||||||
$server_socket = (empty($cfgServer['socket']) || PMA_INT_VERSION >= 30010)
|
$server_socket = (empty($cfgServer['socket']) || PHP_INT_VERSION < 30010)
|
||||||
? ''
|
? ''
|
||||||
: ':' . $cfgServer['socket'];
|
: ':' . $cfgServer['socket'];
|
||||||
|
|
||||||
$dbh = @$connect_func(
|
$dbh = @$connect_func(
|
||||||
$cfgServer['host'] . $server_port . $server_socket,
|
$cfgServer['host'] . $server_port . $server_socket,
|
||||||
$cfgServer['stduser'],
|
$cfgServer['stduser'],
|
||||||
@@ -360,20 +365,17 @@ if (!defined('__LIB_INC__')){
|
|||||||
} // end Advanced authentication
|
} // end Advanced authentication
|
||||||
|
|
||||||
// Do connect to the user's database
|
// Do connect to the user's database
|
||||||
|
|
||||||
$server_port = (empty($cfgServer['port']))
|
$server_port = (empty($cfgServer['port']))
|
||||||
? ''
|
? ''
|
||||||
: ':' . $cfgServer['port'];
|
: ':' . $cfgServer['port'];
|
||||||
$server_socket = (empty($cfgServer['socket']) || PMA_INT_VERSION >= 30010)
|
$server_socket = (empty($cfgServer['socket']) || PHP_INT_VERSION < 30010)
|
||||||
? ''
|
? ''
|
||||||
: ':' . $cfgServer['socket'];
|
: ':' . $cfgServer['socket'];
|
||||||
|
$link = @$connect_func(
|
||||||
$dbh = $connect_func(
|
|
||||||
$cfgServer['host'] . $server_port . $server_socket,
|
$cfgServer['host'] . $server_port . $server_socket,
|
||||||
$cfgServer['user'],
|
$cfgServer['stduser'],
|
||||||
$cfgServer['password']
|
$cfgServer['stdpass']
|
||||||
) or mysql_die();
|
) or mysql_die();
|
||||||
|
|
||||||
} // end server connecting
|
} // end server connecting
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -386,9 +388,9 @@ if (!defined('__LIB_INC__')){
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets constants that defines the PHP, MySQL... releases.
|
* Gets constants that defines the PHP, MySQL... releases.
|
||||||
* This include must be located physically before any code that
|
* This include must be located physically before any code that needs to
|
||||||
* needs to reference the constants, else PHP 3.0.16 won't be happy;
|
* reference the constants, else PHP 3.0.16 won't be happy; and must be
|
||||||
* and must be located after we are connected to db
|
* located after we are connected to db to get the MySql version.
|
||||||
*/
|
*/
|
||||||
include('./defines.inc.php3');
|
include('./defines.inc.php3');
|
||||||
|
|
||||||
@@ -1576,7 +1578,7 @@ var errorMsg2 = '<?php echo(str_replace('\'', '\\\'', $GLOBALS['strNotValidNumbe
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Call the working function depending on the php version
|
// Call the working function depending on the php version
|
||||||
if (PMA_INT_VERSION >= 40005) {
|
if (PHP_INT_VERSION >= 40005) {
|
||||||
get_table_content_fast($db, $table, $add_query, $handler);
|
get_table_content_fast($db, $table, $add_query, $handler);
|
||||||
} else {
|
} else {
|
||||||
get_table_content_old($db, $table, $add_query, $handler);
|
get_table_content_old($db, $table, $add_query, $handler);
|
||||||
|
Reference in New Issue
Block a user