This is a patch that I've been using on my local that get's rid of feedapi_eparser_feedapi_parse(). There are 2 main advantages:

1. feedapi_eparser_type_plugin_method_call() lets you call any plugin method with all the error checking and init() calling of feedapi_eparser_feedapi_parse()
2. The caching logic is moved into ->parse() so it can be overridden by plugins

To do this I also made _feedapi_eparser_load_type_plugin() take a plugin name instead of a feed which I think makes more sense as it differentiates it from feedapi_eparser_load_type_plugin

CommentFileSizeAuthor
#2 562766.patch6.19 KBneclimdul
#1 562766.patch0 bytesneclimdul
eparser3.patch7.3 KBandrewlevine

Comments

neclimdul’s picture

StatusFileSize
new0 bytes

I wasn't keen on this but the more I messed with things I think there's a need for at least most of this patch. How does the attached patch fit with the idea?

It does a couple things.
Moves the call to download into parse(I think it might have been there anyways at one point).
Moves the cache logic into ->parse() like your patch but wrapping ->download as well.

It doesn't add a method for calling these methods. However since you can load it and call it directly now things are pretty simple. See the call to parse in the feedapi hook.

neclimdul’s picture

StatusFileSize
new6.19 KB

real patch...

andrewlevine’s picture

Status: Needs review » Reviewed & tested by the community

I didn't have a chance to actually test this patch but the refactoring is better than both what is in feedapi_eparser now and my patch. It makes more sense to do the initialization on plugin load than on method call. If you've confirmed this working on your local, I'd say commit it and then I will test it.

neclimdul’s picture

Status: Reviewed & tested by the community » Fixed

sounds good to me. committed.

andrewlevine’s picture

tested and seems to work fine. thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.