diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2020-02-29 21:16:44 +0100 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2020-02-29 21:16:44 +0100 |
| commit | 18d36cb052c42c20edda2814545c9bdf3fb1cbc5 (patch) | |
| tree | d6ebd28dd7c575ba4e1c8b6eb4ad5a503e7884c6 /src/phinde/Fetcher.php | |
| parent | e8e4778a7550636790d7b33d96a83bbbd3ac21ae (diff) | |
| download | phinde-elastic6.tar.gz phinde-elastic6.zip | |
wipelastic6
Diffstat (limited to 'src/phinde/Fetcher.php')
| -rw-r--r-- | src/phinde/Fetcher.php | 15 |
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; |
