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

Add a note if a suggested package is needed #7

Open
froschdesign opened this issue May 11, 2018 · 4 comments
Open

Add a note if a suggested package is needed #7

froschdesign opened this issue May 11, 2018 · 4 comments

Comments

@froschdesign
Copy link
Member

froschdesign commented May 11, 2018

We should add a note to the documentation if a class needs another component which is not installed by Composer because it is not strictly required.

zend-validator

"suggest": {
    "zendframework/zend-db": "Zend\\Db component, required by the (No)RecordExists validator",
    "zendframework/zend-filter": "Zend\\Filter component, required by the Digits validator",
    "zendframework/zend-i18n": "Zend\\I18n component to allow translation of validation error messages",
    "zendframework/zend-math": "Zend\\Math component, required by the Csrf validator",
    "zendframework/zend-i18n-resources": "Translations of validator messages",
    "zendframework/zend-servicemanager": "Zend\\ServiceManager component to allow using the ValidatorPluginManager and validator chains",
    "zendframework/zend-session": "Zend\\Session component, ^2.8; required by the Csrf validator",
    "zendframework/zend-uri": "Zend\\Uri component, required by the Uri and Sitemap\\Loc validators"
},

https://github.com/zendframework/zend-validator/blob/87e743d11d49a157011a49a962c25e7a11adc7c5/composer.json#L34-L43

zend-paginator

https://github.com/zendframework/zend-paginator/blob/b4e853ef104101069e781f50f662f514e4e4e33f/composer.json#L36-L43

zend-mail

https://github.com/zendframework/zend-mail/blob/0e43bfe8994f38b2c7a2c560b1dcfee6eaaabc37/composer.json#L33-L36

Example

An example can be found in documentation of zend-hydrator:

Installation requirements

The AggregateHydrator depends on the zend-eventmanager component, so be sure to have it installed before getting started:

$ composer require zendframework/zend-eventmanager

(Should be formatted as a blockquote.)

https://docs.zendframework.com/zend-hydrator/aggregate/#installation-requirements

@froschdesign
Copy link
Member Author

Related to #6

@settermjd
Copy link
Contributor

I'm absolutely for this. I've been caught out in the past because packages were marked as optional in Composer, but were mandatory at runtime.

@froschdesign
Copy link
Member Author

I think we can test if the content is available with the install command via script.

@settermjd
Copy link
Contributor

I think we can test if the content is available with the install command via script.

Agreed.

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

No branches or pull requests

2 participants