diff options
author | Mario Vavti <mario@mariovavti.com> | 2024-11-08 20:18:20 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2024-11-08 20:18:20 +0100 |
commit | 0481901b593f861366f9a766e0f020cce7a31be7 (patch) | |
tree | 9bf66881b0c0564fb6881831d1eaa06df6657e09 /Zotlabs/Daemon/Importdoc.php | |
parent | 4b4cac63fd4597b5c3090377196c8ad970900b21 (diff) | |
download | volse-hubzilla-0481901b593f861366f9a766e0f020cce7a31be7.tar.gz volse-hubzilla-0481901b593f861366f9a766e0f020cce7a31be7.tar.bz2 volse-hubzilla-0481901b593f861366f9a766e0f020cce7a31be7.zip |
refactor drop_item[s]() for containers
Diffstat (limited to 'Zotlabs/Daemon/Importdoc.php')
-rw-r--r-- | Zotlabs/Daemon/Importdoc.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Zotlabs/Daemon/Importdoc.php b/Zotlabs/Daemon/Importdoc.php index c5a81e50c..8f04e05f8 100644 --- a/Zotlabs/Daemon/Importdoc.php +++ b/Zotlabs/Daemon/Importdoc.php @@ -18,9 +18,13 @@ class Importdoc { static public function update_docs_dir($s) { $f = basename($s); $d = dirname($s); - if ($s === 'doc/html') + + if ($s === 'doc/html') { return; + } + $files = glob("$d/$f"); + if ($files) { foreach ($files as $fi) { if ($fi === 'doc/html') { @@ -37,6 +41,18 @@ class Importdoc { } } } + + // remove old files that weren't updated (indicates they were most likely deleted). + $i = q("select * from item where item_type = 5 and edited < %s - %s", + db_utcnow(), + db_quoteinterval('14 DAY', true) + ); + + if ($i) { + foreach ($i as $iv) { + drop_item($iv['id'], DROPITEM_NORMAL, true); + } + } } } |