<?php
+
+use \Friendica\Core\Config;
+
require_once("boot.php");
require_once('include/queue_fn.php');
require_once('include/dfrn.php');
require_once('include/bbcode.php');
require_once('include/socgraph.php');
- load_config('config');
- load_config('system');
+ Config::load();
// Don't check this stuff if the function is called by the poller
if (App::callstack() != "poller_run")
$interval = false;
$r = q("select * from deliverq where 1");
- if($r) {
- foreach($r as $rr) {
+ if ($r) {
+ foreach ($r as $rr) {
logger('queue: deliverq');
proc_run(PRIORITY_HIGH,'include/delivery.php',$rr['cmd'],$rr['item'],$rr['contact']);
- if($interval)
- @time_sleep_until(microtime(true) + (float) $interval);
+ if($interval) {
+ time_sleep_until(microtime(true) + (float) $interval);
+ }
}
}
$r = q("SELECT `queue`.*, `contact`.`name`, `contact`.`uid` FROM `queue`
INNER JOIN `contact` ON `queue`.`cid` = `contact`.`id`
WHERE `queue`.`created` < UTC_TIMESTAMP() - INTERVAL 3 DAY");
- if($r) {
- foreach($r as $rr) {
+ if ($r) {
+ foreach ($r as $rr) {
logger('Removing expired queue item for ' . $rr['name'] . ', uid=' . $rr['uid']);
logger('Expired queue data :' . $rr['content'], LOGGER_DATA);
}
$c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
intval($qi[0]['cid'])
);
- if(! count($c)) {
+ if (! dbm::is_result($c)) {
remove_queue_item($q_item['id']);
continue;
}
FROM `user` WHERE `uid` = %d LIMIT 1",
intval($c[0]['uid'])
);
- if(! count($u)) {
+ if (! dbm::is_result($u)) {
remove_queue_item($q_item['id']);
continue;
}