zendframework / zend-mail

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

Fatal error: Class 'Zend\ServiceManager\AbstractPluginManager' not found in D:\XAMPP\htdocs\sn\zend-mail\vendor\zendframework\zend-mail\src\Protocol\SmtpPluginManager.php on line 20 #233

Closed sakinaaf closed 5 years ago

sakinaaf commented 5 years ago

Fatal error: Class 'Zend\ServiceManager\AbstractPluginManager' not found in D:\XAMPP\htdocs\sn\zend-mail\vendor\zendframework\zend-mail\src\Protocol\SmtpPluginManager.php on line 20

froschdesign commented 5 years ago

For the SMTP functionality you must install the zend-servicemanager. The service manager is not strictly required for zend-mail and basic mail creation and sending. Therefore it is listed as suggested package.

Install:

$ composer require zendframework/zend-servicemanager

The note is also given by Composer after installing zend-mail.

https://github.com/zendframework/zend-mail/blob/ece418b37aaf8a98c991d7f0c198408043a2172d/composer.json#L34-L37


Duplicate of #62

glensc commented 5 years ago

well. the code could give appropriate exception:

throw new \RuntimeException("This functionality requires Zend ServiceManager, to install invoke: composer require zendframework/zend-servicemanager");

this is how Symfony does it. uncaught exception leads to believe there's a bug.

froschdesign commented 5 years ago

@glensc This kind of exception can also help in other components! It would be great, if can add this idea to the maintainers repository as a new issue report.

boesing commented 5 years ago

@froschdesign I would prefer having satellite packages with the next major version of those packages instead of having an exception like this. Satellite packages would also ensure proper version requirements as just the pure existence of the package probably wont make this work. Sure, one could add a conflict aswell but I still like satellite packages over exceptions.

But for existing packages like this, an exception would be ofc a suitable solution

froschdesign commented 5 years ago

@boesing Please add your ideas and suggestions to the maintainers repository because this issue is closed and any further comments will be forgotten.

Thanks!