2021-12-03 03:01:39 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/** @file */
|
2016-05-20 02:42:45 +00:00
|
|
|
|
|
|
|
namespace Zotlabs\Daemon;
|
|
|
|
|
2018-06-01 02:42:13 +00:00
|
|
|
use Zotlabs\Lib\Libzot;
|
2018-07-03 05:43:41 +00:00
|
|
|
use Zotlabs\Lib\Queue;
|
2016-05-20 02:42:45 +00:00
|
|
|
|
2021-12-03 03:01:39 +00:00
|
|
|
class Deliver
|
|
|
|
{
|
2016-05-20 02:42:45 +00:00
|
|
|
|
2021-12-03 03:01:39 +00:00
|
|
|
public static function run($argc, $argv)
|
|
|
|
{
|
2016-05-20 02:42:45 +00:00
|
|
|
|
2021-12-03 03:01:39 +00:00
|
|
|
if ($argc < 2) {
|
|
|
|
return;
|
|
|
|
}
|
2016-05-20 02:42:45 +00:00
|
|
|
|
2021-12-03 03:01:39 +00:00
|
|
|
logger('deliver: invoked: ' . print_r($argv, true), LOGGER_DATA);
|
2016-05-20 02:42:45 +00:00
|
|
|
|
2021-12-03 03:01:39 +00:00
|
|
|
for ($x = 1; $x < $argc; $x++) {
|
|
|
|
if (! $argv[$x]) {
|
|
|
|
continue;
|
|
|
|
}
|
2016-05-20 03:48:40 +00:00
|
|
|
|
2021-12-03 03:01:39 +00:00
|
|
|
$r = q(
|
|
|
|
"select * from outq where outq_hash = '%s' limit 1",
|
|
|
|
dbesc($argv[$x])
|
|
|
|
);
|
|
|
|
if ($r) {
|
|
|
|
Queue::deliver($r[0], true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-05-20 02:42:45 +00:00
|
|
|
}
|