ZF-3128: Zend_Feed_Rss::__wakeUp improvement

Issue Type: Improvement Created: 2008-04-17T10:01:31.000+0000 Last Updated: 2008-05-13T15:11:22.000+0000 Status: Resolved Fix version(s): Reporter: LF Bittencourt (bittencourt) Assignee: Simone Carletti (weppos) Tags: - Zend_Feed

Related issues: - ZF-405




First, this is my first post... If something is wrong in my issue tracker usage, let me know. Actually, Zend_Feed can't read feed, because it uses RSS 1.0. So I improve Zend_Feed_Rss::__wakeUp method as below:

<pre class="highlight">
        // Check for RSS 1.0 feed
        if ($doc->getElementsByTagName('RDF')->item(0)) {
            $this->_element = $doc->getElementsByTagName('RDF')->item(0);
        } else {
            // Find the base channel element and create an alias to it.
            $this->_element = $doc->getElementsByTagName('channel')->item(0);

        if (!$this->_element) {
             * @see Zend_Feed_Exception
            require_once 'Zend/Feed/Exception.php';
            throw new Zend_Feed_Exception('No root  or  element found, cannot parse channel.');

The changes are in the 'RDF' item check and in the Zend_Feed_Exception message. Hope this is useful and apologize for any errors.


Posted by julien PAULI (doctorrock83) on 2008-04-17T12:18:50.000+0000

(you should use the ``` style in the bug tracker, to make your code more readable, see… )

Posted by julien PAULI (doctorrock83) on 2008-04-17T12:20:11.000+0000

lol, I meant the { code } block (if I write it, it wouldnt get shown, how silly I feel .... )

Posted by LF Bittencourt (bittencourt) on 2008-04-17T13:30:31.000+0000

I guess the better way to correct this trouble is create a new class to read RSS 1.0/RDF feeds adequately, cause the changes I made generate some wrong behaviors. See below:

<pre class="highlight">
// RSS 2.0
var_dump($rss->description()); // returns a object

// RSS 1.0
var_dump($rss->description()); // returns null

So I'm creating a class Zend_Feed_Rss-based. How new classes can be submitted to ZF?

Posted by Wil Sinclair (wil) on 2008-04-18T13:25:24.000+0000

Please evaluate and categorize as necessary.

Posted by Simone Carletti (weppos) on 2008-05-06T00:56:53.000+0000

There is much more in Zend_Feed to be changed to make the library compatible with RSS 1.0 (and RDF based) files.

Zend_Feed not only consumes feeds, but creates them as well. I exposed a list of common issues to care of in ZF-405.

To not split discussions and lost valuable suggestions, I would flag this issue as duplicate of ZF-405. What do you think?

Posted by Simone Carletti (weppos) on 2008-05-13T15:10:38.000+0000

Closing as duplicate of ZF-405.

Have you found an issue?

See the Overview section for more details.


© 2006-2020 by Zend by Perforce. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.