aboutsummaryrefslogtreecommitdiff
path: root/src/phinde/Fetcher.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2020-02-29 21:16:44 +0100
committerChristian Weiske <cweiske@cweiske.de>2020-02-29 21:16:44 +0100
commit18d36cb052c42c20edda2814545c9bdf3fb1cbc5 (patch)
treed6ebd28dd7c575ba4e1c8b6eb4ad5a503e7884c6 /src/phinde/Fetcher.php
parente8e4778a7550636790d7b33d96a83bbbd3ac21ae (diff)
downloadphinde-elastic6.tar.gz
phinde-elastic6.zip
Diffstat (limited to 'src/phinde/Fetcher.php')
-rw-r--r--src/phinde/Fetcher.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/phinde/Fetcher.php b/src/phinde/Fetcher.php
index dccb118..63f5a43 100644
--- a/src/phinde/Fetcher.php
+++ b/src/phinde/Fetcher.php
@@ -60,6 +60,21 @@ class Fetcher
}
//FIXME: etag, hash on content
+ if ($esDoc === null) {
+ //not known yet
+ $esDoc = Helper::baseDoc($url);
+ }
+
+ $lm = $res->getHeader('last-modified');
+ if ($lm !== null) {
+ $esDoc->status->modate = gmdate('c', strtotime($lm));
+ } else {
+ $esDoc->status->modate = gmdate('c');
+ }
+ if ($esDoc->status->crdate == '') {
+ $esDoc->status->crdate = $esDoc->status->modate;
+ }
+
$retrieved = new Retrieved();
$retrieved->httpRes = $res;
$retrieved->esDoc = $esDoc;