External Libraries: Skip deprecated file warning for PHPMailer if the API is not loaded.

In [48033] the "class-phpmailer.php" file was deprecated. In test suites, this file is loaded before WordPress in order to setup a mock PHPMailer instance. This means that for test suites that are still loading that file, they'll experience fatal errors due to the undefined "_deprecated_file" function.

This commit skips issuing the deprecated file warning if the "_deprecated_file" function is not available.

Fixes #50380.

Built from https://develop.svn.wordpress.org/trunk@48034


git-svn-id: http://core.svn.wordpress.org/trunk@47801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
TimothyBlynJacobs 2020-06-12 21:10:08 +00:00
parent e4379c5ba8
commit afaeaf1529
2 changed files with 4 additions and 2 deletions

View File

@ -3,7 +3,9 @@
/** /**
* The PHPMailer class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace. * The PHPMailer class has been moved to the wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.
*/ */
if ( function_exists( '_deprecated_file' ) ) {
_deprecated_file( basename( __FILE__ ), '5.5.0', WPINC . '/PHPMailer/PHPMailer.php', __( 'The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.' ) ); _deprecated_file( basename( __FILE__ ), '5.5.0', WPINC . '/PHPMailer/PHPMailer.php', __( 'The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.' ) );
}
require __DIR__ . '/PHPMailer/PHPMailer.php'; require __DIR__ . '/PHPMailer/PHPMailer.php';
class_alias( PHPMailer\PHPMailer\PHPMailer::class, 'PHPMailer' ); class_alias( PHPMailer\PHPMailer\PHPMailer::class, 'PHPMailer' );

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.5-alpha-48033'; $wp_version = '5.5-alpha-48034';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.