Chris@0: Extension\Atom\Renderer\Feed::class, Chris@0: 'atomRendererFeed' => Extension\Atom\Renderer\Feed::class, Chris@0: 'AtomRendererFeed' => Extension\Atom\Renderer\Feed::class, Chris@12: 'AtomRenderer\Feed' => Extension\Atom\Renderer\Feed::class, Chris@12: 'Atom\Renderer\Feed' => Extension\Atom\Renderer\Feed::class, Chris@0: 'contentrendererentry' => Extension\Content\Renderer\Entry::class, Chris@0: 'contentRendererEntry' => Extension\Content\Renderer\Entry::class, Chris@0: 'ContentRendererEntry' => Extension\Content\Renderer\Entry::class, Chris@12: 'ContentRenderer\Entry' => Extension\Content\Renderer\Entry::class, Chris@12: 'Content\Renderer\Entry' => Extension\Content\Renderer\Entry::class, Chris@0: 'dublincorerendererentry' => Extension\DublinCore\Renderer\Entry::class, Chris@0: 'dublinCoreRendererEntry' => Extension\DublinCore\Renderer\Entry::class, Chris@0: 'DublinCoreRendererEntry' => Extension\DublinCore\Renderer\Entry::class, Chris@12: 'DublinCoreRenderer\Entry' => Extension\DublinCore\Renderer\Entry::class, Chris@12: 'DublinCore\Renderer\Entry' => Extension\DublinCore\Renderer\Entry::class, Chris@0: 'dublincorerendererfeed' => Extension\DublinCore\Renderer\Feed::class, Chris@0: 'dublinCoreRendererFeed' => Extension\DublinCore\Renderer\Feed::class, Chris@0: 'DublinCoreRendererFeed' => Extension\DublinCore\Renderer\Feed::class, Chris@12: 'DublinCoreRenderer\Feed' => Extension\DublinCore\Renderer\Feed::class, Chris@12: 'DublinCore\Renderer\Feed' => Extension\DublinCore\Renderer\Feed::class, Chris@16: 'googleplaypodcastentry' => Extension\GooglePlayPodcast\Entry::class, Chris@16: 'googleplaypodcastEntry' => Extension\GooglePlayPodcast\Entry::class, Chris@16: 'googlePlayPodcastEntry' => Extension\GooglePlayPodcast\Entry::class, Chris@16: 'GooglePlayPodcastEntry' => Extension\GooglePlayPodcast\Entry::class, Chris@16: 'Googleplaypodcast\Entry' => Extension\GooglePlayPodcast\Entry::class, Chris@16: 'GooglePlayPodcast\Entry' => Extension\GooglePlayPodcast\Entry::class, Chris@16: 'googleplaypodcastfeed' => Extension\GooglePlayPodcast\Feed::class, Chris@16: 'googleplaypodcastFeed' => Extension\GooglePlayPodcast\Feed::class, Chris@16: 'googlePlayPodcastFeed' => Extension\GooglePlayPodcast\Feed::class, Chris@16: 'GooglePlayPodcastFeed' => Extension\GooglePlayPodcast\Feed::class, Chris@16: 'Googleplaypodcast\Feed' => Extension\GooglePlayPodcast\Feed::class, Chris@16: 'GooglePlayPodcast\Feed' => Extension\GooglePlayPodcast\Feed::class, Chris@16: 'googleplaypodcastrendererentry' => Extension\GooglePlayPodcast\Renderer\Entry::class, Chris@16: 'googleplaypodcastRendererEntry' => Extension\GooglePlayPodcast\Renderer\Entry::class, Chris@16: 'googlePlayPodcastRendererEntry' => Extension\GooglePlayPodcast\Renderer\Entry::class, Chris@16: 'GooglePlayPodcastRendererEntry' => Extension\GooglePlayPodcast\Renderer\Entry::class, Chris@16: 'GoogleplaypodcastRenderer\Entry' => Extension\GooglePlayPodcast\Renderer\Entry::class, Chris@16: 'GooglePlayPodcast\Renderer\Entry' => Extension\GooglePlayPodcast\Renderer\Entry::class, Chris@16: 'googleplaypodcastrendererfeed' => Extension\GooglePlayPodcast\Renderer\Feed::class, Chris@16: 'googleplaypodcastRendererFeed' => Extension\GooglePlayPodcast\Renderer\Feed::class, Chris@16: 'googlePlayPodcastRendererFeed' => Extension\GooglePlayPodcast\Renderer\Feed::class, Chris@16: 'GooglePlayPodcastRendererFeed' => Extension\GooglePlayPodcast\Renderer\Feed::class, Chris@16: 'GoogleplaypodcastRenderer\Feed' => Extension\GooglePlayPodcast\Renderer\Feed::class, Chris@16: 'GooglePlayPodcast\Renderer\Feed' => Extension\GooglePlayPodcast\Renderer\Feed::class, Chris@0: 'itunesentry' => Extension\ITunes\Entry::class, Chris@0: 'itunesEntry' => Extension\ITunes\Entry::class, Chris@0: 'iTunesEntry' => Extension\ITunes\Entry::class, Chris@0: 'ItunesEntry' => Extension\ITunes\Entry::class, Chris@12: 'Itunes\Entry' => Extension\ITunes\Entry::class, Chris@12: 'ITunes\Entry' => Extension\ITunes\Entry::class, Chris@0: 'itunesfeed' => Extension\ITunes\Feed::class, Chris@0: 'itunesFeed' => Extension\ITunes\Feed::class, Chris@0: 'iTunesFeed' => Extension\ITunes\Feed::class, Chris@0: 'ItunesFeed' => Extension\ITunes\Feed::class, Chris@12: 'Itunes\Feed' => Extension\ITunes\Feed::class, Chris@12: 'ITunes\Feed' => Extension\ITunes\Feed::class, Chris@0: 'itunesrendererentry' => Extension\ITunes\Renderer\Entry::class, Chris@0: 'itunesRendererEntry' => Extension\ITunes\Renderer\Entry::class, Chris@0: 'iTunesRendererEntry' => Extension\ITunes\Renderer\Entry::class, Chris@0: 'ItunesRendererEntry' => Extension\ITunes\Renderer\Entry::class, Chris@12: 'ItunesRenderer\Entry' => Extension\ITunes\Renderer\Entry::class, Chris@12: 'ITunes\Renderer\Entry' => Extension\ITunes\Renderer\Entry::class, Chris@0: 'itunesrendererfeed' => Extension\ITunes\Renderer\Feed::class, Chris@0: 'itunesRendererFeed' => Extension\ITunes\Renderer\Feed::class, Chris@0: 'iTunesRendererFeed' => Extension\ITunes\Renderer\Feed::class, Chris@0: 'ItunesRendererFeed' => Extension\ITunes\Renderer\Feed::class, Chris@12: 'ItunesRenderer\Feed' => Extension\ITunes\Renderer\Feed::class, Chris@12: 'ITunes\Renderer\Feed' => Extension\ITunes\Renderer\Feed::class, Chris@0: 'slashrendererentry' => Extension\Slash\Renderer\Entry::class, Chris@0: 'slashRendererEntry' => Extension\Slash\Renderer\Entry::class, Chris@0: 'SlashRendererEntry' => Extension\Slash\Renderer\Entry::class, Chris@12: 'SlashRenderer\Entry' => Extension\Slash\Renderer\Entry::class, Chris@12: 'Slash\Renderer\Entry' => Extension\Slash\Renderer\Entry::class, Chris@0: 'threadingrendererentry' => Extension\Threading\Renderer\Entry::class, Chris@0: 'threadingRendererEntry' => Extension\Threading\Renderer\Entry::class, Chris@0: 'ThreadingRendererEntry' => Extension\Threading\Renderer\Entry::class, Chris@12: 'ThreadingRenderer\Entry' => Extension\Threading\Renderer\Entry::class, Chris@12: 'Threading\Renderer\Entry' => Extension\Threading\Renderer\Entry::class, Chris@0: 'wellformedwebrendererentry' => Extension\WellFormedWeb\Renderer\Entry::class, Chris@0: 'wellFormedWebRendererEntry' => Extension\WellFormedWeb\Renderer\Entry::class, Chris@0: 'WellFormedWebRendererEntry' => Extension\WellFormedWeb\Renderer\Entry::class, Chris@12: 'WellFormedWebRenderer\Entry' => Extension\WellFormedWeb\Renderer\Entry::class, Chris@12: 'WellFormedWeb\Renderer\Entry' => Extension\WellFormedWeb\Renderer\Entry::class, Chris@0: ]; Chris@0: Chris@0: /** Chris@0: * Factories for default set of extension classes Chris@0: * Chris@0: * @var array Chris@0: */ Chris@0: protected $factories = [ Chris@0: Extension\Atom\Renderer\Feed::class => InvokableFactory::class, Chris@0: Extension\Content\Renderer\Entry::class => InvokableFactory::class, Chris@0: Extension\DublinCore\Renderer\Entry::class => InvokableFactory::class, Chris@0: Extension\DublinCore\Renderer\Feed::class => InvokableFactory::class, Chris@16: Extension\GooglePlayPodcast\Entry::class => InvokableFactory::class, Chris@16: Extension\GooglePlayPodcast\Feed::class => InvokableFactory::class, Chris@16: Extension\GooglePlayPodcast\Renderer\Entry::class => InvokableFactory::class, Chris@16: Extension\GooglePlayPodcast\Renderer\Feed::class => InvokableFactory::class, Chris@0: Extension\ITunes\Entry::class => InvokableFactory::class, Chris@0: Extension\ITunes\Feed::class => InvokableFactory::class, Chris@0: Extension\ITunes\Renderer\Entry::class => InvokableFactory::class, Chris@0: Extension\ITunes\Renderer\Feed::class => InvokableFactory::class, Chris@0: Extension\Slash\Renderer\Entry::class => InvokableFactory::class, Chris@0: Extension\Threading\Renderer\Entry::class => InvokableFactory::class, Chris@0: Extension\WellFormedWeb\Renderer\Entry::class => InvokableFactory::class, Chris@0: // Legacy (v2) due to alias resolution; canonical form of resolved Chris@0: // alias is used to look up the factory, while the non-normalized Chris@0: // resolved alias is used as the requested name passed to the factory. Chris@0: 'zendfeedwriterextensionatomrendererfeed' => InvokableFactory::class, Chris@0: 'zendfeedwriterextensioncontentrendererentry' => InvokableFactory::class, Chris@0: 'zendfeedwriterextensiondublincorerendererentry' => InvokableFactory::class, Chris@0: 'zendfeedwriterextensiondublincorerendererfeed' => InvokableFactory::class, Chris@16: 'zendfeedwriterextensiongoogleplaypodcastentry' => InvokableFactory::class, Chris@16: 'zendfeedwriterextensiongoogleplaypodcastfeed' => InvokableFactory::class, Chris@16: 'zendfeedwriterextensiongoogleplaypodcastrendererentry' => InvokableFactory::class, Chris@16: 'zendfeedwriterextensiongoogleplaypodcastrendererfeed' => InvokableFactory::class, Chris@16: Chris@0: 'zendfeedwriterextensionitunesentry' => InvokableFactory::class, Chris@0: 'zendfeedwriterextensionitunesfeed' => InvokableFactory::class, Chris@0: 'zendfeedwriterextensionitunesrendererentry' => InvokableFactory::class, Chris@0: 'zendfeedwriterextensionitunesrendererfeed' => InvokableFactory::class, Chris@0: 'zendfeedwriterextensionslashrendererentry' => InvokableFactory::class, Chris@0: 'zendfeedwriterextensionthreadingrendererentry' => InvokableFactory::class, Chris@0: 'zendfeedwriterextensionwellformedwebrendererentry' => InvokableFactory::class, Chris@0: ]; Chris@0: Chris@0: /** Chris@0: * Do not share instances (v2) Chris@0: * Chris@0: * @var bool Chris@0: */ Chris@0: protected $shareByDefault = false; Chris@0: Chris@0: /** Chris@0: * Do not share instances (v3) Chris@0: * Chris@0: * @var bool Chris@0: */ Chris@0: protected $sharedByDefault = false; Chris@0: Chris@0: /** Chris@0: * Validate the plugin (v3) Chris@0: * Chris@0: * Checks that the extension loaded is of a valid type. Chris@0: * Chris@0: * @param mixed $plugin Chris@0: * @return void Chris@0: * @throws InvalidServiceException if invalid Chris@0: */ Chris@0: public function validate($plugin) Chris@0: { Chris@0: if ($plugin instanceof Extension\AbstractRenderer) { Chris@0: // we're okay Chris@0: return; Chris@0: } Chris@0: Chris@0: if ('Feed' == substr(get_class($plugin), -4)) { Chris@0: // we're okay Chris@0: return; Chris@0: } Chris@0: Chris@0: if ('Entry' == substr(get_class($plugin), -5)) { Chris@0: // we're okay Chris@0: return; Chris@0: } Chris@0: Chris@0: throw new InvalidServiceException(sprintf( Chris@0: 'Plugin of type %s is invalid; must implement %s\Extension\RendererInterface ' Chris@0: . 'or the classname must end in "Feed" or "Entry"', Chris@0: (is_object($plugin) ? get_class($plugin) : gettype($plugin)), Chris@0: __NAMESPACE__ Chris@0: )); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Validate plugin (v2) Chris@0: * Chris@0: * @param mixed $plugin Chris@0: * @return void Chris@0: * @throws Exception\InvalidArgumentException when invalid Chris@0: */ Chris@0: public function validatePlugin($plugin) Chris@0: { Chris@0: try { Chris@0: $this->validate($plugin); Chris@0: } catch (InvalidServiceException $e) { Chris@0: throw new Exception\InvalidArgumentException(sprintf( Chris@0: 'Plugin of type %s is invalid; must implement %s\Extension\RendererInterface ' Chris@0: . 'or the classname must end in "Feed" or "Entry"', Chris@0: (is_object($plugin) ? get_class($plugin) : gettype($plugin)), Chris@0: __NAMESPACE__ Chris@0: )); Chris@0: } Chris@0: } Chris@0: }