aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Importfile.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/Importfile.php
parentea3390d626f85b7293a750958bfd1b5460958365 (diff)
downloadvolse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.tar.gz
volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.tar.bz2
volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.zip
get dev
Diffstat (limited to 'Zotlabs/Daemon/Importfile.php')
-rw-r--r--Zotlabs/Daemon/Importfile.php23
1 files changed, 11 insertions, 12 deletions
diff --git a/Zotlabs/Daemon/Importfile.php b/Zotlabs/Daemon/Importfile.php
index 749949679..299fb1ee5 100644
--- a/Zotlabs/Daemon/Importfile.php
+++ b/Zotlabs/Daemon/Importfile.php
@@ -6,22 +6,21 @@ use Zotlabs\Lib\Libsync;
class Importfile {
- static public function run($argc,$argv){
+ static public function run($argc, $argv) {
- logger('Importfile: ' . print_r($argv,true));
+ logger('Importfile: ' . print_r($argv, true));
- if($argc < 3)
+ if ($argc < 3)
return;
$channel = channelx_by_n($argv[1]);
- if(! $channel)
+ if (!$channel)
return;
$srcfile = $argv[2];
$folder = (($argc > 3) ? $argv[3] : '');
$dstname = (($argc > 4) ? $argv[4] : '');
-
- $hash = random_string();
+ $hash = random_string();
$arr = [
'src' => $srcfile,
@@ -35,15 +34,15 @@ class Importfile {
'replace' => true
];
- if($folder)
+ if ($folder)
$arr['folder'] = $folder;
- attach_store($channel,$channel['channel_hash'],'import',$arr);
+ attach_store($channel, $channel['channel_hash'], 'import', $arr);
+
+ $sync = attach_export_data($channel, $hash);
+ if ($sync)
+ Libsync::build_sync_packet($channel['channel_id'], ['file' => [$sync]]);
- $sync = attach_export_data($channel,$hash);
- if($sync)
- Libsync::build_sync_packet($channel['channel_id'],array('file' => array($sync)));
-
return;
}
}