Skip to content

Commit

Permalink
add compatibility to PHP 7.2 and higher (#329)
Browse files Browse the repository at this point in the history
* adding compatibility to PHP 7.2 and higher

Signed-off-by: Xheni Myrtaj <myrtajxheni@gmail.com>

* fix the required php version

Signed-off-by: Xheni Myrtaj <myrtajxheni@gmail.com>
  • Loading branch information
xh3n1 authored and michield committed May 26, 2018
1 parent 5968fc7 commit 6ec03d2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Expand Up @@ -18,6 +18,11 @@ matrix:
env: BROWSER=goutte
- php: '7.1'
env: BROWSER=chrome
- php: '7.2'
env: BROWSER=goutte
- php: '7.2'
env: BROWSER=chrome


notifications:
slack:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -18,7 +18,7 @@
},
"minimum-stability": "dev",
"require": {
"php": ">= 5.3.3"
"php": "^5.3.3 || ^7.0"
},
"require-dev": {
"behat/mink": "@stable",
Expand Down
21 changes: 4 additions & 17 deletions public_html/lists/admin/PHPMailer/PHPMailerAutoload.php
Expand Up @@ -32,21 +32,8 @@ function PHPMailerAutoload($classname)
}
}

if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
//SPL autoloading was introduced in PHP 5.1.2
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
spl_autoload_register('PHPMailerAutoload', true, true);
} else {
spl_autoload_register('PHPMailerAutoload');
}
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
spl_autoload_register('PHPMailerAutoload', true, true);
} else {
/**
* Fall back to traditional autoload for old PHP versions.
*
* @param string $classname The name of the class to load
*/
function __autoload($classname)
{
PHPMailerAutoload($classname);
}
}
spl_autoload_register('PHPMailerAutoload');
}

0 comments on commit 6ec03d2

Please sign in to comment.