Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Foellmann <foellmann@foe-services.de>2014-07-28 14:13:10 +0400
committerChristian Foellmann <foellmann@foe-services.de>2014-07-28 14:13:10 +0400
commit276394119dfbe117acd411a3862de597ba35a2ad (patch)
tree3dc394a15f459d6324e3452e15e9446e47fe3bd0 /libraries/dbi
parentc8c2e72886de1b71f5abcaa295075da9666096b5 (diff)
UPDATE phpmyadmin 4.2.6 multilanguage
Diffstat (limited to 'libraries/dbi')
-rw-r--r--libraries/dbi/DBIDrizzle.class.php47
-rw-r--r--libraries/dbi/DBIDummy.class.php58
-rw-r--r--libraries/dbi/DBIMysql.class.php10
-rw-r--r--libraries/dbi/DBIMysqli.class.php49
4 files changed, 87 insertions, 77 deletions
diff --git a/libraries/dbi/DBIDrizzle.class.php b/libraries/dbi/DBIDrizzle.class.php
index 82293d9da3..ce8fbb3da9 100644
--- a/libraries/dbi/DBIDrizzle.class.php
+++ b/libraries/dbi/DBIDrizzle.class.php
@@ -52,7 +52,7 @@ class PMA_DBI_Drizzle implements PMA_DBI_Extension
* @return PMA_DrizzleCon
*/
private function _realConnect($drizzle, $host, $port, $uds, $user, $password,
- $db = null, $options = DRIZZLE_CON_NONE
+ $db = null, $options = 0
) {
if ($uds) {
$con = $drizzle->addUds($uds, $user, $password, $db, $options);
@@ -139,31 +139,32 @@ class PMA_DBI_Drizzle implements PMA_DBI_Extension
);
}
- if ($link == false) {
- if ($is_controluser) {
- trigger_error(
- __(
- 'Connection for controluser as defined'
- . ' in your configuration failed.'
- ),
- E_USER_WARNING
- );
- return false;
- }
- // we could be calling $GLOBALS['dbi']->connect() to connect to another
- // server, for example in the Synchronize feature, so do not
- // go back to main login if it fails
- if (! $auxiliary_connection) {
- PMA_logUser($user, 'drizzle-denied');
- global $auth_plugin;
- $auth_plugin->authFails();
- } else {
- return false;
- }
- } else {
+ if ($link != false) {
$GLOBALS['dbi']->postConnect($link, $is_controluser);
+ return $link;
}
+ if ($is_controluser) {
+ trigger_error(
+ __(
+ 'Connection for controluser as defined'
+ . ' in your configuration failed.'
+ ),
+ E_USER_WARNING
+ );
+ return false;
+ }
+ // we could be calling $GLOBALS['dbi']->connect() to connect to another
+ // server, for example in the Synchronize feature, so do not
+ // go back to main login if it fails
+ if ($auxiliary_connection) {
+ return false;
+ }
+
+ PMA_logUser($user, 'drizzle-denied');
+ global $auth_plugin;
+ $auth_plugin->authFails();
+
return $link;
}
diff --git a/libraries/dbi/DBIDummy.class.php b/libraries/dbi/DBIDummy.class.php
index c9d2eed70c..393c4ed9b0 100644
--- a/libraries/dbi/DBIDummy.class.php
+++ b/libraries/dbi/DBIDummy.class.php
@@ -547,15 +547,17 @@ class PMA_DBI_Dummy implements PMA_DBI_Extension
public function realQuery($query, $link = null, $options = 0)
{
$query = trim(preg_replace('/ */', ' ', str_replace("\n", ' ', $query)));
- for ($i = 0; $i < count($GLOBALS['dummy_queries']); $i++) {
- if ($GLOBALS['dummy_queries'][$i]['query'] == $query) {
- $GLOBALS['dummy_queries'][$i]['pos'] = 0;
- if (is_array($GLOBALS['dummy_queries'][$i]['result'])) {
- return $i;
- } else {
- return false;
- }
+ for ($i = 0, $nb = count($GLOBALS['dummy_queries']); $i < $nb; $i++) {
+ if ($GLOBALS['dummy_queries'][$i]['query'] != $query) {
+ continue;
}
+
+ $GLOBALS['dummy_queries'][$i]['pos'] = 0;
+ if (!is_array($GLOBALS['dummy_queries'][$i]['result'])) {
+ return false;
+ }
+
+ return $i;
}
echo "Not supported query: $query\n";
return false;
@@ -602,14 +604,15 @@ class PMA_DBI_Dummy implements PMA_DBI_Extension
public function fetchArray($result)
{
$data = $this->fetchAny($result);
- if (is_array($data)
- && isset($GLOBALS['dummy_queries'][$result]['columns'])
+ if (!is_array($data)
+ || !isset($GLOBALS['dummy_queries'][$result]['columns'])
) {
- foreach ($data as $key => $val) {
- $data[$GLOBALS['dummy_queries'][$result]['columns'][$key]] = $val;
- }
return $data;
}
+
+ foreach ($data as $key => $val) {
+ $data[$GLOBALS['dummy_queries'][$result]['columns'][$key]] = $val;
+ }
return $data;
}
@@ -623,16 +626,17 @@ class PMA_DBI_Dummy implements PMA_DBI_Extension
public function fetchAssoc($result)
{
$data = $this->fetchAny($result);
- if (is_array($data)
- && isset($GLOBALS['dummy_queries'][$result]['columns'])
+ if (!is_array($data)
+ || !isset($GLOBALS['dummy_queries'][$result]['columns'])
) {
- $ret = array();
- foreach ($data as $key => $val) {
- $ret[$GLOBALS['dummy_queries'][$result]['columns'][$key]] = $val;
- }
- return $ret;
+ return $data;
}
- return $data;
+
+ $ret = array();
+ foreach ($data as $key => $val) {
+ $ret[$GLOBALS['dummy_queries'][$result]['columns'][$key]] = $val;
+ }
+ return $ret;
}
/**
@@ -766,11 +770,11 @@ class PMA_DBI_Dummy implements PMA_DBI_Extension
*/
public function numRows($result)
{
- if (!is_bool($result)) {
- return count($GLOBALS['dummy_queries'][$result]['result']);
- } else {
+ if (is_bool($result)) {
return 0;
}
+
+ return count($GLOBALS['dummy_queries'][$result]['result']);
}
/**
@@ -820,11 +824,11 @@ class PMA_DBI_Dummy implements PMA_DBI_Extension
*/
public function numFields($result)
{
- if (isset($GLOBALS['dummy_queries'][$result]['columns'])) {
- return count($GLOBALS['dummy_queries'][$result]['columns']);
- } else {
+ if (!isset($GLOBALS['dummy_queries'][$result]['columns'])) {
return 0;
}
+
+ return count($GLOBALS['dummy_queries'][$result]['columns']);
}
/**
diff --git a/libraries/dbi/DBIMysql.class.php b/libraries/dbi/DBIMysql.class.php
index d67c64b90f..8cc1bf9662 100644
--- a/libraries/dbi/DBIMysql.class.php
+++ b/libraries/dbi/DBIMysql.class.php
@@ -39,7 +39,7 @@ class PMA_DBI_Mysql implements PMA_DBI_Extension
/**
* Helper function for connecting to the database server
*
- * @param array $server host/port/socket
+ * @param string $server host/port/socket
* @param string $user mysql user name
* @param string $password mysql user password
* @param int $client_flags client flags of connection
@@ -426,11 +426,11 @@ class PMA_DBI_Mysql implements PMA_DBI_Extension
*/
public function numRows($result)
{
- if (!is_bool($result)) {
- return mysql_num_rows($result);
- } else {
+ if (is_bool($result)) {
return 0;
}
+
+ return mysql_num_rows($result);
}
/**
@@ -567,4 +567,4 @@ class PMA_DBI_Mysql implements PMA_DBI_Extension
return false;
}
}
-?> \ No newline at end of file
+?>
diff --git a/libraries/dbi/DBIMysqli.class.php b/libraries/dbi/DBIMysqli.class.php
index 31a389cb74..15574048c6 100644
--- a/libraries/dbi/DBIMysqli.class.php
+++ b/libraries/dbi/DBIMysqli.class.php
@@ -218,28 +218,33 @@ class PMA_DBI_Mysqli implements PMA_DBI_Extension
);
}
- if ($return_value == false) {
- if ($is_controluser) {
- trigger_error(
- __('Connection for controluser as defined in your configuration failed.'),
- E_USER_WARNING
- );
- return false;
- }
- // we could be calling $GLOBALS['dbi']->connect() to connect to another
- // server, for example in the Synchronize feature, so do not
- // go back to main login if it fails
- if (! $auxiliary_connection) {
- PMA_logUser($user, 'mysql-denied');
- global $auth_plugin;
- $auth_plugin->authFails();
- } else {
- return false;
- }
- } else {
+ if ($return_value != false) {
$GLOBALS['dbi']->postConnect($link, $is_controluser);
+ return $link;
}
+ if ($is_controluser) {
+ trigger_error(
+ __(
+ 'Connection for controluser as defined in your '
+ . 'configuration failed.'
+ ),
+ E_USER_WARNING
+ );
+ return false;
+ }
+
+ // we could be calling $GLOBALS['dbi']->connect() to connect to another
+ // server, for example in the Synchronize feature, so do not
+ // go back to main login if it fails
+ if ($auxiliary_connection) {
+ return false;
+ }
+
+ PMA_logUser($user, 'mysql-denied');
+ global $auth_plugin;
+ $auth_plugin->authFails();
+
return $link;
}
@@ -512,11 +517,11 @@ class PMA_DBI_Mysqli implements PMA_DBI_Extension
public function numRows($result)
{
// see the note for tryQuery();
- if (!is_bool($result)) {
- return @mysqli_num_rows($result);
- } else {
+ if (is_bool($result)) {
return 0;
}
+
+ return @mysqli_num_rows($result);
}
/**