Rename DBA::fetch_first to DBA::fetchFirst
This commit is contained in:
parent
591939dfc0
commit
f051ae1698
12 changed files with 18 additions and 18 deletions
|
@ -213,7 +213,7 @@ function dfrn_dispatch_public($postdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
// We now have some contact, so we fetch it
|
// 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`
|
FROM `contact`
|
||||||
WHERE NOT `blocked` AND `id` = ? LIMIT 1",
|
WHERE NOT `blocked` AND `id` = ? LIMIT 1",
|
||||||
$contact['id']);
|
$contact['id']);
|
||||||
|
@ -252,7 +252,7 @@ function dfrn_dispatch_private($user, $postdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
// We now have some contact, so we fetch it
|
// 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`
|
FROM `contact`
|
||||||
WHERE NOT `blocked` AND `id` = ? LIMIT 1",
|
WHERE NOT `blocked` AND `id` = ? LIMIT 1",
|
||||||
$cid);
|
$cid);
|
||||||
|
|
|
@ -83,7 +83,7 @@ function directory_content(App $a)
|
||||||
$publish = (Config::get('system', 'publish_all') ? '' : " AND `publish` = 1 " );
|
$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`
|
LEFT JOIN `user` ON `user`.`uid` = `profile`.`uid`
|
||||||
WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` $sql_extra");
|
WHERE `is-default` $publish AND NOT `user`.`blocked` AND NOT `user`.`account_removed` $sql_extra");
|
||||||
if (DBM::is_result($cnt)) {
|
if (DBM::is_result($cnt)) {
|
||||||
|
|
|
@ -87,7 +87,7 @@ function display_init(App $a)
|
||||||
$nickname = str_replace(normalise_link(System::baseUrl())."/profile/", "", normalise_link($profiledata["url"]));
|
$nickname = str_replace(normalise_link(System::baseUrl())."/profile/", "", normalise_link($profiledata["url"]));
|
||||||
|
|
||||||
if (($nickname != $a->user["nickname"])) {
|
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`
|
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",
|
WHERE `user`.`nickname` = ? AND `profile`.`is-default` AND `contact`.`self` LIMIT 1",
|
||||||
$nickname
|
$nickname
|
||||||
|
|
|
@ -496,7 +496,7 @@ class App
|
||||||
|
|
||||||
$this->mode |= App::MODE_DBAVAILABLE;
|
$this->mode |= App::MODE_DBAVAILABLE;
|
||||||
|
|
||||||
if (DBA::fetch_first("SHOW TABLES LIKE 'config'") === false) {
|
if (DBA::fetchFirst("SHOW TABLES LIKE 'config'") === false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ class ContactSelector
|
||||||
$networkname = str_replace($search, $replace, $s);
|
$networkname = str_replace($search, $replace, $s);
|
||||||
|
|
||||||
if ((in_array($s, [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS])) && ($profile != "")) {
|
if ((in_array($s, [NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS])) && ($profile != "")) {
|
||||||
$r = DBA::fetch_first("SELECT `gserver`.`platform` FROM `gcontact`
|
$r = DBA::fetchFirst("SELECT `gserver`.`platform` FROM `gcontact`
|
||||||
INNER JOIN `gserver` ON `gserver`.`nurl` = `gcontact`.`server_url`
|
INNER JOIN `gserver` ON `gserver`.`nurl` = `gcontact`.`server_url`
|
||||||
WHERE `gcontact`.`nurl` = ? AND `platform` != ''", normalise_link($profile));
|
WHERE `gcontact`.`nurl` = ? AND `platform` != ''", normalise_link($profile));
|
||||||
|
|
||||||
|
|
|
@ -477,7 +477,7 @@ class Worker
|
||||||
|
|
||||||
if ($max == 0) {
|
if ($max == 0) {
|
||||||
// the maximum number of possible user connections can be a system variable
|
// the maximum number of possible user connections can be a system variable
|
||||||
$r = DBA::fetch_first("SHOW VARIABLES WHERE `variable_name` = 'max_user_connections'");
|
$r = DBA::fetchFirst("SHOW VARIABLES WHERE `variable_name` = 'max_user_connections'");
|
||||||
if (DBM::is_result($r)) {
|
if (DBM::is_result($r)) {
|
||||||
$max = $r["Value"];
|
$max = $r["Value"];
|
||||||
}
|
}
|
||||||
|
@ -513,7 +513,7 @@ class Worker
|
||||||
|
|
||||||
// We will now check for the system values.
|
// We will now check for the system values.
|
||||||
// This limit could be reached although the user limits are fine.
|
// This limit could be reached although the user limits are fine.
|
||||||
$r = DBA::fetch_first("SHOW VARIABLES WHERE `variable_name` = 'max_connections'");
|
$r = DBA::fetchFirst("SHOW VARIABLES WHERE `variable_name` = 'max_connections'");
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBM::is_result($r)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -521,7 +521,7 @@ class Worker
|
||||||
if ($max == 0) {
|
if ($max == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$r = DBA::fetch_first("SHOW STATUS WHERE `variable_name` = 'Threads_connected'");
|
$r = DBA::fetchFirst("SHOW STATUS WHERE `variable_name` = 'Threads_connected'");
|
||||||
if (!DBM::is_result($r)) {
|
if (!DBM::is_result($r)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -683,7 +683,7 @@ class DBA
|
||||||
* @param string $sql SQL statement
|
* @param string $sql SQL statement
|
||||||
* @return array first row of query
|
* @return array first row of query
|
||||||
*/
|
*/
|
||||||
public static function fetch_first($sql) {
|
public static function fetchFirst($sql) {
|
||||||
$params = self::getParam(func_get_args());
|
$params = self::getParam(func_get_args());
|
||||||
|
|
||||||
$stmt = self::p($sql, $params);
|
$stmt = self::p($sql, $params);
|
||||||
|
@ -1344,7 +1344,7 @@ class DBA
|
||||||
|
|
||||||
$sql = "SELECT COUNT(*) AS `count` FROM `".$table."`".$condition_string;
|
$sql = "SELECT COUNT(*) AS `count` FROM `".$table."`".$condition_string;
|
||||||
|
|
||||||
$row = self::fetch_first($sql, $condition);
|
$row = self::fetchFirst($sql, $condition);
|
||||||
|
|
||||||
return $row['count'];
|
return $row['count'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ class Contact extends BaseObject
|
||||||
{
|
{
|
||||||
$return = 0;
|
$return = 0;
|
||||||
if (intval($gid)) {
|
if (intval($gid)) {
|
||||||
$contacts = DBA::fetch_first('SELECT COUNT(*) AS `count`
|
$contacts = DBA::fetchFirst('SELECT COUNT(*) AS `count`
|
||||||
FROM `contact`
|
FROM `contact`
|
||||||
INNER JOIN `group_member`
|
INNER JOIN `group_member`
|
||||||
ON `contact`.`id` = `group_member`.`contact-id`
|
ON `contact`.`id` = `group_member`.`contact-id`
|
||||||
|
|
|
@ -2427,7 +2427,7 @@ class Item extends BaseObject
|
||||||
|
|
||||||
// Does the given user have this item?
|
// Does the given user have this item?
|
||||||
if ($uid) {
|
if ($uid) {
|
||||||
$item = DBA::fetch_first("SELECT `item`.`id`, `user`.`nickname` FROM `item`
|
$item = DBA::fetchFirst("SELECT `item`.`id`, `user`.`nickname` FROM `item`
|
||||||
INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
|
INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
|
||||||
WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
|
WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
|
||||||
AND `item`.`guid` = ? AND `item`.`uid` = ?", $guid, $uid);
|
AND `item`.`guid` = ? AND `item`.`uid` = ?", $guid, $uid);
|
||||||
|
@ -2439,7 +2439,7 @@ class Item extends BaseObject
|
||||||
|
|
||||||
// Or is it anywhere on the server?
|
// Or is it anywhere on the server?
|
||||||
if ($nick == "") {
|
if ($nick == "") {
|
||||||
$item = DBA::fetch_first("SELECT `item`.`id`, `user`.`nickname` FROM `item`
|
$item = DBA::fetchFirst("SELECT `item`.`id`, `user`.`nickname` FROM `item`
|
||||||
INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
|
INNER JOIN `user` ON `user`.`uid` = `item`.`uid`
|
||||||
WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
|
WHERE `item`.`visible` AND NOT `item`.`deleted` AND NOT `item`.`moderated`
|
||||||
AND NOT `item`.`private` AND `item`.`wall`
|
AND NOT `item`.`private` AND `item`.`wall`
|
||||||
|
|
|
@ -210,7 +210,7 @@ class Profile
|
||||||
$profile = null;
|
$profile = null;
|
||||||
|
|
||||||
if ($profile_id) {
|
if ($profile_id) {
|
||||||
$profile = DBA::fetch_first(
|
$profile = DBA::fetchFirst(
|
||||||
"SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` AS `contact_photo`,
|
"SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` AS `contact_photo`,
|
||||||
`contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
|
`contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
|
||||||
`profile`.`uid` AS `profile_uid`, `profile`.*,
|
`profile`.`uid` AS `profile_uid`, `profile`.*,
|
||||||
|
@ -224,7 +224,7 @@ class Profile
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!DBM::is_result($profile)) {
|
if (!DBM::is_result($profile)) {
|
||||||
$profile = DBA::fetch_first(
|
$profile = DBA::fetchFirst(
|
||||||
"SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` as `contact_photo`,
|
"SELECT `contact`.`id` AS `contact_id`, `contact`.`photo` as `contact_photo`,
|
||||||
`contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
|
`contact`.`thumb` AS `contact_thumb`, `contact`.`micro` AS `contact_micro`,
|
||||||
`profile`.`uid` AS `profile_uid`, `profile`.*,
|
`profile`.`uid` AS `profile_uid`, `profile`.*,
|
||||||
|
|
|
@ -38,7 +38,7 @@ class User
|
||||||
* @return boolean|array
|
* @return boolean|array
|
||||||
*/
|
*/
|
||||||
public static function getOwnerDataById($uid) {
|
public static function getOwnerDataById($uid) {
|
||||||
$r = DBA::fetch_first("SELECT
|
$r = DBA::fetchFirst("SELECT
|
||||||
`contact`.*,
|
`contact`.*,
|
||||||
`user`.`prvkey` AS `uprvkey`,
|
`user`.`prvkey` AS `uprvkey`,
|
||||||
`user`.`timezone`,
|
`user`.`timezone`,
|
||||||
|
|
|
@ -254,7 +254,7 @@ class Delivery extends BaseObject
|
||||||
}
|
}
|
||||||
|
|
||||||
// We now have some contact, so we fetch it
|
// We now have some contact, so we fetch it
|
||||||
$target_importer = DBA::fetch_first("SELECT *, `name` as `senderName`
|
$target_importer = DBA::fetchFirst("SELECT *, `name` as `senderName`
|
||||||
FROM `contact`
|
FROM `contact`
|
||||||
WHERE NOT `blocked` AND `id` = ? LIMIT 1",
|
WHERE NOT `blocked` AND `id` = ? LIMIT 1",
|
||||||
$cid);
|
$cid);
|
||||||
|
|
Loading…
Reference in a new issue