Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Zend-i18n package #1

Closed
weierophinney opened this issue Dec 31, 2019 · 2 comments · Fixed by #51
Closed

Missing Zend-i18n package #1

weierophinney opened this issue Dec 31, 2019 · 2 comments · Fixed by #51

Comments

@weierophinney
Copy link
Contributor

Hello,

I just installed a fresh install of Apigility with curl -sS https://apigility.org/install | php (according to documentation).

I started playing with it (it's my first time using Apigility) but I couldn't add an alpha validator on my field.
Looking at the console I realized I had the following error:

PHP Fatal error:  Uncaught Error: Class 'Zend\I18n\Validator\Alpha' not found

To fix the issue, I added the zendframework/zend-i18n package with composer require zendframework/zend-i18n and added 'Zend\\I18n' in modules.config.php (it was done by composer but there was a \ missing).

I hope it helps :)


Originally posted by @jbelien at zfcampus/zf-apigility-skeleton#170

@weierophinney
Copy link
Contributor Author

@jbelien Thanks for reporting the issue.
I believe zend-i18n should be added then to skeleton, so user has smooth experience when using default installation.

Can you explain what's wrong with 'Zend\I18n' (with single slash)? It was not working for you properly when it was injected like that? What was the error? Why you had to change it to double?
I've just tried install the skeleton and I see in config/module.config.php:

return [
    'Zend\Db',
    'Zend\Filter',
    'Zend\Hydrator',
    'Zend\InputFilter',
    'Zend\Paginator',
    'Zend\Router',
    'Zend\Validator',
    'ZF\Apigility',
    'ZF\Apigility\Documentation',
    'ZF\ApiProblem',
    'ZF\Configuration',
    'ZF\OAuth2',
    'ZF\MvcAuth',
    'ZF\Hal',
    'ZF\ContentNegotiation',
    'ZF\ContentValidation',
    'ZF\Rest',
    'ZF\Rpc',
    'ZF\Versioning',
    'Application',
];

so all modules are with single \ and it doesn't cause any issues.

Also see:
https://3v4l.org/vmEge


Originally posted by @michalbundyra at zfcampus/zf-apigility-skeleton#170 (comment)

@weierophinney
Copy link
Contributor Author

Can you explain what's wrong with 'Zend\I18n' (with single slash)?

It indeed works with on single slash Zend\I18n, sorry !
I mentioned it because all the others have a double slash in my config/modules.config.php and Zend\I18n was the single one with one single slash (with auto injection via composer).
So not really an issue indeed (and probably related to my environment - WSL -) and a simple composer require zendframework/zend-i18n is enough to fix this issue!


Originally posted by @jbelien at zfcampus/zf-apigility-skeleton#170 (comment)

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

Successfully merging a pull request may close this issue.

1 participant