Skip to content

Commit

Permalink
Refs #1370 - explicitly pull in pear/mail and pear/mail_mime for Mail…
Browse files Browse the repository at this point in the history
…Task
  • Loading branch information
mrook committed Oct 5, 2020
1 parent 75d080e commit d2fa5dc
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 5 deletions.
2 changes: 1 addition & 1 deletion classes/phing/listener/MailLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function __construct()
parent::__construct();

if (!class_exists('Mail')) {
throw new BuildException('Need the PEAR Mail package to send logs');
throw new BuildException('Need the pear/mail_mime package installed to send logs');
}

$tolist = Phing::getDefinedProperty('phing.log.mail.recipients');
Expand Down
6 changes: 3 additions & 3 deletions classes/phing/tasks/ext/MailTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ protected function sendFilesets()
@include_once 'Mail/mime.php';

if (!class_exists('Mail_mime')) {
throw new BuildException('Need the PEAR Mail_mime package to send attachments');
throw new BuildException('Need the pear/mail and pear/mail_mime packages installed');
}

$mime = new Mail_mime(['text_charset' => 'UTF-8']);
$mime = new \Mail_mime(['text_charset' => 'UTF-8']);
$hdrs = [
'From' => $this->from,
'Subject' => $this->subject
Expand All @@ -84,7 +84,7 @@ protected function sendFilesets()
$body = $mime->get();
$hdrs = $mime->headers($hdrs);

$mail = Mail::factory($this->backend, $this->backendParams);
$mail = \Mail::factory($this->backend, $this->backendParams);
$mail->send($this->tolist, $hdrs, $body);
}

Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
"monolog/monolog": "^1.25 || ^2.0",
"pdepend/pdepend": "^2.5.2",
"pear/archive_tar": "~1.4.7",
"pear/mail": "^1.4",
"pear/mail_mime": "^1.10",
"pear/net_growl": "dev-master",
"pear/pear-core-minimal": "~1.10.9",
"pear/versioncontrol_git": "dev-master",
Expand Down
106 changes: 105 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d2fa5dc

Please sign in to comment.