Rename DBM method calls to DBA method calls

This commit is contained in:
Hypolite Petovan 2018-07-21 08:40:21 -04:00 committed by Hypolite Petovan
parent 8ddb94ef06
commit 0ec44f3e8a
153 changed files with 813 additions and 918 deletions

View file

@ -15,7 +15,6 @@ use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Database\DBM;
use Friendica\Database\DBStructure;
use Friendica\Model\Contact;
use Friendica\Model\Item;
@ -819,7 +818,7 @@ function admin_page_summary(App $a)
$r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1", dbesc(DBA::databaseName()));
$showwarning = false;
$warningtext = [];
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
$showwarning = true;
$warningtext[] = L10n::t('Your DB still runs with MyISAM tables. You should change the engine type to InnoDB. As Friendica will use InnoDB only features in the future, you should change this! See <a href="%s">here</a> for a guide that may be helpful converting the table engines. You may also use the command <tt>php bin/console.php dbstructure toinnodb</tt> of your Friendica installation for an automatic conversion.<br />', 'https://dev.mysql.com/doc/refman/5.7/en/converting-tables-to-innodb.html');
}
@ -961,7 +960,7 @@ function admin_page_site_post(App $a)
$r = q("UPDATE %s SET %s;", $table_name, $upds);
if (!DBM::is_result($r)) {
if (!DBA::is_result($r)) {
notice("Failed updating '$table_name': " . DBA::errorMessage());
goaway('admin/site');
}
@ -1581,7 +1580,7 @@ function admin_page_dbsync(App $a)
$failed = [];
$r = q("SELECT `k`, `v` FROM `config` WHERE `cat` = 'database' ");
if (DBM::is_result($r)) {
if (DBA::is_result($r)) {
foreach ($r as $rr) {
$upd = intval(substr($rr['k'], 7));
if ($upd < 1139 || $rr['v'] === 'success') {
@ -1731,7 +1730,7 @@ function admin_page_users(App $a)
if ($a->argc > 2) {
$uid = $a->argv[3];
$user = DBA::selectFirst('user', ['username', 'blocked'], ['uid' => $uid]);
if (!DBM::is_result($user)) {
if (!DBA::is_result($user)) {
notice('User not found' . EOL);
goaway('admin/users');
return ''; // NOTREACHED