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:
Abel Hoogeveen 2016-01-17 14:43:33 +01:00
parent 81b86c61c9
commit a9212d9709
1 changed files with 5 additions and 1 deletions

View File

@ -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);
}
}
/**