Zend Framework

Zend_Feed_Rss::__wakeUp improvement

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.5.1
  • Fix Version/s: None
  • Component/s: Zend_Feed
  • Labels:
    None

Description

Hi,

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

// 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 <rdf> or <channel> 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.

Issue Links

Activity

Hide
julien PAULI added a comment -

(you should use the


style in the bug tracker, to make your code more readable, see http://framework.zend.com/issues/secure/WikiRendererHelpAction.jspa?section=texteffects )

Show
julien PAULI added a comment - (you should use the

style in the bug tracker, to make your code more readable, see http://framework.zend.com/issues/secure/WikiRendererHelpAction.jspa?section=texteffects )
Hide
julien PAULI added a comment -

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

Show
julien PAULI added a comment - lol, I meant the { code } block (if I write it, it wouldnt get shown, how silly I feel .... )
Hide
LF Bittencourt added a comment -

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:

// 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?

Show
LF Bittencourt added a comment - 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:
// 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?
Hide
Wil Sinclair added a comment -

Please evaluate and categorize as necessary.

Show
Wil Sinclair added a comment - Please evaluate and categorize as necessary.
Hide
Simone Carletti added a comment -

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?

Show
Simone Carletti added a comment - 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?
Hide
Simone Carletti added a comment -

Closing as duplicate of ZF-405.

Show
Simone Carletti added a comment - Closing as duplicate of ZF-405.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: