/**
* @brief Returns the MySQL server version string
- *
+ *
* This function discriminate between the deprecated mysql API and the current
* object-oriented mysqli API. Example of returned string: 5.5.46-0+deb8u1
*
foreach ($r AS $row) {
if ((intval($a->config["system"]["db_loglimit_index"]) > 0)) {
- $log = (in_array($row['key'], $watchlist) AND
+ $log = (in_array($row['key'], $watchlist) &&
($row['rows'] >= intval($a->config["system"]["db_loglimit_index"])));
} else {
$log = false;
}
- if ((intval($a->config["system"]["db_loglimit_index_high"]) > 0) AND ($row['rows'] >= intval($a->config["system"]["db_loglimit_index_high"]))) {
+ if ((intval($a->config["system"]["db_loglimit_index_high"]) > 0) && ($row['rows'] >= intval($a->config["system"]["db_loglimit_index_high"]))) {
$log = true;
}
- if (in_array($row['key'], $blacklist) OR ($row['key'] == "")) {
+ if (in_array($row['key'], $blacklist) || ($row['key'] == "")) {
$log = false;
}
// PDO doesn't return "true" on successful operations - like mysqli does
// Emulate this behaviour by checking if the query returned data and had columns
// This should be reliable enough
- if (($this->driver == 'pdo') AND (count($r) == 0) AND ($columns == 0)) {
+ if (($this->driver == 'pdo') && (count($r) == 0) && ($columns == 0)) {
return true;
}
static private function replace_parameters($sql, $args) {
$offset = 0;
foreach ($args AS $param => $value) {
- if (is_int($args[$param]) OR is_float($args[$param])) {
+ if (is_int($args[$param]) || is_float($args[$param])) {
$replace = intval($args[$param]);
} else {
$replace = "'".self::$dbo->escape($args[$param])."'";
unset($args[0]);
// When the second function parameter is an array then use this as the parameter array
- if ((count($args) > 0) AND (is_array($args[1]))) {
+ if ((count($args) > 0) && (is_array($args[1]))) {
$params = $args[1];
} else {
$params = $args;
$args[++$i] = $param;
}
- if (!self::$dbo OR !self::$dbo->connected) {
+ if (!self::$dbo || !self::$dbo->connected) {
return false;
}
// When the search field is the relation field, we don't need to fetch the rows
// This is useful when the leading record is already deleted in the frontend but the rest is done in the backend
- if ((count($param) == 1) AND ($field == array_keys($param)[0])) {
+ if ((count($param) == 1) && ($field == array_keys($param)[0])) {
foreach ($rel_def AS $rel_table => $rel_fields) {
foreach ($rel_fields AS $rel_field) {
$retval = self::delete($rel_table, array($rel_field => array_values($param)[0]), true, $callstack);
}
}
- if (!$do_update OR (count($fields) == 0)) {
+ if (!$do_update || (count($fields) == 0)) {
return true;
}
$result = self::p($sql, $condition);
- if (is_bool($result) OR !$single_row) {
+ if (is_bool($result) || !$single_row) {
return $result;
} else {
$row = self::fetch($result);