Mailer now checks whether the class it needs is loaded. If not an exception is thrown saying that composer should be installed.
This commit is contained in:
parent
81b86c61c9
commit
a9212d9709
|
@ -30,7 +30,9 @@
|
|||
|
||||
namespace Module\Mailer;
|
||||
use \FuzeWorks\Module;
|
||||
use \FuzeWorks\ModuleException;
|
||||
use \FuzeWorks\Config;
|
||||
use \FuzeWorks\Logger;
|
||||
use \PHPMailer;
|
||||
|
||||
/**
|
||||
|
@ -57,7 +59,9 @@ use \PHPMailer;
|
|||
* @access public
|
||||
*/
|
||||
public function onLoad() {
|
||||
$this->cfg = Config::loadConfigFile('mailer', $this->getModulePath());
|
||||
if (!class_exists('\PHPMailer')) {
|
||||
throw new ModuleException("PHPMailer class not found! Is composer installed?", 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue