diff --git a/include/dba.php b/include/dba.php index 57a277f34..bccd9792b 100644 --- a/include/dba.php +++ b/include/dba.php @@ -28,8 +28,8 @@ function q($sql) { return false; } - $sql = DBA::clean_query($sql); - $sql = DBA::any_value_fallback($sql); + $sql = DBA::cleanQuery($sql); + $sql = DBA::anyValueFallback($sql); $stmt = @vsprintf($sql, $args); @@ -41,7 +41,7 @@ function q($sql) { $columns = DBA::columnCount($ret); - $data = DBA::inArray($ret); + $data = DBA::toArray($ret); if ((count($data) == 0) && ($columns == 0)) { return true; diff --git a/include/security.php b/include/security.php index 987f3b08e..53e554c3d 100644 --- a/include/security.php +++ b/include/security.php @@ -116,7 +116,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive $r = DBA::select('user', ['uid', 'username', 'nickname'], ['parent-uid' => $master_record['uid'], 'account_removed' => false]); if (DBM::is_result($r)) { - $a->identities = array_merge($a->identities, DBA::inArray($r)); + $a->identities = array_merge($a->identities, DBA::toArray($r)); } } else { // Just ensure that the array is always defined @@ -126,14 +126,14 @@ function authenticate_success($user_record, $login_initial = false, $interactive $r = DBA::select('user', ['uid', 'username', 'nickname'], ['uid' => $master_record['parent-uid'], 'account_removed' => false]); if (DBM::is_result($r)) { - $a->identities = DBA::inArray($r); + $a->identities = DBA::toArray($r); } // Then add all siblings $r = DBA::select('user', ['uid', 'username', 'nickname'], ['parent-uid' => $master_record['parent-uid'], 'account_removed' => false]); if (DBM::is_result($r)) { - $a->identities = array_merge($a->identities, DBA::inArray($r)); + $a->identities = array_merge($a->identities, DBA::toArray($r)); } } @@ -144,7 +144,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive $master_record['uid'] ); if (DBM::is_result($r)) { - $a->identities = array_merge($a->identities, DBA::inArray($r)); + $a->identities = array_merge($a->identities, DBA::toArray($r)); } if ($login_initial) { diff --git a/mod/admin.php b/mod/admin.php index 971c2890a..7b8295dba 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -479,7 +479,7 @@ function admin_page_contactblock(App $a) $statement = DBA::select('contact', [], $condition, ['limit' => [$a->pager['start'], $a->pager['itemspage']]]); - $contacts = DBA::inArray($statement); + $contacts = DBA::toArray($statement); $t = get_markup_template('admin/contactblock.tpl'); $o = replace_macros($t, [ @@ -782,7 +782,7 @@ function admin_page_workerqueue(App $a) { // get jobs from the workerqueue table $statement = DBA::select('workerqueue', ['id', 'parameter', 'created', 'priority'], ['done' => 0], ['order'=> ['priority']]); - $r = DBA::inArray($statement); + $r = DBA::toArray($statement); for($i = 0; $i < count($r); $i++) { $r[$i]['parameter'] = implode(json_decode($r[$i]['parameter']), ': '); @@ -816,7 +816,7 @@ function admin_page_workerqueue(App $a) function admin_page_summary(App $a) { // are there MyISAM tables in the DB? If so, trigger a warning message - $r = q("SELECT `engine` FROM `information_schema`.`tables` WHERE `engine` = 'myisam' AND `table_schema` = '%s' LIMIT 1", dbesc(DBA::database_name())); + $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)) { diff --git a/mod/community.php b/mod/community.php index 7775fdba4..61b523ba4 100644 --- a/mod/community.php +++ b/mod/community.php @@ -198,14 +198,14 @@ function community_getitems($start, $itemspage, $content) AND NOT `thread`.`private` AND `thread`.`wall` AND `thread`.`origin` ORDER BY `thread`.`commented` DESC LIMIT " . intval($start) . ", " . intval($itemspage) ); - return DBA::inArray($r); + return DBA::toArray($r); } elseif ($content == 'global') { $r = DBA::p("SELECT `uri` FROM `thread` INNER JOIN `item` ON `item`.`id` = `thread`.`iid` INNER JOIN `contact` AS `author` ON `author`.`id`=`item`.`author-id` WHERE `thread`.`uid` = 0 AND NOT `author`.`hidden` AND NOT `author`.`blocked` ORDER BY `thread`.`commented` DESC LIMIT " . intval($start) . ", " . intval($itemspage)); - return DBA::inArray($r); + return DBA::toArray($r); } // Should never happen diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 726f8335d..08c43d0fb 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -213,7 +213,7 @@ function dfrn_dispatch_public($postdata) } // We now have some contact, so we fetch it - $importer = DBA::fetch_first("SELECT *, `name` as `senderName` + $importer = DBA::fetchFirst("SELECT *, `name` as `senderName` FROM `contact` WHERE NOT `blocked` AND `id` = ? LIMIT 1", $contact['id']); @@ -252,7 +252,7 @@ function dfrn_dispatch_private($user, $postdata) } // We now have some contact, so we fetch it - $importer = DBA::fetch_first("SELECT *, `name` as `senderName` + $importer = DBA::fetchFirst("SELECT *, `name` as `senderName` FROM `contact` WHERE NOT `blocked` AND `id` = ? LIMIT 1", $cid); diff --git a/mod/directory.php b/mod/directory.php index 2f5d364e9..08354e3a9 100644 --- a/mod/directory.php +++ b/mod/directory.php @@ -83,7 +83,7 @@ function directory_content(App $a) $publish = (Config::get('system', 'publish_all') ? '' : " AND `publish` = 1 " ); - $cnt = DBA::fetch_first("SELECT COUNT(*) AS `total` FROM `profile` + $cnt = DBA::fetchFirst("SELECT COUNT(*) AS `total` FROM `profile` LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` $sql_extra"); if (DBM::is_result($cnt)) { diff --git a/mod/display.php b/mod/display.php index e615b6843..98478024f 100644 --- a/mod/display.php +++ b/mod/display.php @@ -87,7 +87,7 @@ function display_init(App $a) $nickname = str_replace(normalise_link(System::baseUrl())."/profile/", "", normalise_link($profiledata["url"])); if (($nickname != $a->user["nickname"])) { - $profile = DBA::fetch_first("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile` + $profile = DBA::fetchFirst("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile` INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid` WHERE `user`.`nickname` = ? AND `profile`.`is-default` AND `contact`.`self` LIMIT 1", $nickname diff --git a/mod/network.php b/mod/network.php index 79910152b..50eb025c2 100644 --- a/mod/network.php +++ b/mod/network.php @@ -845,7 +845,7 @@ function networkThreadedView(App $a, $update, $parent) local_user(), TERM_OBJ_POST, TERM_HASHTAG, $top_limit, $bottom_limit); - $data = DBA::inArray($items); + $data = DBA::toArray($items); if (count($data) > 0) { $tag_top_limit = current($data)['order_date']; diff --git a/src/App.php b/src/App.php index 66bec51de..4d46e1604 100644 --- a/src/App.php +++ b/src/App.php @@ -496,7 +496,7 @@ class App $this->mode |= App::MODE_DBAVAILABLE; - if (DBA::fetch_first("SHOW TABLES LIKE 'config'") === false) { + if (DBA::fetchFirst("SHOW TABLES LIKE 'config'") === false) { return; } diff --git a/src/Content/ContactSelector.php b/src/Content/ContactSelector.php index 797ec7861..21757d429 100644 --- a/src/Content/ContactSelector.php +++ b/src/Content/ContactSelector.php @@ -27,7 +27,7 @@ class ContactSelector $o .= "