aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/File_importer.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2021-09-30 12:25:03 +0200
committerMario Vavti <mario@mariovavti.com>2021-09-30 12:25:03 +0200
commitb9b4e71f7d81cca23a08c55fc12db5f62ece2b56 (patch)
tree60e5f7680c111089b07346618b97e7f1abe3b035 /Zotlabs/Daemon/File_importer.php
parentb0bf646d71b6ee393c9b00b608cf6ee28ca342cc (diff)
downloadvolse-hubzilla-b9b4e71f7d81cca23a08c55fc12db5f62ece2b56.tar.gz
volse-hubzilla-b9b4e71f7d81cca23a08c55fc12db5f62ece2b56.tar.bz2
volse-hubzilla-b9b4e71f7d81cca23a08c55fc12db5f62ece2b56.zip
provide a very simple status page for content import
Diffstat (limited to 'Zotlabs/Daemon/File_importer.php')
-rw-r--r--Zotlabs/Daemon/File_importer.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/Zotlabs/Daemon/File_importer.php b/Zotlabs/Daemon/File_importer.php
index 2be946fc3..bb12cdf70 100644
--- a/Zotlabs/Daemon/File_importer.php
+++ b/Zotlabs/Daemon/File_importer.php
@@ -3,6 +3,8 @@
namespace Zotlabs\Daemon;
use Zotlabs\Web\HTTPSig;
+use Zotlabs\Lib\PConfig;
+
require_once('include/cli_startup.php');
require_once('include/attach.php');
@@ -35,7 +37,9 @@ class File_importer {
$headers = HTTPSig::create_sig($headers,$channel['channel_prvkey'],channel_url($channel),true,'sha512');
+ // TODO: implement total count
$x = z_fetch_url($hz_server . '/api/z/1.0/file/export_page?f=records=1&page=' . $page, false, $redirects, [ 'headers' => $headers ]);
+ // logger('file fetch: ' . print_r($x,true));
if(! $x['success']) {
logger('no API response',LOGGER_DEBUG);
@@ -44,8 +48,10 @@ class File_importer {
$j = json_decode($x['body'],true);
- if(! is_array($j[0]['attach']) || ! count($j[0]['attach']))
+ if(! is_array($j[0]['attach']) || ! count($j[0]['attach'])) {
+ PConfig::Set($channel['channel_id'], 'import', 'files', 1);
return;
+ }
$r = sync_files($channel,$j);