mirror of
https://github.com/friendica/friendica
synced 2025-04-27 19:50:12 +00:00
Rename DBM method calls to DBA method calls
This commit is contained in:
parent
8ddb94ef06
commit
0ec44f3e8a
153 changed files with 813 additions and 918 deletions
|
@ -216,7 +216,7 @@ class DBA
|
|||
}
|
||||
|
||||
$r = self::p("EXPLAIN ".$query);
|
||||
if (!DBM::is_result($r)) {
|
||||
if (!self::is_result($r)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -269,7 +269,7 @@ class DBA
|
|||
switch (self::$driver) {
|
||||
case 'pdo':
|
||||
$r = self::p("SELECT 1");
|
||||
if (DBM::is_result($r)) {
|
||||
if (self::is_result($r)) {
|
||||
$row = self::toArray($r);
|
||||
$connected = ($row[0]['1'] == '1');
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ class DBStructure
|
|||
$r = q("SELECT `TABLE_NAME` FROM `information_schema`.`tables` WHERE `engine` = 'MyISAM' AND `table_schema` = '%s'",
|
||||
dbesc(DBA::databaseName()));
|
||||
|
||||
if (!DBM::is_result($r)) {
|
||||
if (!DBA::is_result($r)) {
|
||||
echo L10n::t('There are no tables on MyISAM.')."\n";
|
||||
return;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class DBStructure
|
|||
echo $sql."\n";
|
||||
|
||||
$result = DBA::e($sql);
|
||||
if (!DBM::is_result($result)) {
|
||||
if (!DBA::is_result($result)) {
|
||||
self::printUpdateError($sql);
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ class DBStructure
|
|||
);
|
||||
|
||||
// No valid result?
|
||||
if (!DBM::is_result($adminlist)) {
|
||||
if (!DBA::is_result($adminlist)) {
|
||||
logger(sprintf('Cannot notify administrators about update_id=%d, error_message=%s', $update_id, $error_message), LOGGER_INFO);
|
||||
|
||||
// Don't continue
|
||||
|
@ -105,7 +105,7 @@ class DBStructure
|
|||
|
||||
$table_status = q("SHOW TABLE STATUS WHERE `name` = '%s'", $table);
|
||||
|
||||
if (DBM::is_result($table_status)) {
|
||||
if (DBA::is_result($table_status)) {
|
||||
$table_status = $table_status[0];
|
||||
} else {
|
||||
$table_status = [];
|
||||
|
@ -114,7 +114,7 @@ class DBStructure
|
|||
$fielddata = [];
|
||||
$indexdata = [];
|
||||
|
||||
if (DBM::is_result($indexes)) {
|
||||
if (DBA::is_result($indexes)) {
|
||||
foreach ($indexes AS $index) {
|
||||
if ($index['Key_name'] != 'PRIMARY' && $index['Non_unique'] == '0' && !isset($indexdata[$index["Key_name"]])) {
|
||||
$indexdata[$index["Key_name"]] = ['UNIQUE'];
|
||||
|
@ -129,7 +129,7 @@ class DBStructure
|
|||
$indexdata[$index["Key_name"]][] = $column;
|
||||
}
|
||||
}
|
||||
if (DBM::is_result($structures)) {
|
||||
if (DBA::is_result($structures)) {
|
||||
foreach ($structures AS $field) {
|
||||
// Replace the default size values so that we don't have to define them
|
||||
$search = ['tinyint(1)', 'tinyint(3) unsigned', 'tinyint(4)', 'smallint(5) unsigned', 'smallint(6)', 'mediumint(8) unsigned', 'mediumint(9)', 'bigint(20)', 'int(10) unsigned', 'int(11)'];
|
||||
|
@ -154,7 +154,7 @@ class DBStructure
|
|||
}
|
||||
}
|
||||
}
|
||||
if (DBM::is_result($full_columns)) {
|
||||
if (DBA::is_result($full_columns)) {
|
||||
foreach ($full_columns AS $column) {
|
||||
$fielddata[$column["Field"]]["Collation"] = $column["Collation"];
|
||||
$fielddata[$column["Field"]]["comment"] = $column["Comment"];
|
||||
|
@ -222,7 +222,7 @@ class DBStructure
|
|||
$tables = q("SHOW TABLES");
|
||||
}
|
||||
|
||||
if (DBM::is_result($tables)) {
|
||||
if (DBA::is_result($tables)) {
|
||||
foreach ($tables AS $table) {
|
||||
$table = current($table);
|
||||
|
||||
|
@ -253,7 +253,7 @@ class DBStructure
|
|||
$temp_name = $name;
|
||||
if (!isset($database[$name])) {
|
||||
$r = self::createTable($name, $structure, $verbose, $action);
|
||||
if (!DBM::is_result($r)) {
|
||||
if (!DBA::is_result($r)) {
|
||||
$errors .= self::printUpdateError($name);
|
||||
}
|
||||
$is_new_table = true;
|
||||
|
@ -479,13 +479,13 @@ class DBStructure
|
|||
DBA::e("SET session old_alter_table=1;");
|
||||
} else {
|
||||
$r = DBA::e("DROP TABLE IF EXISTS `".$temp_name."`;");
|
||||
if (!DBM::is_result($r)) {
|
||||
if (!DBA::is_result($r)) {
|
||||
$errors .= self::printUpdateError($sql3);
|
||||
return $errors;
|
||||
}
|
||||
|
||||
$r = DBA::e("CREATE TABLE `".$temp_name."` LIKE `".$name."`;");
|
||||
if (!DBM::is_result($r)) {
|
||||
if (!DBA::is_result($r)) {
|
||||
$errors .= self::printUpdateError($sql3);
|
||||
return $errors;
|
||||
}
|
||||
|
@ -493,7 +493,7 @@ class DBStructure
|
|||
}
|
||||
|
||||
$r = DBA::e($sql3);
|
||||
if (!DBM::is_result($r)) {
|
||||
if (!DBA::is_result($r)) {
|
||||
$errors .= self::printUpdateError($sql3);
|
||||
}
|
||||
if ($is_unique && ($temp_name != $name)) {
|
||||
|
@ -501,17 +501,17 @@ class DBStructure
|
|||
DBA::e("SET session old_alter_table=0;");
|
||||
} else {
|
||||
$r = DBA::e("INSERT INTO `".$temp_name."` SELECT ".$field_list." FROM `".$name."`".$group_by.";");
|
||||
if (!DBM::is_result($r)) {
|
||||
if (!DBA::is_result($r)) {
|
||||
$errors .= self::printUpdateError($sql3);
|
||||
return $errors;
|
||||
}
|
||||
$r = DBA::e("DROP TABLE `".$name."`;");
|
||||
if (!DBM::is_result($r)) {
|
||||
if (!DBA::is_result($r)) {
|
||||
$errors .= self::printUpdateError($sql3);
|
||||
return $errors;
|
||||
}
|
||||
$r = DBA::e("RENAME TABLE `".$temp_name."` TO `".$name."`;");
|
||||
if (!DBM::is_result($r)) {
|
||||
if (!DBA::is_result($r)) {
|
||||
$errors .= self::printUpdateError($sql3);
|
||||
return $errors;
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ class PostUpdate
|
|||
(`thread`.`uid` IN (SELECT `uid` from `user`) OR `thread`.`uid` = 0)");
|
||||
|
||||
logger("Updated threads", LOGGER_DEBUG);
|
||||
if (DBM::is_result($r)) {
|
||||
if (DBA::is_result($r)) {
|
||||
Config::set("system", "post_update_version", 1198);
|
||||
logger("Done", LOGGER_DEBUG);
|
||||
return true;
|
||||
|
@ -207,7 +207,7 @@ class PostUpdate
|
|||
FROM `user`
|
||||
INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`");
|
||||
|
||||
if (!DBM::is_result($r)) {
|
||||
if (!DBA::is_result($r)) {
|
||||
return false;
|
||||
}
|
||||
foreach ($r as $user) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue