diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-09 11:44:09 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-09 11:44:09 +0100 |
commit | b9e330109b58fac55c3728dd3c543552fcabd353 (patch) | |
tree | 93d386ca453b4b90f517018eb63a4b64df22e8ba /vendor/fguillot/picofeed/lib/PicoFeed | |
parent | e5d18a22c3c15acf61f97da4965a551b83df05cb (diff) |
update picofeed to 0.1.0
Diffstat (limited to 'vendor/fguillot/picofeed/lib/PicoFeed')
17 files changed, 108 insertions, 69 deletions
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Client.php b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Client.php index 7328b2c75..e962ba4e8 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Client.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Client.php @@ -3,7 +3,7 @@ namespace PicoFeed\Client; use LogicException; -use PicoFeed\Logging\Logging; +use PicoFeed\Logging\Logger; /** * Client class @@ -166,9 +166,9 @@ abstract class Client $this->url = $url; } - Logging::setMessage(get_called_class().' Fetch URL: '.$this->url); - Logging::setMessage(get_called_class().' Etag provided: '.$this->etag); - Logging::setMessage(get_called_class().' Last-Modified provided: '.$this->last_modified); + Logger::setMessage(get_called_class().' Fetch URL: '.$this->url); + Logger::setMessage(get_called_class().' Etag provided: '.$this->etag); + Logger::setMessage(get_called_class().' Last-Modified provided: '.$this->last_modified); $response = $this->doRequest(); @@ -204,7 +204,7 @@ abstract class Client } if ($this->is_modified === false) { - Logging::setMessage(get_called_class().' Resource not modified'); + Logger::setMessage(get_called_class().' Resource not modified'); } } @@ -297,10 +297,10 @@ abstract class Client } } - Logging::setMessage(get_called_class().' HTTP status code: '.$status); + Logger::setMessage(get_called_class().' HTTP status code: '.$status); foreach ($headers as $name => $value) { - Logging::setMessage(get_called_class().' HTTP header: '.$name.' => '.$value); + Logger::setMessage(get_called_class().' HTTP header: '.$name.' => '.$value); } return array($status, $headers); diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Curl.php b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Curl.php index 9cf3eb6f4..4e4658639 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Curl.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Curl.php @@ -2,7 +2,7 @@ namespace PicoFeed\Client; -use PicoFeed\Logging\Logging; +use PicoFeed\Logging\Logger; /** * cURL HTTP client @@ -129,18 +129,18 @@ class Curl extends Client { if ($this->proxy_hostname) { - Logging::setMessage(get_called_class().' Proxy: '.$this->proxy_hostname.':'.$this->proxy_port); + Logger::setMessage(get_called_class().' Proxy: '.$this->proxy_hostname.':'.$this->proxy_port); curl_setopt($ch, CURLOPT_PROXYPORT, $this->proxy_port); curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP'); curl_setopt($ch, CURLOPT_PROXY, $this->proxy_hostname); if ($this->proxy_username) { - Logging::setMessage(get_called_class().' Proxy credentials: Yes'); + Logger::setMessage(get_called_class().' Proxy credentials: Yes'); curl_setopt($ch, CURLOPT_PROXYUSERPWD, $this->proxy_username.':'.$this->proxy_password); } else { - Logging::setMessage(get_called_class().' Proxy credentials: No'); + Logger::setMessage(get_called_class().' Proxy credentials: No'); } } @@ -185,16 +185,16 @@ class Curl extends Client $ch = $this->prepareContext(); curl_exec($ch); - Logging::setMessage(get_called_class().' cURL total time: '.curl_getinfo($ch, CURLINFO_TOTAL_TIME)); - Logging::setMessage(get_called_class().' cURL dns lookup time: '.curl_getinfo($ch, CURLINFO_NAMELOOKUP_TIME)); - Logging::setMessage(get_called_class().' cURL connect time: '.curl_getinfo($ch, CURLINFO_CONNECT_TIME)); - Logging::setMessage(get_called_class().' cURL speed download: '.curl_getinfo($ch, CURLINFO_SPEED_DOWNLOAD)); - Logging::setMessage(get_called_class().' cURL effective url: '.curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)); + Logger::setMessage(get_called_class().' cURL total time: '.curl_getinfo($ch, CURLINFO_TOTAL_TIME)); + Logger::setMessage(get_called_class().' cURL dns lookup time: '.curl_getinfo($ch, CURLINFO_NAMELOOKUP_TIME)); + Logger::setMessage(get_called_class().' cURL connect time: '.curl_getinfo($ch, CURLINFO_CONNECT_TIME)); + Logger::setMessage(get_called_class().' cURL speed download: '.curl_getinfo($ch, CURLINFO_SPEED_DOWNLOAD)); + Logger::setMessage(get_called_class().' cURL effective url: '.curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)); $curl_errno = curl_errno($ch); if ($curl_errno) { - Logging::setMessage(get_called_class().' cURL error: '.curl_error($ch)); + Logger::setMessage(get_called_class().' cURL error: '.curl_error($ch)); curl_close($ch); $this->handleError($curl_errno); @@ -246,11 +246,12 @@ class Curl extends Client * * @access private * @param string $location Redirected URL - * @return boolean|array + * @return array */ private function handleRedirection($location) { $nb_redirects = 0; + $result = array(); $this->url = $location; $this->body = ''; $this->body_length = 0; @@ -262,7 +263,7 @@ class Curl extends Client $nb_redirects++; if ($nb_redirects >= $this->max_redirects) { - return false; + throw new MaxRedirectException('Maximum number of redirections reached'); } $result = $this->doRequest(false); @@ -275,11 +276,11 @@ class Curl extends Client $this->headers_counter = 0; } else { - return $result; + break; } } - return false; + return $result; } /** diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Favicon.php b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Favicon.php index b6d3b6d26..5b63cf044 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Favicon.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Favicon.php @@ -5,7 +5,7 @@ namespace PicoFeed\Client; use DOMXpath; use PicoFeed\Config\Config; -use PicoFeed\Logging\Logging; +use PicoFeed\Logging\Logger; use PicoFeed\Parser\XmlParser; /** @@ -67,7 +67,7 @@ class Favicon { try { - Logging::setMessage(get_called_class().' Download => '.$url); + Logger::setMessage(get_called_class().' Download => '.$url); $client = Client::getInstance(); $client->setConfig($this->config); diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Grabber.php b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Grabber.php index a072fc805..57661cb7b 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Grabber.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Grabber.php @@ -5,7 +5,7 @@ namespace PicoFeed\Client; use DOMXPath; use PicoFeed\Encoding\Encoding; -use PicoFeed\Logging\Logging; +use PicoFeed\Logging\Logger; use PicoFeed\Filter\Filter; use PicoFeed\Parser\XmlParser; @@ -147,7 +147,7 @@ class Grabber * Set config object * * @access public - * @param \PicoFeed\Config $config Config instance + * @param \PicoFeed\Config\Config $config Config instance * @return \PicoFeed\Grabber */ public function setConfig($config) @@ -188,30 +188,30 @@ class Grabber { if ($this->html) { - Logging::setMessage(get_called_class().' Fix encoding'); - Logging::setMessage(get_called_class().': HTTP Encoding "'.$this->encoding.'"'); + Logger::setMessage(get_called_class().' Fix encoding'); + Logger::setMessage(get_called_class().': HTTP Encoding "'.$this->encoding.'"'); $this->html = Filter::stripHeadTags($this->html); $this->html = Encoding::convert($this->html, $this->encoding); - Logging::setMessage(get_called_class().' Content length: '.strlen($this->html).' bytes'); + Logger::setMessage(get_called_class().' Content length: '.strlen($this->html).' bytes'); $rules = $this->getRules(); if (is_array($rules)) { - Logging::setMessage(get_called_class().' Parse content with rules'); + Logger::setMessage(get_called_class().' Parse content with rules'); $this->parseContentWithRules($rules); } else { - Logging::setMessage(get_called_class().' Parse content with candidates'); + Logger::setMessage(get_called_class().' Parse content with candidates'); $this->parseContentWithCandidates(); } } else { - Logging::setMessage(get_called_class().' No content fetched'); + Logger::setMessage(get_called_class().' No content fetched'); } - Logging::setMessage(get_called_class().' Content length: '.strlen($this->content).' bytes'); - Logging::setMessage(get_called_class().' Grabber done'); + Logger::setMessage(get_called_class().' Content length: '.strlen($this->content).' bytes'); + Logger::setMessage(get_called_class().' Grabber done'); return $this->content !== ''; } @@ -260,14 +260,12 @@ class Grabber $files[] = substr($hostname, 0, $pos); } - // Logging::setMessage(var_export($files, true)); - foreach ($files as $file) { $filename = __DIR__.'/../Rules/'.$file.'.php'; if (file_exists($filename)) { - Logging::setMessage(get_called_class().' Load rule: '.$file); + Logger::setMessage(get_called_class().' Load rule: '.$file); return include $filename; } } @@ -283,7 +281,7 @@ class Grabber */ public function parseContentWithRules(array $rules) { - // Logging::setMessage($this->html); + // Logger::setMessage($this->html); $dom = XmlParser::getHtmlDocument('<?xml version="1.0" encoding="UTF-8">'.$this->html); $xpath = new DOMXPath($dom); @@ -329,13 +327,13 @@ class Grabber // Try to lookup in each tag foreach ($this->candidatesAttributes as $candidate) { - Logging::setMessage(get_called_class().' Try this candidate: "'.$candidate.'"'); + Logger::setMessage(get_called_class().' Try this candidate: "'.$candidate.'"'); $nodes = $xpath->query('//*[(contains(@class, "'.$candidate.'") or @id="'.$candidate.'") and not (contains(@class, "nav") or contains(@class, "page"))]'); if ($nodes !== false && $nodes->length > 0) { $this->content = $dom->saveXML($nodes->item(0)); - Logging::setMessage(get_called_class().' Find candidate "'.$candidate.'" ('.strlen($this->content).' bytes)'); + Logger::setMessage(get_called_class().' Find candidate "'.$candidate.'" ('.strlen($this->content).' bytes)'); break; } } @@ -347,16 +345,16 @@ class Grabber if ($nodes !== false && $nodes->length > 0) { $this->content = $dom->saveXML($nodes->item(0)); - Logging::setMessage(get_called_class().' Find <article/> tag ('.strlen($this->content).' bytes)'); + Logger::setMessage(get_called_class().' Find <article/> tag ('.strlen($this->content).' bytes)'); } } if (strlen($this->content) < 50) { - Logging::setMessage(get_called_class().' No enought content fetched, get the full body'); + Logger::setMessage(get_called_class().' No enought content fetched, get the full body'); $this->content = $dom->saveXML($dom->firstChild); } - Logging::setMessage(get_called_class().' Strip garbage'); + Logger::setMessage(get_called_class().' Strip garbage'); $this->stripGarbage(); } @@ -378,7 +376,7 @@ class Grabber $nodes = $xpath->query('//'.$tag); if ($nodes !== false && $nodes->length > 0) { - Logging::setMessage(get_called_class().' Strip tag: "'.$tag.'"'); + Logger::setMessage(get_called_class().' Strip tag: "'.$tag.'"'); foreach ($nodes as $node) { $node->parentNode->removeChild($node); } @@ -390,7 +388,7 @@ class Grabber $nodes = $xpath->query('//*[contains(@class, "'.$attribute.'") or contains(@id, "'.$attribute.'")]'); if ($nodes !== false && $nodes->length > 0) { - Logging::setMessage(get_called_class().' Strip attribute: "'.$attribute.'"'); + Logger::setMessage(get_called_class().' Strip attribute: "'.$attribute.'"'); foreach ($nodes as $node) { $node->parentNode->removeChild($node); } diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Stream.php b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Stream.php index bc9809c4d..a0058f9b0 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Client/Stream.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Client/Stream.php @@ -2,7 +2,7 @@ namespace PicoFeed\Client; -use PicoFeed\Logging\Logging; +use PicoFeed\Logging\Logger; /** * Stream context HTTP client @@ -63,16 +63,16 @@ class Stream extends Client if ($this->proxy_hostname) { - Logging::setMessage(get_called_class().' Proxy: '.$this->proxy_hostname.':'.$this->proxy_port); + Logger::setMessage(get_called_class().' Proxy: '.$this->proxy_hostname.':'.$this->proxy_port); $context['http']['proxy'] = 'tcp://'.$this->proxy_hostname.':'.$this->proxy_port; $context['http']['request_fulluri'] = true; if ($this->proxy_username) { - Logging::setMessage(get_called_class().' Proxy credentials: Yes'); + Logger::setMessage(get_called_class().' Proxy credentials: Yes'); } else { - Logging::setMessage(get_called_class().' Proxy credentials: No'); + Logger::setMessage(get_called_class().' Proxy credentials: No'); } } diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Html.php b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Html.php index f09a10e3a..d14d80907 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Html.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Filter/Html.php @@ -132,6 +132,11 @@ class Html return $this->output; } + /** + * Called after XML parsing + * + * @access public + */ public function postFilter() { $this->output = $this->tag->removeEmptyTags($this->output); diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Logging/Logging.php b/vendor/fguillot/picofeed/lib/PicoFeed/Logging/Logger.php index bc465ce7d..4afe50060 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Logging/Logging.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Logging/Logger.php @@ -11,7 +11,7 @@ use DateTimeZone; * @author Frederic Guillot * @package Logging */ -class Logging +class Logger { /** * List of messages diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php index feaf0e376..5c7068760 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php @@ -3,7 +3,6 @@ namespace PicoFeed\Parser; use SimpleXMLElement; -use PicoFeed\Logging\Logging; use PicoFeed\Filter\Filter; use PicoFeed\Client\Url; diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php index 6954c2ffc..80e09e016 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php @@ -8,7 +8,7 @@ use DateTimeZone; use PicoFeed\Encoding\Encoding; use PicoFeed\Filter\Filter; -use PicoFeed\Logging\Logging; +use PicoFeed\Logging\Logger; use PicoFeed\Client\Url; use PicoFeed\Client\Grabber; @@ -109,7 +109,7 @@ abstract class Parser $this->content = Filter::stripXmlTag($content); // Encode everything in UTF-8 - Logging::setMessage(get_called_class().': HTTP Encoding "'.$http_encoding.'" ; XML Encoding "'.$xml_encoding.'"'); + Logger::setMessage(get_called_class().': HTTP Encoding "'.$http_encoding.'" ; XML Encoding "'.$xml_encoding.'"'); $this->content = Encoding::convert($this->content, $xml_encoding ?: $http_encoding); // Workarounds @@ -124,13 +124,13 @@ abstract class Parser */ public function execute() { - Logging::setMessage(get_called_class().': begin parsing'); + Logger::setMessage(get_called_class().': begin parsing'); $xml = XmlParser::getSimpleXml($this->content); if ($xml === false) { - Logging::setMessage(get_called_class().': XML parsing error'); - Logging::setMessage(XmlParser::getErrors()); + Logger::setMessage(get_called_class().': XML parsing error'); + Logger::setMessage(XmlParser::getErrors()); throw new MalformedXmlException('XML parsing error'); } @@ -172,7 +172,7 @@ abstract class Parser $feed->items[] = $item; } - Logging::setMessage(get_called_class().PHP_EOL.$feed); + Logger::setMessage(get_called_class().PHP_EOL.$feed); return $feed; } @@ -243,7 +243,7 @@ abstract class Parser $item->content = $filter->execute(); } else { - Logging::setMessage(get_called_class().': Content filtering disabled'); + Logger::setMessage(get_called_class().': Content filtering disabled'); } } diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Rss20.php b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Rss20.php index 231864bfc..80e65fab8 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Rss20.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Rss20.php @@ -3,7 +3,6 @@ namespace PicoFeed\Parser; use SimpleXMLElement; -use PicoFeed\Logging\Logging; use PicoFeed\Filter\Filter; use PicoFeed\Client\Url; diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Reader/Reader.php b/vendor/fguillot/picofeed/lib/PicoFeed/Reader/Reader.php index ef6df4c32..f54062f40 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Reader/Reader.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Reader/Reader.php @@ -7,7 +7,7 @@ use DOMXPath; use PicoFeed\Config\Config; use PicoFeed\Client\Client; use PicoFeed\Client\Url; -use PicoFeed\Logging\Logging; +use PicoFeed\Logging\Logger; use PicoFeed\Filter\Filter; use PicoFeed\Parser\XmlParser; @@ -50,7 +50,7 @@ class Reader public function __construct(Config $config = null) { $this->config = $config ?: new Config; - Logging::setTimezone($this->config->getTimezone()); + Logger::setTimezone($this->config->getTimezone()); } /** @@ -111,7 +111,7 @@ class Reader */ public function find($url, $html) { - Logging::setMessage(get_called_class().': Try to discover subscriptions'); + Logger::setMessage(get_called_class().': Try to discover subscriptions'); $dom = XmlParser::getHtmlDocument($html); $xpath = new DOMXPath($dom); @@ -140,7 +140,7 @@ class Reader } } - Logging::setMessage(get_called_class().': '.implode(', ', $links)); + Logger::setMessage(get_called_class().': '.implode(', ', $links)); return $links; } @@ -183,7 +183,7 @@ class Reader { $first_tag = Filter::getFirstTag($content); - Logging::setMessage(get_called_class().': DetectFormat(): '.$first_tag); + Logger::setMessage(get_called_class().': DetectFormat(): '.$first_tag); foreach ($this->formats as $parser => $needles) { diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/degroupnews.com.php b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/degroupnews.com.php new file mode 100644 index 000000000..e5f17de4f --- /dev/null +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/degroupnews.com.php @@ -0,0 +1,10 @@ +<?php +return array( + 'test_url' => 'http://www.degroupnews.com/medias/vodsvod/amazon-concurrence-la-chromecast-de-google-avec-fire-tv-stick', + 'body' => array( + '//div[@class="contenu"]', + ), + 'strip' => array( + '//div[contains(@class, "a2a")]' + ), +);
\ No newline at end of file diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/sitepoint.com.php b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/sitepoint.com.php new file mode 100644 index 000000000..8f3f58828 --- /dev/null +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/sitepoint.com.php @@ -0,0 +1,9 @@ +<?php +return array( + 'test_url' => 'http://www.sitepoint.com/creating-hello-world-app-swift/', + 'body' => array( + '//section[@class="article_body"]', + ), + 'strip' => array( + ), +);
\ No newline at end of file diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Rules/undeadly.org.php b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/undeadly.org.php new file mode 100644 index 000000000..1a7430448 --- /dev/null +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Rules/undeadly.org.php @@ -0,0 +1,11 @@ +<?php +return array( + 'test_url' => 'http://undeadly.org/cgi?action=article&sid=20141101181155', + 'body' => array( + '/html/body/table[3]/tbody/tr/td[1]/table[2]/tr/td[1]' + ), + 'strip' => array( + '//style', + '//font', + ), +);
\ No newline at end of file diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Serialization/Import.php b/vendor/fguillot/picofeed/lib/PicoFeed/Serialization/Import.php index 8de2d8511..2f8e4006d 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Serialization/Import.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Serialization/Import.php @@ -5,7 +5,7 @@ namespace PicoFeed\Serialization; use SimpleXmlElement; use StdClass; -use PicoFeed\Logging\Logging; +use PicoFeed\Logging\Logger; use PicoFeed\Parser\XmlParser; /** @@ -51,17 +51,17 @@ class Import */ public function execute() { - Logging::setMessage(get_called_class().': start importation'); + Logger::setMessage(get_called_class().': start importation'); $xml = XmlParser::getSimpleXml(trim($this->content)); if ($xml === false || $xml->getName() !== 'opml' || ! isset($xml->body)) { - Logging::setMessage(get_called_class().': OPML tag not found or malformed XML document'); + Logger::setMessage(get_called_class().': OPML tag not found or malformed XML document'); return false; } $this->parseEntries($xml->body); - Logging::setMessage(get_called_class().': '.count($this->items).' subscriptions found'); + Logger::setMessage(get_called_class().': '.count($this->items).' subscriptions found'); return $this->items; } diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Syndication/Rss20.php b/vendor/fguillot/picofeed/lib/PicoFeed/Syndication/Rss20.php index efb2dd489..69d6a2114 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Syndication/Rss20.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Syndication/Rss20.php @@ -70,7 +70,7 @@ class Rss20 extends Writer // <description/> $description = $this->dom->createElement('description'); - $description->appendChild($this->dom->createTextNode(isset($this->description) ? $this->description : $this->title)); + $description->appendChild($this->dom->createTextNode($this->description ?: $this->title)); $channel->appendChild($description); // <pubDate/> diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Syndication/Writer.php b/vendor/fguillot/picofeed/lib/PicoFeed/Syndication/Writer.php index 3b4557dad..cbd35f2cf 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Syndication/Writer.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Syndication/Writer.php @@ -9,7 +9,6 @@ use RuntimeException; * * @author Frederic Guillot * @package Syndication - * @property string $description Feed description */ abstract class Writer { @@ -62,6 +61,14 @@ abstract class Writer public $title = ''; /** + * Feed description + * + * @access public + * @var string + */ + public $description = ''; + + /** * Feed modification date (timestamp) * * @access public |