Skip to content

Commit

Permalink
Import instead of using FQN
Browse files Browse the repository at this point in the history
Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
  • Loading branch information
Tithugues committed Jul 5, 2019
1 parent 21a747c commit 04616ff
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
12 changes: 8 additions & 4 deletions libraries/classes/Config/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
use PhpMyAdmin\Core;
use PhpMyAdmin\DatabaseInterface;
use PhpMyAdmin\Util;
use function mysql_close;
use function mysql_connect;
use function mysqli_close;
use function mysqli_connect;

/**
* Validation class for various validation functions
Expand Down Expand Up @@ -212,18 +216,18 @@ public static function testDBConnection(
}

if ($extension == 'mysql') {
$conn = @\mysql_connect($host . $port . $socket, $user, $pass);
$conn = @mysql_connect($host . $port . $socket, $user, $pass);
if (! $conn) {
$error = __('Could not connect to the database server!');
} else {
\mysql_close($conn);
mysql_close($conn);
}
} else {
$conn = @\mysqli_connect($host, $user, $pass, null, $port, $socket);
$conn = @mysqli_connect($host, $user, $pass, null, $port, $socket);
if (! $conn) {
$error = __('Could not connect to the database server!');
} else {
\mysqli_close($conn);
mysqli_close($conn);
}
}
if ($error !== null) {
Expand Down
5 changes: 3 additions & 2 deletions libraries/classes/Database/Designer/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use PhpMyAdmin\Relation;
use PhpMyAdmin\Table;
use PhpMyAdmin\Util;
use function rawurlencode;

/**
* Common functions for Designer
Expand Down Expand Up @@ -273,8 +274,8 @@ public function getScriptTabs()
if (Util::isForeignKeySupported($GLOBALS['designer']['TABLE_TYPE'][$i])) {
$j = 1;
}
$retval['j_tabs'][\rawurlencode($GLOBALS['designer_url']['TABLE_NAME'][$i])] = $j;
$retval['h_tabs'][\rawurlencode($GLOBALS['designer_url']['TABLE_NAME'][$i])] = 1;
$retval['j_tabs'][rawurlencode($GLOBALS['designer_url']['TABLE_NAME'][$i])] = $j;
$retval['h_tabs'][rawurlencode($GLOBALS['designer_url']['TABLE_NAME'][$i])] = 1;
}
return $retval;
}
Expand Down
3 changes: 2 additions & 1 deletion libraries/classes/Dbi/DbiMysqli.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use mysqli_result;
use PhpMyAdmin\DatabaseInterface;
use stdClass;
use function mysqli_init;

/**
* Interface to the MySQL Improved extension (MySQLi)
Expand Down Expand Up @@ -59,7 +60,7 @@ public function connect($user, $password, array $server)
: $server['host'];
}

$mysqli = \mysqli_init();
$mysqli = mysqli_init();

$client_flags = 0;

Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Plugins/Import/AbstractImportCsv.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract class AbstractImportCsv extends ImportPlugin
* Sets the import plugin properties.
* Called in the constructor.
*
* @return \PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup|void object of the plugin
* @return OptionsPropertyMainGroup|void object of the plugin
*/
protected function setProperties()
{
Expand Down

0 comments on commit 04616ff

Please sign in to comment.