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

Missing Zend-i18n package #170

Open
jbelien opened this issue Nov 24, 2019 · 3 comments
Open

Missing Zend-i18n package #170

jbelien opened this issue Nov 24, 2019 · 3 comments

Comments

@jbelien
Copy link

jbelien commented Nov 24, 2019

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 :)

@michalbundyra
Copy link
Member

@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

@jbelien
Copy link
Author

jbelien commented Nov 24, 2019

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!

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas-api-tools/api-tools-skeleton; a new issue has been opened at laminas-api-tools/api-tools-skeleton#1.

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

No branches or pull requests

3 participants