aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Daemon/Importdoc.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Daemon/Importdoc.php')
-rw-r--r--Zotlabs/Daemon/Importdoc.php18
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);
+ }
+ }
}
}