summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Horohoe <chadh@wikimedia.org>2018-05-17 18:56:00 -0700
committerChad Horohoe <chadh@wikimedia.org>2018-05-24 15:24:33 -0700
commit94acc8fa8d9f018c38a79a9893fb9567a91fa352 (patch)
treefd8df040dd0e9a15d0c2d230d8e2b479e6d36c16
parent487829b8a396233c28a36decceecde5f55cee575 (diff)
Only load PEAR Smtp mailer from vendor/composer, not from `pear` itself1.31.0-rc.1
Change-Id: I91c42a3eafd079039ddbc17a11ad3c7b6579e3c1
-rw-r--r--RELEASE-NOTES-1.313
-rw-r--r--composer.json6
-rw-r--r--includes/mail/UserMailer.php13
3 files changed, 7 insertions, 15 deletions
diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31
index a20970811aa3..4c70dccc1551 100644
--- a/RELEASE-NOTES-1.31
+++ b/RELEASE-NOTES-1.31
@@ -110,6 +110,9 @@ production.
discussion pages) now have a tooltip to indicate state, not just colour.
=== External library changes in 1.31 ===
+* pear/mail, pear/mail_mime and pear/mail_mime-decode have been moved from
+ suggested to required. These packages now must be installed via composer
+ and not via PEAR itself.
==== Upgraded external libraries ====
* Updated jquery.chosen from v0.9.14 to v1.8.2.
diff --git a/composer.json b/composer.json
index 70462bd1ac63..771dbdab0d99 100644
--- a/composer.json
+++ b/composer.json
@@ -26,6 +26,9 @@
"liuggio/statsd-php-client": "1.0.18",
"oojs/oojs-ui": "v0.26.4",
"oyejorge/less.php": "1.7.0.14",
+ "pear/mail": "1.4.1",
+ "pear/mail_mime": "1.10.2",
+ "pear/mail_mime-decode": "1.5.5.2",
"php": ">=5.6.99",
"psr/log": "1.0.2",
"wikimedia/assert": "0.2.2",
@@ -73,9 +76,6 @@
"ext-wikidiff2": "Diff accelerator",
"monolog/monolog": "Flexible debug logging system",
"nmred/kafka-php": "Send debug log events to kafka",
- "pear/mail": "Mail sending support",
- "pear/mail_mime": "Mail sending support",
- "pear/mail_mime-decode": "Mail sending support",
"wikimedia/avro": "Binary serialization format used with kafka"
},
"autoload": {
diff --git a/includes/mail/UserMailer.php b/includes/mail/UserMailer.php
index 7b48ad095a8e..bdd4f448748f 100644
--- a/includes/mail/UserMailer.php
+++ b/includes/mail/UserMailer.php
@@ -198,14 +198,8 @@ class UserMailer {
private static function isMailMimeUsable() {
static $usable = null;
if ( $usable === null ) {
- // If the class is not already loaded, and it's in the include path,
- // try requiring it.
- if ( !class_exists( 'Mail_mime' ) && stream_resolve_include_path( 'Mail/mime.php' ) ) {
- require_once 'Mail/mime.php';
- }
$usable = class_exists( 'Mail_mime' );
}
-
return $usable;
}
@@ -218,11 +212,6 @@ class UserMailer {
private static function isMailUsable() {
static $usable = null;
if ( $usable === null ) {
- // If the class is not already loaded, and it's in the include path,
- // try requiring it.
- if ( !class_exists( 'Mail' ) && stream_resolve_include_path( 'Mail.php' ) ) {
- require_once 'Mail.php';
- }
$usable = class_exists( 'Mail' );
}
@@ -396,7 +385,7 @@ class UserMailer {
Wikimedia\suppressWarnings();
// Create the mail object using the Mail::factory method
- $mail_object =& Mail::factory( 'smtp', $wgSMTP );
+ $mail_object = Mail::factory( 'smtp', $wgSMTP );
if ( PEAR::isError( $mail_object ) ) {
wfDebug( "PEAR::Mail factory failed: " . $mail_object->getMessage() . "\n" );
Wikimedia\restoreWarnings();