aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Helper/ContentProxy.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2015-09-28 19:35:33 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-09-28 19:35:33 +0200
commitda3d4998c0972557952c83b610f8f45fdcd31b72 (patch)
treeca4f91e1b54c0db19e12663405cc30b9275817d9 /src/Wallabag/CoreBundle/Helper/ContentProxy.php
parent34c2cc7a1a2b8f1ac606957096274b3998005ec0 (diff)
downloadwallabag-da3d4998c0972557952c83b610f8f45fdcd31b72.tar.gz
wallabag-da3d4998c0972557952c83b610f8f45fdcd31b72.tar.zst
wallabag-da3d4998c0972557952c83b610f8f45fdcd31b72.zip
Move readingTime & domainName in ContentProxy
So, everything is centralized in one place when we save a new entry.
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper/ContentProxy.php')
-rw-r--r--src/Wallabag/CoreBundle/Helper/ContentProxy.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
index 3de8828f..7fb41393 100644
--- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php
+++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
@@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Helper;
4 4
5use Graby\Graby; 5use Graby\Graby;
6use Wallabag\CoreBundle\Entity\Entry; 6use Wallabag\CoreBundle\Entity\Entry;
7use Wallabag\CoreBundle\Tools\Utils;
7 8
8/** 9/**
9 * This kind of proxy class take care of getting the content from an url 10 * This kind of proxy class take care of getting the content from an url
@@ -51,6 +52,8 @@ class ContentProxy
51 $entry->setContent($html); 52 $entry->setContent($html);
52 $entry->setLanguage($content['language']); 53 $entry->setLanguage($content['language']);
53 $entry->setMimetype($content['content_type']); 54 $entry->setMimetype($content['content_type']);
55 $entry->setReadingTime(Utils::getReadingTime($html));
56 $entry->setDomainName(parse_url($entry->getUrl(), PHP_URL_HOST));
54 57
55 if (isset($content['open_graph']['og_image'])) { 58 if (isset($content['open_graph']['og_image'])) {
56 $entry->setPreviewPicture($content['open_graph']['og_image']); 59 $entry->setPreviewPicture($content['open_graph']['og_image']);