aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Directory.php
diff options
context:
space:
mode:
authorHilmar R <u02@u29lx193>2021-02-28 21:06:16 +0100
committerHilmar R <u02@u29lx193>2021-03-01 18:48:11 +0100
commitc26dede97f626b52b7bf8962ed55d1dbda86abe8 (patch)
tree3c8c9bc97aa09f7ce9afe9bf467cf87bbf2c7d0b /Zotlabs/Daemon/Directory.php
parentea3390d626f85b7293a750958bfd1b5460958365 (diff)
downloadvolse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.tar.gz
volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.tar.bz2
volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.zip
get dev
Diffstat (limited to 'Zotlabs/Daemon/Directory.php')
-rw-r--r--Zotlabs/Daemon/Directory.php40
1 files changed, 19 insertions, 21 deletions
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']));
}
}