mirror of
https://github.com/friendica/friendica
synced 2025-04-29 03:04:22 +02:00
parent
6189f6c8e7
commit
4ca68c7af0
151 changed files with 987 additions and 8742 deletions
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
namespace Friendica\Core;
|
||||
|
||||
use Friendica\Database\Dbm;
|
||||
use Friendica\Database\DBM;
|
||||
use dba;
|
||||
|
||||
/**
|
||||
|
@ -99,7 +99,7 @@ class Config {
|
|||
}
|
||||
|
||||
$ret = dba::select('config', array('v'), array('cat' => $family, 'k' => $key), array('limit' => 1));
|
||||
if (Dbm::is_result($ret)) {
|
||||
if (DBM::is_result($ret)) {
|
||||
// manage array value
|
||||
$val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret['v']) ? unserialize($ret['v']) : $ret['v']);
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace Friendica\Core;
|
|||
|
||||
use Friendica\Core\Pconfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\Dbm;
|
||||
use Friendica\Database\DBM;
|
||||
|
||||
require_once 'include/html2plain.php';
|
||||
require_once 'include/datetime.php';
|
||||
|
@ -95,7 +95,7 @@ class NotificationsManager {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if (Dbm::is_result($r))
|
||||
if (DBM::is_result($r))
|
||||
return $this->_set_extra($r);
|
||||
|
||||
return false;
|
||||
|
@ -112,7 +112,7 @@ class NotificationsManager {
|
|||
intval($id),
|
||||
intval(local_user())
|
||||
);
|
||||
if (Dbm::is_result($r)) {
|
||||
if (DBM::is_result($r)) {
|
||||
return $this->_set_extra($r)[0];
|
||||
}
|
||||
return null;
|
||||
|
@ -215,7 +215,7 @@ class NotificationsManager {
|
|||
$notif = array();
|
||||
$arr = array();
|
||||
|
||||
if (Dbm::is_result($notifs)) {
|
||||
if (DBM::is_result($notifs)) {
|
||||
|
||||
foreach ($notifs as $it) {
|
||||
// Because we use different db tables for the notification query
|
||||
|
@ -386,7 +386,7 @@ class NotificationsManager {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if (Dbm::is_result($r))
|
||||
if (DBM::is_result($r))
|
||||
return $r[0]['total'];
|
||||
|
||||
return 0;
|
||||
|
@ -429,7 +429,7 @@ class NotificationsManager {
|
|||
intval($limit)
|
||||
);
|
||||
|
||||
if (Dbm::is_result($r))
|
||||
if (DBM::is_result($r))
|
||||
$notifs = $this->formatNotifs($r, $ident);
|
||||
|
||||
$arr = array (
|
||||
|
@ -458,7 +458,7 @@ class NotificationsManager {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if (Dbm::is_result($r))
|
||||
if (DBM::is_result($r))
|
||||
return $r[0]['total'];
|
||||
|
||||
return 0;
|
||||
|
@ -494,7 +494,7 @@ class NotificationsManager {
|
|||
intval($limit)
|
||||
);
|
||||
|
||||
if (Dbm::is_result($r))
|
||||
if (DBM::is_result($r))
|
||||
$notifs = $this->formatNotifs($r, $ident);
|
||||
|
||||
$arr = array (
|
||||
|
@ -548,7 +548,7 @@ class NotificationsManager {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if (Dbm::is_result($r))
|
||||
if (DBM::is_result($r))
|
||||
return $r[0]['total'];
|
||||
|
||||
return 0;
|
||||
|
@ -592,7 +592,7 @@ class NotificationsManager {
|
|||
intval($limit)
|
||||
);
|
||||
|
||||
if (Dbm::is_result($r))
|
||||
if (DBM::is_result($r))
|
||||
$notifs = $this->formatNotifs($r, $ident);
|
||||
|
||||
$arr = array (
|
||||
|
@ -624,7 +624,7 @@ class NotificationsManager {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if (Dbm::is_result($r))
|
||||
if (DBM::is_result($r))
|
||||
return $r[0]['total'];
|
||||
|
||||
return 0;
|
||||
|
@ -666,7 +666,7 @@ class NotificationsManager {
|
|||
intval($limit)
|
||||
);
|
||||
|
||||
if (Dbm::is_result($r))
|
||||
if (DBM::is_result($r))
|
||||
$notifs = $this->formatNotifs($r, $ident);
|
||||
|
||||
$arr = array (
|
||||
|
@ -696,7 +696,7 @@ class NotificationsManager {
|
|||
intval($_SESSION['uid'])
|
||||
);
|
||||
|
||||
if (Dbm::is_result($r))
|
||||
if (DBM::is_result($r))
|
||||
return $r[0]['total'];
|
||||
|
||||
return 0;
|
||||
|
@ -743,7 +743,7 @@ class NotificationsManager {
|
|||
intval($limit)
|
||||
);
|
||||
|
||||
if (Dbm::is_result($r))
|
||||
if (DBM::is_result($r))
|
||||
$notifs = $this->formatIntros($r);
|
||||
|
||||
$arr = array (
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
namespace Friendica\Core;
|
||||
|
||||
use Friendica\Database\Dbm;
|
||||
use Friendica\Database\DBM;
|
||||
use dba;
|
||||
|
||||
/**
|
||||
|
@ -37,7 +37,7 @@ class PConfig {
|
|||
$a = get_app();
|
||||
|
||||
$r = dba::select('pconfig', array('v', 'k'), array('cat' => $family, 'uid' => $uid));
|
||||
if (Dbm::is_result($r)) {
|
||||
if (DBM::is_result($r)) {
|
||||
while ($rr = dba::fetch($r)) {
|
||||
$k = $rr['k'];
|
||||
$a->config[$uid][$family][$k] = $rr['v'];
|
||||
|
@ -90,7 +90,7 @@ class PConfig {
|
|||
}
|
||||
|
||||
$ret = dba::select('pconfig', array('v'), array('uid' => $uid, 'cat' => $family, 'k' => $key), array('limit' => 1));
|
||||
if (Dbm::is_result($ret)) {
|
||||
if (DBM::is_result($ret)) {
|
||||
$val = (preg_match("|^a:[0-9]+:{.*}$|s", $ret['v']) ? unserialize($ret['v']) : $ret['v']);
|
||||
$a->config[$uid][$family][$key] = $val;
|
||||
self::$in_db[$uid][$family][$key] = true;
|
||||
|
|
|
@ -5,7 +5,7 @@ use Friendica\App;
|
|||
use Friendica\Core\System;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\Dbm;
|
||||
use Friendica\Database\DBM;
|
||||
use Friendica\Util\Lock;
|
||||
|
||||
use dba;
|
||||
|
@ -142,7 +142,7 @@ class Worker {
|
|||
*/
|
||||
private static function totalEntries() {
|
||||
$s = dba::fetch_first("SELECT COUNT(*) AS `total` FROM `workerqueue` WHERE `executed` <= ? AND NOT `done`", NULL_DATE);
|
||||
if (Dbm::is_result($s)) {
|
||||
if (DBM::is_result($s)) {
|
||||
return $s["total"];
|
||||
} else {
|
||||
return 0;
|
||||
|
@ -157,7 +157,7 @@ class Worker {
|
|||
private static function highestPriority() {
|
||||
$condition = array("`executed` <= ? AND NOT `done`", NULL_DATE);
|
||||
$s = dba::select('workerqueue', array('priority'), $condition, array('limit' => 1, 'order' => array('priority')));
|
||||
if (Dbm::is_result($s)) {
|
||||
if (DBM::is_result($s)) {
|
||||
return $s["priority"];
|
||||
} else {
|
||||
return 0;
|
||||
|
@ -405,7 +405,7 @@ class Worker {
|
|||
if ($max == 0) {
|
||||
// the maximum number of possible user connections can be a system variable
|
||||
$r = dba::fetch_first("SHOW VARIABLES WHERE `variable_name` = 'max_user_connections'");
|
||||
if (Dbm::is_result($r)) {
|
||||
if (DBM::is_result($r)) {
|
||||
$max = $r["Value"];
|
||||
}
|
||||
// Or it can be granted. This overrides the system variable
|
||||
|
@ -441,7 +441,7 @@ class Worker {
|
|||
// We will now check for the system values.
|
||||
// This limit could be reached although the user limits are fine.
|
||||
$r = dba::fetch_first("SHOW VARIABLES WHERE `variable_name` = 'max_connections'");
|
||||
if (!Dbm::is_result($r)) {
|
||||
if (!DBM::is_result($r)) {
|
||||
return false;
|
||||
}
|
||||
$max = intval($r["Value"]);
|
||||
|
@ -449,7 +449,7 @@ class Worker {
|
|||
return false;
|
||||
}
|
||||
$r = dba::fetch_first("SHOW STATUS WHERE `variable_name` = 'Threads_connected'");
|
||||
if (!Dbm::is_result($r)) {
|
||||
if (!DBM::is_result($r)) {
|
||||
return false;
|
||||
}
|
||||
$used = intval($r["Value"]);
|
||||
|
@ -631,7 +631,7 @@ class Worker {
|
|||
INNER JOIN `workerqueue` ON `workerqueue`.`pid` = `process`.`pid` AND NOT `done`");
|
||||
|
||||
// No active processes at all? Fine
|
||||
if (!Dbm::is_result($r)) {
|
||||
if (!DBM::is_result($r)) {
|
||||
return false;
|
||||
}
|
||||
$priorities = array();
|
||||
|
@ -754,7 +754,7 @@ class Worker {
|
|||
|
||||
// There can already be jobs for us in the queue.
|
||||
$r = dba::select('workerqueue', array(), array('pid' => getmypid(), 'done' => false));
|
||||
if (Dbm::is_result($r)) {
|
||||
if (DBM::is_result($r)) {
|
||||
self::$db_duration += (microtime(true) - $stamp);
|
||||
return dba::inArray($r);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue