0
0
mirror of https://github.com/PHPMailer/PHPMailer.git synced 2024-09-20 01:52:15 +02:00
Commit Graph

73 Commits

Author SHA1 Message Date
Marcus Bointon
28848ef589
Need older annotations for PHP 5.5 2022-12-06 15:46:09 +01:00
Marcus Bointon
a15a02369f
Bump dev deps 2022-12-06 15:37:20 +01:00
Marcus Bointon
26e7dec83d
Add ext-openssl suggestion 2022-12-06 15:36:12 +01:00
Marcus Bointon
1ca85b6116
Bump phpcs version to avoid dev issues on PHP 8.1 2022-11-18 10:16:31 +01:00
Marcus Bointon
3e38b34669
Merge pull request #2793 from greew/ticket_2788/azure_xoauth2
Added Azure XOAUTH2 help and examples
2022-10-16 21:24:02 +02:00
Jesper Skytte
405e5dd94a
Added Azure XOAUTH2 help and examples 2022-10-07 22:34:23 +02:00
Marcus Bointon
8b6386d741
6.6.5 2022-10-07 14:23:10 +02:00
jrfnl
29177b4766
Composer: update PHP Parallel Lint and Console Highlighter
PHP Console Highlighter has released version `1.0.0` and PHP Parallel Lint version `1.3.2` is the first PHP Parallel Lint version which supports PHP Console Highlighter `1.0.0`.

As the minimum supported PHP version is still PHP 5.3 for both, we can safely update both dependency requirements.

Refs:
* https://github.com/php-parallel-lint/PHP-Console-Highlighter/releases/tag/v1.0.0
* https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases/tag/v1.3.2
2022-06-14 10:53:57 +02:00
jrfnl
38355bb140
Composer script: show deprecations when linting
While rare, there are some deprecations which PHP can show when a file is being linted.
By default these are ignored by PHP-Parallel-Lint.

Apparently though, there is an option to show them (wasn't documented until recently), so let's turn that option on.
2022-04-07 14:05:06 +02:00
jrfnl
d94fd80848 Composer: allow the PHPCS plugin
The `dealerdirect/phpcodesniffer-composer-installer` Composer plugin is used to register external PHPCS standards with PHPCS.

As of Composer 2.2.0, Composer plugins need to be explicitly allowed to run. This adds the necessary configuration for that.

Refs:
* https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution
2021-12-23 03:05:11 +01:00
jrfnl
17cd8a8c11 Composer: update version constraints
Follow up on c1a6339108 which enabled PHP 8.1 support, let's make sure that the version constraints of (dev) dependencies are such that PHP 8.1 compatible versions will be installed.

Refs:
* https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases
* https://github.com/squizlabs/PHP_CodeSniffer/releases
2021-12-18 04:03:22 +01:00
jrfnl
c16da1afa8 GH Actions: set up code coverage monitoring via codecov
The Codecov service is a way to monitor test vs code coverage of a project over time and allows for the code coverage % + delta to be reported in each PR.

This commits:
* Adds a Codecov configuration.
* Adds a convenience script to the `composer.json` file to run the tests with or without code coverage.
* Adds a new matrix variable to the GH Actions `test` workflow to run the tests with code coverage and send the results to the Codecov service.
    Notes:
    - This disables the code coverage reporting in the "normal" test runs, including disabling `xdebug` for those runs which should make them slightly faster.
    - This splits the test runs into two sets:
        * High/low PHP are being run with code coverage (and have been removed from the "normal" test run matrix).
        * For all other PHP versions, the tests are being run without code coverage.
* Adds a badge to the README to show the current code coverage %.
2021-07-04 15:03:01 +02:00
jrfnl
f0cfd3f49d GH Actions: add PHP linting job
This commit:
* Add a new dependency on the PHP Parallel Lint package for fast PHP linting.
    The PHP Parallel Lint package, in combination with the PHP Console Highlighter provides the following advantages in comparison with "plain" PHP linting:
    - Higher speed due to the parallel processes.
    - Improved usability by providing color coded syntax highlighting of found errors on the command-line.
    - Integration with the `cs2pr` tool, allowing for the results of the lint command to be shown in-line in PRs.
* Adds a Composer `lint` script for easy access to the tool for devs, while making sure the correct command line parameters will be used.
    The linting command as currently set up, will also check the example files for linting errors.
* Adds a GH Actions job for linting the code on the high/low supported PHP versions, one arbitrary interim version + an experimental build against PHP 8.1.
    The `cs2pr` tool has been enabled and will show the results of the non-experimental lint runs in-line in PRs.
    **Note**: For PHP 8.1, the `cs2pr` tool is not used as there is a known issue in the Parallel Lint tool with PHP 8.1 which breaks on the checkstyle reporting. There is already a [PR open](https://github.com/php-parallel-lint/PHP-Parallel-Lint/pull/64) to fix this upstream. Once this PR has been merged and a new version of Parallel Lint has been released, the separate step for PHP 8.1 linting can be removed.
 * Makes the `test` job in the GHA workflow dependent on the `lint` job having passed...
     ... as the tests would fail anyway if there are linting errors.
    Also adjusts the name of the `test` jobs to include the word "Test" so they can be easily distinguished from the Lint jobs.

Refs:
* https://github.com/php-parallel-lint/PHP-Parallel-Lint
2021-07-03 12:55:00 +02:00
Juliette
9093c84614
Composer: update version constraints for PHPUnit Polyfills (#2366)
PHPUnit Polyfills 1.0.0 has been released.

Ref: https://github.com/Yoast/PHPUnit-Polyfills/releases/tag/1.0.0

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
Co-authored-by: Marcus Bointon <marcus@synchromedia.co.uk>
2021-06-22 18:59:27 +02:00
Juliette
b2df807028
Composer: use a version of PHPCS compatible with PHP 8 (#2364)
While working on 2363, I noticed that the code sniffer run was using PHP 8.0, but Composer still allowed for a PHP_CodeSniffer version to be installed which is not fully compatible with PHP 8.0.

Note: there are still two known incompatibilities with PHP 8.0 in PHPCS 3.6.0, but everything else has been fixed.

Ref: https://github.com/squizlabs/php_codesniffer/releases

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2021-06-22 18:52:00 +02:00
Marcus Bointon
b1038ee356
Add composer scripts for syntax check and tests 2021-04-29 10:49:27 +02:00
Marcus Bointon
6b6badad3f
Check for mbstring before trying to use it in parseAddresses 2021-03-19 22:17:22 +01:00
Juliette
78bda9997d
Make the tests PHPUnit cross version compatible + test on PHP 8 (#2202)
* .gitignore: ignore files created during a test run

* Tests: make config cross-version compatible

PHPUnit config file:

* Add `backupGlobals="true"`.
    The default value for this setting changed in PHPUnit 6 from `true` to `false`. By explicitly setting it to `true`, the existing behaviour is maintained.
* Remove the `logIncompleteSkipped` directive which is no longer supported.
* Remove a number of directives which use the default values and for which the defaults have not changed across PHPUnit versions.
* Remove the space in the testsuite name to make it more easily usable on the command line.
* Make sure that all src files are taken into consideration when calculating code coverage.
* Add XSD schema reference.
    Note: the config as-is will now validate for PHPUnit 4.4-9.2. For PHPUnit 9.3, the code coverage terminology has changed, though the "old" configuration is still supported.
    If needs be (PHPUnit 10), the config can be updated on the fly by using `--migrate-configuration`.

Other:
* Ignore a locally overloaded PHPUnit config file using the standard `phpunit.xml` file name.

Question: why does the config file not use the standard `phpunit.xml.dist` file name ? That would allow for running the tests without command line arguments.
That file can still be overloaded locally by a `phpunit.xml` file.

* Composer: add dependency on the PHPUnit Polyfills package

* Adds a dev dependency to the `yoast/phpunit-polyfills` package.
* As that package already requires and manages the installable versions for PHPUnit, remove this as an explicit requirement from `require-dev` in favour of letting the PHPUnit Polyfills package manage the versions.
    This will update the supported PHPUnit versions from `^4.8 || ^5.7` to `^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0`.
    Note: the supported versions for PHPUnit 4.x and 5.x are very specific and restrictive as it specifically targets the versions in which the "forward compatible" alias files for the namespaced classes are available.

This new package adds the following features:
* Polyfills for various PHPUnit cross-version changes.
* Basic test case and test listener.

Refs:
* https://github.com/Yoast/PHPUnit-Polyfills/

Includes adding the PHPUnit cache file, which is automatically created in PHPUnit 8 and 9, to the `.gitignore` file.

* Tests: switch over to use the Yoast\PHPUnitPolyfills\TestCases\TestCase

This switches the parent class of the test classes over `TestCase` from the PHPUnit native TestCase to the `Yoast\PHPUnitPolyfills\TestCases\TestCase`.

The Yoast `TestCase`:
* Provides cross-version compatibility using snake case fixture method names instead of the PHPUnit native camelCase names.

This switch over includes:
* Renaming the `setUp()` and `tearDown()` methods to, respectively, `set_up()` and `tear_down()` in various test classes for PHPUnit cross-version compatibility.

* Tests: switch over to use the Yoast Polyfill TestListenerDefaultImplementation

This switches `DebugLogTestListener` class over to using the PHPUnit 9 default implementation pattern in combination with using the `TestListenerDefaultImplementation` from the PHPUnit Polyfill library for the cross-version compatibility layer for the TestListener.

The Yoast `TestListenerDefaultImplementation`:
* Provides cross-version compatibility using snake case method names instead of the PHPUnit native camelCase names.

This switch over includes:
* Renaming the template methods used in the `DebugLogTestListener` to use their snake_case variant and removes the type declarations.

* Tests: switch out `assertInternalType()`

... in favour of the more specific assertion(s) as introduced in PHPUnit 7.5.0.

The new assertions are automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: switch out `assert[Not]Contains()` with string haystacks

... in favour of the string specific `assertString[Not]ContainsString() assertion(s) as introduced in PHPUnit 7.5.0.

The new assertions are automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: switch out `@expectException` annotations

... in favour of method calls to the `TestCase::expectException()` method as introduced in PHPUnit 5.2.0.

The new method and its variants are automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: switch out `assertRegExp()`

... in favour of the renamed `Assert::assertMatchesRegularExpression() as introduced in PHPUnit 9.1.0.

The new assertion is automatically polyfilled via the PHPUnit Polyfill repo as this test class extends the `Yoast\PHPUnitPolyfills\TestCases\TestCase` test case.

* Tests: mark a test as incomplete

As per the comment in the docblock:
> Needs a connection to a server that supports this auth mechanism, so commented out by default.

As the test cannot currently be executed succesfully, we may as well skip it with a meaningful message.

* Tests: mark a test as not performing assertions

... to prevent it from being marked as risky.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2020-11-25 15:35:50 +01:00
Juliette
3cb2162859
Improve PHPCS config (#2182)
* PHPCS: rename config file

... to `phpcs.xml.dist` to allow devs to locally overload the file by using a `.phpcs.xml` or `phpcs.xml` file, to, for instance, test out some new rules.

Includes:
* Adding the local overload files to `.gitignore`.
* Adding the standard config file to `.gitattributes`.

* PHPCS: scan missing file

The `get_oauth_token.php` file in the project root seems to have been overlooked when configuring the PHPCS ruleset.

Fixed now by adding it to the file to be scanned.

Includes minor fixes to make the file comply with the configured standard.

* CS: fix two files

Two minor CS fixes.

* PHPCS: miscellaneous changes

* Don't fix the PHPCS/external standards version restraints.
* Add the PHPCS cache file to `.gitignore`.
* Removing the no longer existent `.php_cs` file from `.gitattributes`.

Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>
2020-10-26 17:25:46 +01:00
Marcus Bointon
482bdd697a
Cleanup 2020-10-18 20:03:58 +02:00
Marcus Bointon
22e81749ae
Switch from PHP CS fixer to phpcs and apply PSR12 reformatting 2020-10-13 15:08:42 +02:00
Marcus Bointon
4af0120eda
Note that the hash extension is required (and always has been!) or file attachments won't work 2020-08-04 09:03:04 +02:00
Marcus Bointon
a7f1b23aae
Add funding info 2020-05-06 16:42:46 +02:00
Marcus Bointon
dd6cf2eb51
Remove some unneeded dev dependencies, resolves conflict in #1898
Phpdocs now build using a github action
2019-11-19 16:07:01 +01:00
Damien Regad
75e0a5ce3f Update composer license to LGPL-2.1-only (#1719)
As per SPDX License List, previously used `LGPL-2.1` is deprecated[1].

[1]: https://spdx.org/licenses/LGPL-2.1.html
2019-05-05 20:14:21 +02:00
Michael Orlitzky
c8613a447b composer.json: add dependency on the PHP "filter" extension. (#1301)
Many of the PHP extensions used by PHPMailer are optional, in one of
two senses. Either there is a fallback if the extension is not
present, or the use of the extension is avoidable entirely. For
example, there is a fallback parser if "imap_rfc822_parse_adrlist" is
not available, and OpenSSL is not needed unless encryption is used;
therefore neither are hard dependencies.

The filter extension, on the other hand, is unavoidable. It is used
unconditionally, with no fallbacks, in (for example) the "isValidHost"
function. This commit adds "ext-filter" to composer.json, to document
the dependency and to help out composer users.

Closes: https://github.com/PHPMailer/PHPMailer/issues/1298
2017-12-22 11:40:15 +01:00
Filippo Tessarotto
992392437c Tests improvements (#1162)
* Move tests to proper namespace; enforce signatures

* Travis stages, check coding-standard before tests

* Test against PHP 7.2

* CS Fix

* Remove php-cs-fixer on test builds

* Travis: remove phpdocumentor/phpdocumentor from builds

* Allow PHPUnit 5
2017-09-14 18:47:12 +02:00
Filippo Tessarotto
dc54e2b93c Show debug log only when tests fail (#1161) 2017-09-14 15:56:04 +02:00
Filippo Tessarotto
8550acd0e4 Add PHP-CS-Fixer integration (#1148)
* Add PHP-CS-Fixer checks

* Remove composer.lock to early catch FC break on CI

* Travis: cache dependencies

* Enable code-coverage only for latest build

* Remove Symfony-specific PHP-Doc rules

* Apply coding-standards fix
2017-09-14 12:29:03 +02:00
Marcus Bointon
efd7561b56
Revert composer changes to avoid PR clash 2017-09-08 16:18:50 +02:00
Marcus Bointon
31493b6732
Big cleanup for Symfony coding style and php-cs-fixer, see #1148 2017-09-07 18:21:09 +02:00
Marcus Bointon
9e4f68b6b0 Restrict zend_i18n to PHP 5.5 compat version 2017-06-29 21:55:28 +02:00
Marcus Bointon
5807c1fcbe
Merge remote-tracking branch 'remotes/origin/master' into 6.0
# Conflicts:
#	composer.json
#	src/PHPMailer.php
2017-05-11 16:09:52 +02:00
Elan Ruusamäe
afb1302611 composer: indicate ctype ext being used (#937) 2017-05-11 00:25:01 +01:00
Marcus Bointon
936eaa7770
Downgrade packages for BC with PHP 5.5 tests 2017-03-15 19:49:11 +01:00
Marcus Bointon
bf03eda8f6
Package downgrades to run tests on PHP 5.3 2017-03-15 15:13:09 +01:00
Marcus Bointon
c385749c11
Downgrade packages for BC with PHP 5.3 tests 2017-03-15 14:55:19 +01:00
Marcus Bointon
2ceafa2e84
Downgrade packages for BC with PHP 5.3 tests 2017-03-15 14:05:43 +01:00
Marcus Bointon
042ea958cb
Downgrade Zend packages for BC with PHP 5.3 tests 2017-03-15 12:56:46 +01:00
Ramon van Belzen
70da1b419d composer: phpunit 4.8 (#940)
switch from 4.7 to 4.8 (latest stable) of phpunit
2017-03-06 23:05:44 +01:00
aduh95
6f90caae19 Add mbstring suggestions to the composer file (#795) 2016-10-26 21:57:53 +02:00
Marcus Bointon
5e7ea2a6d1
Add PSR-3 compatible debug logging 2016-09-30 17:46:39 +02:00
Marcus
3abcab1936 Clean up TODOs
Switch SingleToArray to protected
Update Readme
Update composer deps
2016-04-19 18:26:33 +02:00
Marcus
a8b44e9a8e Merge remote-tracking branch 'remotes/upstream/master' into xoauth
# Conflicts:
#	src/PHPMailer.php
2016-04-19 17:30:13 +02:00
Marcus
05e43f3666 Don't use dynamic classnames in aliased namespaces, see #675
Increase PHP version req to 5.5 in composer.json
2016-04-06 20:18:34 +02:00
Synchro
7bb65f288b Merge branch 'master' into xoauth 2016-01-07 20:38:58 +01:00
Synchro
df2a2dfc79 Point at Google-specific OAuth2 lib since that's the only provider supported in 5.2.x 2016-01-07 18:35:00 +01:00
Synchro
de1015e6ed Fix composer files 2015-12-07 23:29:15 +01:00
Synchro
dffac3a0f5 Merge remote-tracking branch 'remotes/upstream/5.4' into xoauth
# Conflicts:
#	composer.json
#	composer.lock
#	get_oauth_token.php
2015-12-07 22:37:30 +01:00
Synchro
40bdd9c488 Merge branch 'master' into 5.4
# Conflicts:
#	changelog.md
#	composer.json
#	get_oauth_token.php
2015-12-07 22:19:48 +01:00