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

Missing dependency to zend-servicemanager ? #72

Open
chapa opened this issue May 12, 2016 · 7 comments
Open

Missing dependency to zend-servicemanager ? #72

chapa opened this issue May 12, 2016 · 7 comments
Labels

Comments

@chapa
Copy link

chapa commented May 12, 2016

Hi,

I'm using zend-form as a standalone library (in a Symfony2 project), and I realize that since this commit (introduced in v2.8.2) there is a new autoload file which creates an alias FormElementManager for either FormElementManagerV3Polyfill or FormElementManagerV2Polyfill (the latter in my case).

So here's my problem : when I run a composer update the Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap post-update command fails with this error :

PHP Fatal error:  Class 'Zend\ServiceManager\AbstractPluginManager' not found in /sites/sfwebfstore/vendor/zendframework/zend-form/src/FormElementManager/FormElementManagerV2Polyfill.php on line 28

Actually the command doesn't matter, the problem appears very soon during the autoload phase.

I suspect this error to be a consequence of the absence of zend-servicemanager as a non-dev dependency in the composer.json of this project.
Indeed, considering I'm using zend-form in standalone and that zend-servicemanager isn't a dependency of any of the others packages, Zend\ServiceManager\AbstractPluginManager doesn't exists and an error appears.

I don't know if it makes sense to set zend-servicemanager as a non-dev requirement in this project, but I think it would resolve this problem (I'm not sure).
If you think it's not a good idea, please help me to find a solution because I'm pretty stucked there :-)

@pine3ree
Copy link
Contributor

pine3ree commented May 19, 2016

I have had the same issue while installing zend-form with zend-expressive (fastroute+pimple+plates).
Even just requiring zend-form (composer require zendframework/zend-form) and including the generated vendor/autoload.php will cause the issue. The zend-form composer.json require a file:
autload/formElementManagerPolyfill.php which defines a class alias for FormElementManager based on the service manager version. Confirming the version as well: zend-form v 2.8.1 is not affected.

@mreiche
Copy link

mreiche commented Jul 17, 2017

zend-form 2.10 is affected. This is bad, because my app crashes directly after autoloading.

@antgubarev
Copy link

confirm the problem :(

@froschdesign
Copy link
Member

@pine3ree is right, the polyfill and autoloading is the problem.

@ikdekker
Copy link

Will this be fixed, as far as I can see this problem still persists?

@froschdesign froschdesign modified the milestones: 2.11.0, 2.12.1 Jul 16, 2018
@Ocramius
Copy link
Member

@ikdekker send a patch: nothing fixes itself in OSS :-)

@michalbundyra
Copy link
Member

This repository has been closed and moved to laminas/laminas-form; a new issue has been opened at laminas/laminas-form#46.

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

9 participants