Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Make ServiceManager dependency optional in Feed component #4396

Conversation

weierophinney
Copy link
Member

This PR makes the ServiceManager dependency in the Feed component optional.

  • Creates Zend\Feed\Reader\ExtensionManagerInterface, defining required capabilities for an extension manager; ExtensionManager implements this interface now.
  • Creates Zend\Feed\Writer\ExtensionManagerInterface, defining required capabilities for an extension manager; ExtensionManager implements this interface now.

If desired, you can substitute your own implementations using:

Reader::setExtensionManager($customImplementation);
Writer::setExtensionManager($customImplementation);

- Created Zend\Feed\Reader\ExtensionManagerInterface and
  Zend\Feed\Writer\ExtensionManagerInterface. Default ExtensionManager
  implementations implement these while extending AbstractPluginManager.
- You can implement the interface and inject your implementation as the default
  ExtensionManager if desired.
@weierophinney
Copy link
Member Author

Ping @padraic

@weierophinney
Copy link
Member Author

@padraic There's one problem: 5.3.3: https://travis-ci.org/zendframework/zf2/jobs/6834575#L347

Basically, a change was made somewhere in the 5.3 series, perhaps as early as 5.3.4, which fixed this particular behavior, allowing a class to implement multiple interfaces with the same signatures.

I'm not sure how to proceed at this point, other than to potentially use some sort of polyfill to have a marker interface in 5.3.3 and the real interface in later versions. Thoughts?

- PHP 5.3.3 does not like it when you implement multiple interfaces that define
  the same method, even if the signatures are identical.
- Workaround is to implement a decorator.
- Make ExtensionManager a decorator
@padraic
Copy link
Member

padraic commented May 6, 2013

@weierophinney Looks good, through I don't know what to do about the 5.3.3 problem.

@weierophinney
Copy link
Member Author

@padraic Already resolved -- I used a Decorator to make it work.

weierophinney added a commit that referenced this pull request May 6, 2013
Forward port #4396

Conflicts:
	library/Zend/Feed/composer.json
weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants