aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-01-18 13:49:58 +0000
committerMario <mario@mariovavti.com>2021-01-18 13:49:58 +0000
commitd5bd09b983f5d3edc44bf383a27ef84a9aa84f5a (patch)
tree6f03b28a92b7bb6fa5474e56bba87a6406010b8e
parent45350179b4ad48b8fc81e23722974d95f39a1fe2 (diff)
downloadvolse-hubzilla-d5bd09b983f5d3edc44bf383a27ef84a9aa84f5a.tar.gz
volse-hubzilla-d5bd09b983f5d3edc44bf383a27ef84a9aa84f5a.tar.bz2
volse-hubzilla-d5bd09b983f5d3edc44bf383a27ef84a9aa84f5a.zip
cleanup daemon/deliver_hooks, daemon/directory
-rw-r--r--Zotlabs/Daemon/Deliver_hooks.php11
-rw-r--r--Zotlabs/Daemon/Directory.php40
-rw-r--r--Zotlabs/Lib/Libzot.php2
3 files changed, 24 insertions, 29 deletions
diff --git a/Zotlabs/Daemon/Deliver_hooks.php b/Zotlabs/Daemon/Deliver_hooks.php
index e8b5acef0..4d3ce4e1d 100644
--- a/Zotlabs/Daemon/Deliver_hooks.php
+++ b/Zotlabs/Daemon/Deliver_hooks.php
@@ -2,21 +2,18 @@
namespace Zotlabs\Daemon;
-require_once('include/zot.php');
-
class Deliver_hooks {
- static public function run($argc,$argv) {
+ static public function run($argc, $argv) {
- if($argc < 2)
+ if ($argc < 2)
return;
-
$r = q("select * from item where id = '%d'",
intval($argv[1])
);
- if($r)
- call_hooks('notifier_normal',$r[0]);
+ if ($r)
+ call_hooks('notifier_normal', $r[0]);
}
}
diff --git a/Zotlabs/Daemon/Directory.php b/Zotlabs/Daemon/Directory.php
index ab58432de..1f307b273 100644
--- a/Zotlabs/Daemon/Directory.php
+++ b/Zotlabs/Daemon/Directory.php
@@ -8,40 +8,40 @@ use Zotlabs\Lib\Queue;
class Directory {
- static public function run($argc,$argv){
+ static public function run($argc, $argv) {
- if($argc < 2)
+ if ($argc < 2)
return;
- $force = false;
+ $force = false;
$pushall = true;
- if($argc > 2) {
- if($argv[2] === 'force')
+ if ($argc > 2) {
+ if ($argv[2] === 'force')
$force = true;
- if($argv[2] === 'nopush')
+ if ($argv[2] === 'nopush')
$pushall = false;
- }
+ }
logger('directory update', LOGGER_DEBUG);
- $dirmode = get_config('system','directory_mode');
- if($dirmode === false)
+ $dirmode = get_config('system', 'directory_mode');
+ if ($dirmode === false)
$dirmode = DIRECTORY_MODE_NORMAL;
$x = q("select * from channel where channel_id = %d limit 1",
intval($argv[1])
);
- if(! $x)
+ if (!$x)
return;
$channel = $x[0];
- if($dirmode != DIRECTORY_MODE_NORMAL) {
+ if ($dirmode != DIRECTORY_MODE_NORMAL) {
// this is an in-memory update and we don't need to send a network packet.
- Libzotdir::local_dir_update($argv[1],$force);
+ Libzotdir::local_dir_update($argv[1], $force);
q("update channel set channel_dirdate = '%s' where channel_id = %d",
dbesc(datetime_convert()),
@@ -49,8 +49,8 @@ class Directory {
);
// Now update all the connections
- if($pushall)
- Master::Summon(array('Notifier','refresh_all',$channel['channel_id']));
+ if ($pushall)
+ Master::Summon(array('Notifier', 'refresh_all', $channel['channel_id']));
return;
}
@@ -63,14 +63,12 @@ class Directory {
// ensure the upstream directory is updated
-
- $packet = Libzot::build_packet($channel,(($force) ? 'force_refresh' : 'refresh'));
- $z = Libzot::zot($url,$packet,$channel);
-
+ $packet = Libzot::build_packet($channel, (($force) ? 'force_refresh' : 'refresh'));
+ $z = Libzot::zot($url, $packet, $channel);
// re-queue if unsuccessful
- if(! $z['success']) {
+ if (!$z['success']) {
/** @FIXME we aren't updating channel_dirdate if we have to queue
* the directory packet. That means we'll try again on the next poll run.
@@ -95,8 +93,8 @@ class Directory {
}
// Now update all the connections
- if($pushall)
- Master::Summon(array('Notifier','refresh_all',$channel['channel_id']));
+ if ($pushall)
+ Master::Summon(array('Notifier', 'refresh_all', $channel['channel_id']));
}
}
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 9483759cf..cde4c0145 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -189,7 +189,7 @@ class Libzot {
* @see z_post_url()
*
* @param string $url
- * @param array $data
+ * @param string $data
* @param array $channel (required if using zot6 delivery)
* @param array $crypto (required if encrypted httpsig, requires hubloc_sitekey and site_crypto elements)
* @return array see z_post_url() for returned data format