diff options
author | Mario Vavti <mario@mariovavti.com> | 2021-09-30 12:06:28 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2021-09-30 12:06:28 +0200 |
commit | 44fa5ac9a1afabb53b9bfff4bd2f3fb7bef2b18d (patch) | |
tree | 8b7093cb7d7fe6461611ea51c45939985d3ee671 /Zotlabs/Daemon/Channel_purge.php | |
parent | fbefff6eedd056011dfcc93ece9e2444d9452b19 (diff) | |
download | volse-hubzilla-44fa5ac9a1afabb53b9bfff4bd2f3fb7bef2b18d.tar.gz volse-hubzilla-44fa5ac9a1afabb53b9bfff4bd2f3fb7bef2b18d.tar.bz2 volse-hubzilla-44fa5ac9a1afabb53b9bfff4bd2f3fb7bef2b18d.zip |
add channel purge daemon
Diffstat (limited to 'Zotlabs/Daemon/Channel_purge.php')
-rw-r--r-- | Zotlabs/Daemon/Channel_purge.php | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Zotlabs/Daemon/Channel_purge.php b/Zotlabs/Daemon/Channel_purge.php new file mode 100644 index 000000000..416126896 --- /dev/null +++ b/Zotlabs/Daemon/Channel_purge.php @@ -0,0 +1,34 @@ +<?php + +namespace Zotlabs\Daemon; + +class Channel_purge { + + static public function run($argc,$argv) { + + cli_startup(); + + $channel_id = intval($argv[1]); + + $channel = q("select * from channel where channel_id = %d and channel_removed = 1", + intval($channel_id) + ); + + if (! $channel) { + return; + } + + do { + $r = q("select id from item where uid = %d and item_deleted = 0 limit 100", + intval($channel_id) + ); + if ($r) { + foreach ($r as $rv) { + drop_item($rv['id'],false); + } + } + } while ($r); + + return; + } +} |