Update to PHPMailer 6.6.0 with composer (#4329)

* Install PHPMailer 6.5.1 with composer

* Fix folder name for phpmailer

* Update PHPMailer to v6.6.0, add LICENSE and README.md

* remove composer and autoload.php after install/update

* Fix path to PHPMailer for PHPStan

* Remove lib/composer.lock, lock PHPMailer at version 6.6.0

* Improve PSR-4 autoloading for PHPMailer

* Markdownlint ignore

* Delete some obvious comments

* ignores

* Support composer update --no-autoloader

* Automatic cleaning
With rules based on https://github.com/PHPMailer/PHPMailer/blob/master/README.md#minimal-installation

* Readme gitignore hint

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
This commit is contained in:
Artur WeigandtandAlexandre Alapetite authored and GitHub committed 2022-05-14 23:38:16 +02:00
1 parent 7f0c378482
commit 5110d1db3e
15 files changed
+863 -33

No files matched your search

+12 -2
View File
@@ -9,6 +9,13 @@ if (!function_exists('mb_strcut')) {
}
}
if (!function_exists('str_starts_with')) {
/** Polyfill for PHP <8.0 */
function str_starts_with(string $haystack, string $needle): bool {
return strncmp($haystack, $needle, strlen($needle)) === 0;
}
}
// @phpstan-ignore-next-line
if (COPY_SYSLOG_TO_STDERR) {
openlog('FreshRSS', LOG_CONS | LOG_ODELAY | LOG_PID | LOG_PERROR, LOG_USER);
@@ -47,8 +54,11 @@ function classAutoloader($class) {
include(LIB_PATH . '/SimplePie/' . str_replace('_', '/', $class) . '.php');
} elseif (strpos($class, 'CssXPath') !== false) {
include(LIB_PATH . '/CssXPath/' . basename(str_replace('\\', '/', $class)) . '.php');
} elseif (strpos($class, 'PHPMailer') === 0) {
include(LIB_PATH . '/' . str_replace('\\', '/', $class) . '.php');
} elseif (str_starts_with($class, 'PHPMailer\\PHPMailer\\')) {
$prefix = 'PHPMailer\\PHPMailer\\';
$base_dir = LIB_PATH . '/phpmailer/phpmailer/src/';
$relative_class_name = substr($class, strlen($prefix));
require $base_dir . str_replace('\\', '/', $relative_class_name) . '.php';
}
}