Closed Synchro closed 6 years ago
Re-opening; the intention was to have these entries in place. We'll issue a bugfix release soon that ensures they are present.
Thanks, glad it wasn't just me!
Hmmm... I thought this had to do with our own StandaloneExtensionManager
, but it turns out it's different.
We do register it already (see https://github.com/zendframework/zend-feed/blob/875414e3413eab96253dcde79a94432ebf16f693/src/Reader/StandaloneExtensionManager.php#L24-L25 and https://github.com/zendframework/zend-feed/blob/875414e3413eab96253dcde79a94432ebf16f693/src/Reader/ExtensionPluginManager.php#L106-L107).
The problem is the fact that we register it as a core extension by default in Zend\Feed\Reader\Reader
(see https://github.com/zendframework/zend-feed/blob/875414e3413eab96253dcde79a94432ebf16f693/src/Reader/Reader.php#L675). This means that if you are using a custom extension manager, and have not yet added these entries, you will get an error.
I'm going to see if I can add some code that will detect the presence of the required entries before attempting to register them. My personal take is that this should likely emit an E_USER_NOTICE
that indicates the entries should be added to the extension manager.
OK. I'd really like to do without an extension manager if possible. I have one extension that adds MRSS media support, and I gather I need to have a custom extension manager that loads all the standard extensions in order to load that extra one. Is that correct?
"All I want is" a class that will return a sensible RSS structure when given a URL and not explode when it encounters something unusual; I'm finding the mix of managers, extensions, and containers very confusing, especially since I'm not using ZF otherwise.
I have one extension that adds MRSS media support, and I gather I need to have a custom extension manager that loads all the standard extensions in order to load that extra one. Is that correct?
Correct.
We provide a "standalone" extension manager that has the various defaults we allow already, and this always has all core extensions represented. It also has a mechanism by which you can add extensions once you have an instance:
use Zend\Feed\Reader\Reader;
use Zend\Feed\Reader\StandaloneExtensionManager;
$extensions = new StandaloneExtensionManager();
// Register custom feed and entry classes with the manager:
$extensions->add('MRSS\Feed', \My\Feed\MRSS\Feed::class);
$extensions->add('MRSS\Entry', \My\Feed\MRSS\Entry::class);
// Tell Reader to use the custom extension manager:
Reader::setExtensionManager($extensions);
// Register the MRSS extension with the reader (which we can
// now do as the extension manager knows about the feed and entry
// types:
Reader::registerExtension('MRSS');
You cannot currently extend the class to auto-provide your extension, as the class uses private
visibility; we can potentially open that in the future, but the add()
(and it's opposite, remove()
) function allows modification already.
I'm finding the mix of managers, extensions, and containers very confusing
What it comes down to is:
Hope the above helps you out!
I've also opened #81 to make the GooglePlayPodcast
extension registration conditional; if no entry is present for it in the extension manager, Reader
will not attempt to register the extension, but will emit an E_USER_NOTICE
indicating you should add it to your extension manager implementation.
Excellent, thanks.
2.10.2 has been released, which resolves this problem for existing users.
This is a little note for anyone running into this error. You will need to add the new GooglePlayPodcast extensions to your extension manager so that the extension can be found, like this:
I have no idea why these need to be added explicitly since it seems it won't work without them. I saw that Drupal ran into the same thing.