mirror of
https://github.com/friendica/friendica
synced 2025-04-26 21:10:16 +00:00
Replace AND and OR in PHP conditions by && and ||
This commit is contained in:
parent
bee6ad5916
commit
9c0d2c31e8
83 changed files with 596 additions and 596 deletions
|
@ -133,7 +133,7 @@ function table_structure($table) {
|
|||
// On utf8mb4 a varchar index can only have a length of 191
|
||||
// The "show index" command sometimes returns this value although this value wasn't added manually.
|
||||
// Because we don't want to add this number to every index, we ignore bigger numbers
|
||||
if (($index["Sub_part"] != "") AND (($index["Sub_part"] < 191) OR ($index["Key_name"] == "PRIMARY"))) {
|
||||
if (($index["Sub_part"] != "") && (($index["Sub_part"] < 191) || ($index["Key_name"] == "PRIMARY"))) {
|
||||
$column .= "(".$index["Sub_part"].")";
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
|
|||
}
|
||||
|
||||
// MySQL >= 5.7.4 doesn't support the IGNORE keyword in ALTER TABLE statements
|
||||
if ((version_compare($db->server_info(), '5.7.4') >= 0) AND
|
||||
if ((version_compare($db->server_info(), '5.7.4') >= 0) &&
|
||||
!(strpos($db->server_info(), 'MariaDB') !== false)) {
|
||||
$ignore = '';
|
||||
} else {
|
||||
|
@ -381,7 +381,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
|
|||
$field_definition = $database[$name]["fields"][$fieldname];
|
||||
|
||||
// Define the default collation if not given
|
||||
if (!isset($parameters['Collation']) AND !is_null($field_definition['Collation'])) {
|
||||
if (!isset($parameters['Collation']) && !is_null($field_definition['Collation'])) {
|
||||
$parameters['Collation'] = 'utf8mb4_general_ci';
|
||||
} else {
|
||||
$parameters['Collation'] = null;
|
||||
|
@ -389,7 +389,7 @@ function update_structure($verbose, $action, $tables=null, $definition=null) {
|
|||
|
||||
if ($field_definition['Collation'] != $parameters['Collation']) {
|
||||
$sql2 = db_modify_table_field($fieldname, $parameters);
|
||||
if (($sql3 == "") OR (substr($sql3, -2, 2) == "; ")) {
|
||||
if (($sql3 == "") || (substr($sql3, -2, 2) == "; ")) {
|
||||
$sql3 .= "ALTER" . $ignore . " TABLE `".$temp_name."` ".$sql2;
|
||||
} else {
|
||||
$sql3 .= ", ".$sql2;
|
||||
|
@ -513,7 +513,7 @@ function db_field_command($parameters, $create = true) {
|
|||
if ($parameters["extra"] != "")
|
||||
$fieldstruct .= " ".$parameters["extra"];
|
||||
|
||||
/*if (($parameters["primary"] != "") AND $create)
|
||||
/*if (($parameters["primary"] != "") && $create)
|
||||
$fieldstruct .= " PRIMARY KEY";*/
|
||||
|
||||
return($fieldstruct);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue