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

Move zend-servicemanager to 'require' in composer.json. #9

Closed
wants to merge 1 commit into from

Conversation

danmichaelo
Copy link

Fixes fatal error "Class 'Zend\ServiceManager\AbstractPluginManager'
not found" when used as a stand-alone component.

Same issue as zendframework/zend-barcode#5

Fixes fatal error "Class 'Zend\ServiceManager\AbstractPluginManager'
not found"  when used as a stand-alone component.
@Ocramius
Copy link
Member

Ocramius commented Nov 2, 2015

@padraic what about this? IIRC, the dependency was made optional on request, but indeed denies using any of the factory code :-\

@weierophinney
Copy link
Member

I made the original change, and the OP is wrong, at least with regards to the Reader subcomponent:

StandaloneExtensionManager is just that: standalone. It depends on no external dependencies, and is the default implementation.

@danmichaelo — can you please indicate the use case you have that raises the error? If we can reproduce it, I'll fix it to work standalone, instead of adding another dependency.

@danmichaelo
Copy link
Author

Sure, thanks for looking into this! I'm using the Writer:

$ composer require zendframework/zend-feed
$ php -r 'require("vendor/autoload.php"); $feed = new Zend\Feed\Writer\Feed();'
PHP Fatal error:  Class 'Zend\ServiceManager\AbstractPluginManager' not found in /Users/danmichael/tmp/minimal/vendor/zendframework/zend-feed/src/Writer/ExtensionPluginManager.php on line 20
PHP Stack trace:
PHP   1. {main}() Command line code:0
PHP   2. Zend\Feed\Writer\AbstractFeed->__construct() Command line code:1
PHP   3. Zend\Feed\Writer\Writer::registerCoreExtensions() /Users/danmichael/tmp/minimal/vendor/zendframework/zend-feed/src/Writer/AbstractFeed.php:45
PHP   4. Zend\Feed\Writer\Writer::registerExtension() /Users/danmichael/tmp/minimal/vendor/zendframework/zend-feed/src/Writer/Writer.php:185
PHP   5. Zend\Feed\Writer\Writer::getExtensionManager() /Users/danmichael/tmp/minimal/vendor/zendframework/zend-feed/src/Writer/Writer.php:98
PHP   6. Zend\Feed\Writer\ExtensionManager->__construct() /Users/danmichael/tmp/minimal/vendor/zendframework/zend-feed/src/Writer/Writer.php:80
PHP   7. spl_autoload_call() /Users/danmichael/tmp/minimal/vendor/zendframework/zend-feed/src/Writer/Writer.php:32
PHP   8. Composer\Autoload\ClassLoader->loadClass() /Users/danmichael/tmp/minimal/vendor/zendframework/zend-feed/src/Writer/Writer.php:32
PHP   9. Composer\Autoload\includeFile() /Users/danmichael/tmp/minimal/vendor/composer/ClassLoader.php:301
PHP  10. include() /Users/danmichael/tmp/minimal/vendor/composer/ClassLoader.php:412

Fatal error: Class 'Zend\ServiceManager\AbstractPluginManager' not found in /Users/danmichael/tmp/minimal/vendor/zendframework/zend-feed/src/Writer/ExtensionPluginManager.php on line 20

@weierophinney
Copy link
Member

Arrgghh! Evidently did not do the same work on the writer as I did on the reader. :person_frowning:

I'll get an alternate pull request out soon.

@weierophinney
Copy link
Member

Closing in favor of #13, which adds Zend\Feed\Writer\StandaloneExtensionManager, the complement to Zend\Feed\Reader\StandaloneExtensionManager, and which was inadvertently omitted when we added the latter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants