zendframework / zend-mail

Mail component from Zend Framework
BSD 3-Clause "New" or "Revised" License
96 stars 111 forks source link

Added missing dependency to zend-servicemanager (for --no-dev install) #163

Closed pce closed 7 years ago

pce commented 7 years ago

If you want to use zend-mail as a standalone package and installed it with composer without dev requirements, usage results in a fatal error:

PHP Fatal error: Class 'Zend\ServiceManager\AbstractPluginManager' not found in $project/vendor/zendframework/zend-mail/src/Protocol/SmtpPluginManager.php

froschdesign commented 7 years ago

@pce It's already there:

"suggest": {
    "ext-intl": "Handle IDN in AddressList hostnames",
    "zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3 when using SMTP to deliver messages",
    "zendframework/zend-crypt": "Crammd5 support in SMTP Auth"
},
pce commented 7 years ago

Could you please explain, how a suggestion solves a unusable package state on a live server?

froschdesign commented 7 years ago

@pce

…unusable package state on a live server?

The zend-mail component runs without zend-servicemanager, if you do not use SMTP to deliver your messages. If you use SMTP, then you need zend-servicemanager and you must install it per composer.

froschdesign commented 7 years ago

@pce Sorry, but I think you misunderstood the suggest part of the composer file. zend-servicemanger is not strictly required to use zend-mail. Only if you use SMTP. That's the main idea behind the suggest part. (For a development environment zend-servicemanger is needed, because all unit tests must run.)

pce commented 7 years ago

In my opinion a "mail" package should include support for SMTP (the Mail Transfer Protocol). Can It Be All So Simple :sweat_smile:

glensc commented 7 years ago

@froschdesign also you can use smtp without servicemanager if you create the classes instance directly. i do that.

@pce you can use zend-mail various ways, so smtp is not required