diff options
author | Mario <mario@mariovavti.com> | 2024-07-06 11:05:22 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-07-06 11:05:22 +0000 |
commit | 45275910e606a02b12393714ea3b0409da440d61 (patch) | |
tree | 10b2d173d58cb930f8df28fe75af73dd4974c08c /Zotlabs/Module/Import_progress.php | |
parent | 0c1d0f7498661fb34dcca6f3c6566e757af310a7 (diff) | |
parent | c04e781926a78e514cdf211fa24930a331149072 (diff) | |
download | volse-hubzilla-master.tar.gz volse-hubzilla-master.tar.bz2 volse-hubzilla-master.zip |
Merge branch '9.2RC'master
Diffstat (limited to 'Zotlabs/Module/Import_progress.php')
-rw-r--r-- | Zotlabs/Module/Import_progress.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Zotlabs/Module/Import_progress.php b/Zotlabs/Module/Import_progress.php index 5c68f9ff1..d9b13e8a8 100644 --- a/Zotlabs/Module/Import_progress.php +++ b/Zotlabs/Module/Import_progress.php @@ -1,6 +1,7 @@ <?php namespace Zotlabs\Module; +use App; use Zotlabs\Lib\PConfig; use Zotlabs\Daemon\Master; @@ -21,6 +22,9 @@ class Import_progress extends \Zotlabs\Web\Controller { nav_set_selected('Channel Import'); + $channel = App::get_channel(); + $import_host = PConfig::Get(local_channel(), 'import', 'host'); + // items $c = PConfig::Get(local_channel(), 'import', 'content_progress'); @@ -41,6 +45,24 @@ class Import_progress extends \Zotlabs\Web\Controller { } } else { + if(argv(1) === 'resume_itemsync' && $import_host) { + $alive = probe_api_path($import_host); + if ($alive) { + $parsed = parse_url($alive); + unset($parsed['path']); + + $hz_server = unparse_url($parsed); + $since = datetime_convert(date_default_timezone_get(), date_default_timezone_get(), '0001-01-01 00:00'); + $until = datetime_convert(date_default_timezone_get(), date_default_timezone_get(), 'now + 1 day'); + $page = 0; + Master::Summon(['Content_importer', sprintf('%d', $page), $since, $until, $channel['channel_address'], urlencode($hz_server)]); + goaway('/import_progress'); + } + else { + notice(t('Import host does not seem to be online or compatible') . EOL); + } + } + $cprogress = 'waiting to start...'; if (PConfig::Get(local_channel(), 'import', 'content_completed')) { @@ -73,6 +95,23 @@ class Import_progress extends \Zotlabs\Web\Controller { } } else { + if(argv(1) === 'resume_filesync' && $import_host) { + $alive = probe_api_path($import_host); + if ($alive) { + $parsed = parse_url($alive); + unset($parsed['path']); + + $hz_server = unparse_url($parsed); + $page = 0; + + Master::Summon(['File_importer', sprintf('%d', $page), $channel['channel_address'], urlencode($hz_server)]); + goaway('/import_progress'); + } + else { + notice(t('Import host does not seem to be online or compatible') . EOL); + } + } + $fprogress = 'waiting to start...'; if (PConfig::Get(local_channel(), 'import', 'files_completed')) { |