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

Class Zend\ServiceManager\AbstractPluginManager not found #119

Closed
mkroeders opened this issue Aug 24, 2016 · 5 comments
Closed

Class Zend\ServiceManager\AbstractPluginManager not found #119

mkroeders opened this issue Aug 24, 2016 · 5 comments
Labels

Comments

@mkroeders
Copy link

When you run zendframework/zend-inputfilter as a stand alone library you get Class Zend\ServiceManager\AbstractPluginManager not found with the following code

$filter = new \Zend\InputFilter\InputFilter();
$input = new \Zend\InputFilter\Input('test');
$filter->add($input);

$filter->setData([]);

$filter->isValid();
$filter->getMessages();

This is due to the fact of \Zend\InputFilter\Input line 500, where the plugin chain is used. Which in turn uses the ValidatorPluginManager, which extends the Zend\ServiceManager\AbstractPluginManager. This class is not loaded because it is not part of the dependency.

To fix this issue zendframework/zend-servicemanager needs to be a dependency, and not dev only.

@froschdesign
Copy link
Member

froschdesign commented Sep 14, 2017

It's already there. Please look at the suggest section in the Composer file:

"suggest": {
"zendframework/zend-servicemanager": "To support plugin manager support"
},

Btw. sorry for the late response.

@Zebercet
Copy link

I think this issue is not invalid. Because it's not a sugggest. You have to install servicemanager to use inputfilter

@Xerkus Xerkus added bug and removed invalid labels Nov 28, 2017
@Xerkus
Copy link
Member

Xerkus commented Nov 28, 2017

Direct dependency was introduced in #67

@Xerkus Xerkus reopened this Nov 28, 2017
@settermjd
Copy link
Contributor

@Xerkus, imo @Zebercet is correct. While it is introduced as a direct dependency in #67, zend-inputfilter/composer.json only suggests it. To me that's incorrect functionality. zend-servicemanager should be moved to be a core requirement.

@voku
Copy link

voku commented Dec 15, 2017

I used the package yesterday for the first time and got this strange error ... so after a quick google-search I found this thread and now I know that I need to add "zend-servicemanager", but it isn't intuitive :/

settermjd added a commit to settermjd/zend-inputfilter that referenced this issue Jan 12, 2018
After being bitten by the bug in zendframework#119, where I couldn't use
zend-inputfilter without zend-servicemanager, I'm proposing this PR,
which makes zend-servicemanager a required dependency. I can't claim to
understand all the reasoning for not doing so to date, but based on this
experience, it makes sense to make the change.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants