diff --git a/composer.json b/composer.json index 75dd48c..75c218a 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "require": { "tinymce/tinymce": "*", "phpmailer/phpmailer": "dev-master", - "php-imap/php-imap": "5.0" + "webklex/php-imap": "^4.1" }, "minimum-stability": "dev" } diff --git a/composer.lock b/composer.lock index 8caae0b..bc6392a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,49 +4,37 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "28af27dc1d7f1cf3b23cc196c9a13301", + "content-hash": "f05155f56696cab73e4da7f772d9cc96", "packages": [ { - "name": "php-imap/php-imap", - "version": "5.0.0", + "name": "doctrine/inflector", + "version": "2.1.x-dev", "source": { "type": "git", - "url": "https://github.com/barbushin/php-imap.git", - "reference": "13bdfa9a6f541798253e24e2d8f44332c8be098c" + "url": "https://github.com/doctrine/inflector.git", + "reference": "d62dadcaaf16432c7c1364bf50be9e03f26ff043" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barbushin/php-imap/zipball/13bdfa9a6f541798253e24e2d8f44332c8be098c", - "reference": "13bdfa9a6f541798253e24e2d8f44332c8be098c", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/d62dadcaaf16432c7c1364bf50be9e03f26ff043", + "reference": "d62dadcaaf16432c7c1364bf50be9e03f26ff043", "shasum": "" }, "require": { - "ext-fileinfo": "*", - "ext-iconv": "*", - "ext-imap": "*", - "ext-json": "*", - "ext-mbstring": "*", - "php": "^7.4 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.4", - "maglnet/composer-require-checker": "^2.0|^3.2", - "nikic/php-parser": "^4.3,<4.7|^4.10", - "paragonie/hidden-string": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpunit/phpunit": "^8.5|^9.5", - "povils/phpmnd": "^2.2", - "psalm/plugin-phpunit": "^0.10.0|^0.15.1", - "roave/security-advisories": "dev-master", - "sebastian/phpcpd": "^4.1|^6.0" - }, - "suggest": { - "ext-fileinfo": "To facilitate IncomingMailAttachment::getFileInfo() auto-detection" + "doctrine/coding-standard": "^11.0", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^8.5 || ^9.5", + "vimeo/psalm": "^4.25 || ^5.4" }, "type": "library", "autoload": { "psr-4": { - "PhpImap\\": "src/PhpImap" + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" } }, "notification-url": "https://packagist.org/downloads/", @@ -55,26 +43,432 @@ ], "authors": [ { - "name": "Sergey Barbushin", - "email": "barbushin@gmail.com", - "homepage": "http://linkedin.com/in/barbushin" + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" } ], - "description": "Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)", - "homepage": "https://github.com/barbushin/php-imap", + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", "keywords": [ - "imap", - "mail", - "mailbox", + "inflection", + "inflector", + "lowercase", + "manipulation", "php", - "pop3", - "receive emails" + "plural", + "singular", + "strings", + "uppercase", + "words" ], "support": { - "issues": "https://github.com/barbushin/php-imap/issues", - "source": "https://github.com/barbushin/php-imap/tree/5.0.0" + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.1.x" }, - "time": "2022-03-12T14:39:59+00:00" + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "time": "2023-06-16T13:41:28+00:00" + }, + { + "name": "illuminate/collections", + "version": "8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/illuminate/collections.git", + "reference": "705a4e1ef93cd492c45b9b3e7911cccc990a07f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/collections/zipball/705a4e1ef93cd492c45b9b3e7911cccc990a07f4", + "reference": "705a4e1ef93cd492c45b9b3e7911cccc990a07f4", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "php": "^7.3|^8.0" + }, + "suggest": { + "symfony/var-dumper": "Required to use the dump method (^5.4)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "files": [ + "helpers.php" + ], + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Collections package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-06-23T15:29:49+00:00" + }, + { + "name": "illuminate/contracts", + "version": "8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", + "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0", + "psr/container": "^1.0", + "psr/simple-cache": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Contracts\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Contracts package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-01-13T14:47:47+00:00" + }, + { + "name": "illuminate/macroable", + "version": "8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/illuminate/macroable.git", + "reference": "aed81891a6e046fdee72edd497f822190f61c162" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162", + "reference": "aed81891a6e046fdee72edd497f822190f61c162", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Macroable package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-11-16T13:57:03+00:00" + }, + { + "name": "illuminate/pagination", + "version": "8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/illuminate/pagination.git", + "reference": "16fe8dc35f9d18c58a3471469af656a02e9ab692" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/pagination/zipball/16fe8dc35f9d18c58a3471469af656a02e9ab692", + "reference": "16fe8dc35f9d18c58a3471469af656a02e9ab692", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Pagination\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Pagination package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2022-06-27T13:26:06+00:00" + }, + { + "name": "illuminate/support", + "version": "8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "ad030d68770e00a395822a4c243b931be3e4d3c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/ad030d68770e00a395822a4c243b931be3e4d3c7", + "reference": "ad030d68770e00a395822a4c243b931be3e4d3c7", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.4|^2.0", + "ext-json": "*", + "ext-mbstring": "*", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "nesbot/carbon": "^2.53.1", + "php": "^7.3|^8.0", + "voku/portable-ascii": "^1.6.1" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "suggest": { + "illuminate/filesystem": "Required to use the composer class (^8.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", + "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", + "symfony/process": "Required to use the composer class (^5.4).", + "symfony/var-dumper": "Required to use the dd function (^5.4).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "files": [ + "helpers.php" + ], + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Support package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2023-06-11T21:11:10+00:00" + }, + { + "name": "nesbot/carbon", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "98276233188583f2ff845a0f992a235472d9466a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/98276233188583f2ff845a0f992a235472d9466a", + "reference": "98276233188583f2ff845a0f992a235472d9466a", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "psr/clock": "^1.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "doctrine/dbal": "^2.0 || ^3.1.4", + "doctrine/orm": "^2.7", + "friendsofphp/php-cs-fixer": "^3.0", + "kylekatarnls/multi-tester": "^2.0", + "ondrejmirtes/better-reflection": "*", + "phpmd/phpmd": "^2.9", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.99 || ^1.7.14", + "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", + "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", + "squizlabs/php_codesniffer": "^3.4" + }, + "default-branch": true, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.x-dev", + "dev-master": "2.x-dev" + }, + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], + "time": "2023-09-25T11:31:05+00:00" }, { "name": "phpmailer/phpmailer", @@ -82,12 +476,12 @@ "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "312ed95ab03e7f3f0316191e5bfb9f920b705825" + "reference": "a1fa2714c447adda7e6b07c4bfa290dfc1a035b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/312ed95ab03e7f3f0316191e5bfb9f920b705825", - "reference": "312ed95ab03e7f3f0316191e5bfb9f920b705825", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a1fa2714c447adda7e6b07c4bfa290dfc1a035b2", + "reference": "a1fa2714c447adda7e6b07c4bfa290dfc1a035b2", "shasum": "" }, "require": { @@ -155,7 +549,640 @@ "type": "github" } ], - "time": "2023-06-08T09:54:07+00:00" + "time": "2023-10-09T11:27:29+00:00" + }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, + { + "name": "psr/container", + "version": "1.x-dev", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "2.5.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/2.5" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-24T14:02:46+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "5.4.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "365992c83a836dfe635f1e903ccca43ee03d3dd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/365992c83a836dfe635f1e903ccca43ee03d3dd2", + "reference": "365992c83a836dfe635f1e903ccca43ee03d3dd2", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "predis/predis": "~1.0", + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/rate-limiter": "^5.2|^6.0" + }, + "suggest": { + "symfony/mime": "To use the file extension guesser" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/5.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-08-21T07:23:18+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "1.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "42292d99c55abe617799667f454222c54c60e229" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-28T09:04:16+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "1.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" + }, + { + "name": "symfony/translation", + "version": "5.4.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "96015d73801bb59de5a43d71906c5690759f29ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/96015d73801bb59de5a43d71906c5690759f29ea", + "reference": "96015d73801bb59de5a43d71906c5690759f29ea", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation-contracts": "^2.3" + }, + "conflict": { + "symfony/config": "<4.4", + "symfony/console": "<5.3", + "symfony/dependency-injection": "<5.0", + "symfony/http-kernel": "<5.0", + "symfony/twig-bundle": "<5.0", + "symfony/yaml": "<4.4" + }, + "provide": { + "symfony/translation-implementation": "2.3" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client-contracts": "^1.1|^2.0|^3.0", + "symfony/http-kernel": "^5.0|^6.0", + "symfony/intl": "^4.4|^5.0|^6.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/service-contracts": "^1.1.2|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/5.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-10-14T16:25:31+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "2.5.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "129138dd46853de65d8e4fcc526ba1f3f777ba57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/129138dd46853de65d8e4fcc526ba1f3f777ba57", + "reference": "129138dd46853de65d8e4fcc526ba1f3f777ba57", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/2.5" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-05-29T12:43:27+00:00" }, { "name": "tinymce/tinymce", @@ -163,12 +1190,12 @@ "source": { "type": "git", "url": "https://github.com/tinymce/tinymce-dist.git", - "reference": "6a37da4822eebcd2706793454b07bd891c5277a8" + "reference": "02e194ec4d37aab8335332f8ac3e8d2292ba2d47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tinymce/tinymce-dist/zipball/6a37da4822eebcd2706793454b07bd891c5277a8", - "reference": "6a37da4822eebcd2706793454b07bd891c5277a8", + "url": "https://api.github.com/repos/tinymce/tinymce-dist/zipball/02e194ec4d37aab8335332f8ac3e8d2292ba2d47", + "reference": "02e194ec4d37aab8335332f8ac3e8d2292ba2d47", "shasum": "" }, "default-branch": true, @@ -213,9 +1240,161 @@ "wysiwyg" ], "support": { - "source": "https://github.com/tinymce/tinymce-dist/tree/6.4.2" + "source": "https://github.com/tinymce/tinymce-dist/tree/6.7.0" }, - "time": "2023-04-26T10:48:15+00:00" + "time": "2023-08-30T11:10:35+00:00" + }, + { + "name": "voku/portable-ascii", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/voku/portable-ascii.git", + "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/87337c91b9dfacee02452244ee14ab3c43bc485a", + "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "type": "library", + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "http://www.moelleken.org/" + } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/1.6.1" + }, + "funding": [ + { + "url": "https://www.paypal.me/moelleken", + "type": "custom" + }, + { + "url": "https://github.com/voku", + "type": "github" + }, + { + "url": "https://opencollective.com/portable-ascii", + "type": "open_collective" + }, + { + "url": "https://www.patreon.com/voku", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "type": "tidelift" + } + ], + "time": "2022-01-24T18:55:24+00:00" + }, + { + "name": "webklex/php-imap", + "version": "4.1.2", + "source": { + "type": "git", + "url": "https://github.com/Webklex/php-imap.git", + "reference": "94bf93ae8868ac1e073cfbaef377f0ca1acac2bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Webklex/php-imap/zipball/94bf93ae8868ac1e073cfbaef377f0ca1acac2bc", + "reference": "94bf93ae8868ac1e073cfbaef377f0ca1acac2bc", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "ext-iconv": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "illuminate/pagination": ">=5.0.0", + "nesbot/carbon": ">=1.0", + "php": ">=7.0.0", + "symfony/http-foundation": ">=2.8.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "symfony/mime": "Recomended for better extension support" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Webklex\\PHPIMAP\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Malte Goldenbaum", + "email": "github@webklex.com", + "role": "Developer" + } + ], + "description": "PHP IMAP client", + "homepage": "https://github.com/webklex/php-imap", + "keywords": [ + "imap", + "mail", + "php-imap", + "pop3", + "webklex" + ], + "support": { + "issues": "https://github.com/Webklex/php-imap/issues", + "source": "https://github.com/Webklex/php-imap/tree/4.1.2" + }, + "funding": [ + { + "url": "https://www.buymeacoffee.com/webklex", + "type": "custom" + }, + { + "url": "https://ko-fi.com/webklex", + "type": "ko_fi" + } + ], + "time": "2022-12-14T15:45:15+00:00" } ], "packages-dev": [], @@ -231,5 +1410,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/include/emailinbox.php b/include/emailinbox.php index 6e1e8de..6ab411d 100644 --- a/include/emailinbox.php +++ b/include/emailinbox.php @@ -14,6 +14,7 @@ class Emailinbox extends Renderer { } protected function readEmailHeaders(): array { + return []; $cleanedHeaders = []; try { $mailsIds = $this->mbox->searchMailbox('ALL'); @@ -69,12 +70,12 @@ class Emailinbox extends Renderer { protected function generateFolders(): void { $this->connectToImap(); - $folders = $this->mbox->getMailboxes("*"); + $folders = $this->mbox->generateFolders(); $folderItems = []; foreach ($folders as $folder) { - $item = '
  • folder ? ' class="active-folder"' : '') . '>' . - utf8_encode($folder['shortpath']) . '
  • '; + $item = '
  • name) === $this->folder ? ' class="active-folder"' : '') . '>' . + utf8_encode($folder->full_name) . '
  • '; $folderItems[] = $item; } $this->content['folders'] = implode('', $folderItems); diff --git a/include/mail.php b/include/mail.php index 6912cae..1ce9cdb 100644 --- a/include/mail.php +++ b/include/mail.php @@ -21,6 +21,8 @@ class Mail extends Mailhandling { protected function generateContent(): void { $this->mail = $this->fetchEmail(); + $textHtml = $this->mail->textHtml; + $textPlain = $this->mail->textPlain; $this->content['sender'] = $this->mail->headers->senderaddress; $this->content['receiver'] = $this->mail->headers->toaddress; $this->content['senddate'] = (new DateTime($this->mail->date))->format('d.m.Y'); diff --git a/include/renderer.php b/include/renderer.php index 3726c25..9dd6aab 100644 --- a/include/renderer.php +++ b/include/renderer.php @@ -2,7 +2,8 @@ use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; use PHPMailer\PHPMailer\Exception; -use PhpImap\Mailbox; +use Webklex\PHPIMAP\ClientManager; +use Webklex\PHPIMAP\Client; require 'vendor/autoload.php'; @@ -34,7 +35,8 @@ class Renderer { protected int $smtpPort = 465; protected string $emailUser = 'foerderverein-ajs@gmx.de'; protected string $emailPassword = 'HarheimerWeg16'; - protected $mbox; + protected ClientManager $imapClientManager; + protected Client $mbox; public function __construct(?string $templateName = null) { session_start(); @@ -452,21 +454,18 @@ class Renderer { } protected function connectToImap($folder = ''): bool { - $this->mbox = new PhpImap\Mailbox( - '{' . $this->imapServer . ':' . $this->imapPort . '/imap/ssl}' . imap_utf7_encode($folder), - $this->emailUser, - $this->emailPassword, - __DIR__, - 'UTF-8', - true, - false - ); - $this->mbox->setConnectionArgs( - CL_EXPUNGE, - 3, - [] - ); - return ($this->mbox !== false); + $this->imapClientManager = new ClientManager('conf/imap.php'); + $this->mbox = $this->imapClientManager->make([ + 'host' => $this->imapServer, + 'port' => $this->imapPort, + 'encryption' => 'ssl', + 'validate_cert' => true, + 'username' => $this->emailUser, + 'password' => $this->emailPassword, + 'protocol' => 'imap' + ]); + $this->mbox->connect(); + return $this->mbox->isConnected();; } protected function saveFileLocal(string $newFileName, string $content, string $salt): void { diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index a72151c..7824d8f 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -45,35 +45,34 @@ class ClassLoader /** @var \Closure(string):void */ private static $includeFile; - /** @var ?string */ + /** @var string|null */ private $vendorDir; // PSR-4 /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixLengthsPsr4 = array(); /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixDirsPsr4 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr4 = array(); // PSR-0 /** - * @var array[] - * @psalm-var array> + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> */ private $prefixesPsr0 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr0 = array(); @@ -81,8 +80,7 @@ class ClassLoader private $useIncludePath = false; /** - * @var string[] - * @psalm-var array + * @var array */ private $classMap = array(); @@ -90,21 +88,20 @@ class ClassLoader private $classMapAuthoritative = false; /** - * @var bool[] - * @psalm-var array + * @var array */ private $missingClasses = array(); - /** @var ?string */ + /** @var string|null */ private $apcuPrefix; /** - * @var self[] + * @var array */ private static $registeredLoaders = array(); /** - * @param ?string $vendorDir + * @param string|null $vendorDir */ public function __construct($vendorDir = null) { @@ -113,7 +110,7 @@ class ClassLoader } /** - * @return string[] + * @return array> */ public function getPrefixes() { @@ -125,8 +122,7 @@ class ClassLoader } /** - * @return array[] - * @psalm-return array> + * @return array> */ public function getPrefixesPsr4() { @@ -134,8 +130,7 @@ class ClassLoader } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirs() { @@ -143,8 +138,7 @@ class ClassLoader } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirsPsr4() { @@ -152,8 +146,7 @@ class ClassLoader } /** - * @return string[] Array of classname => path - * @psalm-return array + * @return array Array of classname => path */ public function getClassMap() { @@ -161,8 +154,7 @@ class ClassLoader } /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap + * @param array $classMap Class to filename map * * @return void */ @@ -179,24 +171,25 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -205,19 +198,19 @@ class ClassLoader $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -226,9 +219,9 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * @@ -236,17 +229,18 @@ class ClassLoader */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -256,18 +250,18 @@ class ClassLoader throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -276,8 +270,8 @@ class ClassLoader * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories * * @return void */ @@ -294,8 +288,8 @@ class ClassLoader * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * @@ -481,9 +475,9 @@ class ClassLoader } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array */ public static function getRegisteredLoaders() { diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 0fb0a2c..5490b88 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -6,5 +6,10 @@ $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( + 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', + 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', + 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index f45d4f6..a9966aa 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,6 +6,20 @@ $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( - 'PhpImap\\' => array($vendorDir . '/php-imap/php-imap/src/PhpImap'), + 'voku\\' => array($vendorDir . '/voku/portable-ascii/src/voku'), + 'Webklex\\PHPIMAP\\' => array($vendorDir . '/webklex/php-imap/src'), + 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), + 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), + 'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'), + 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), + 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'), + 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), + 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), + 'Psr\\Clock\\' => array($vendorDir . '/psr/clock/src'), 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'), + 'Illuminate\\Support\\' => array($vendorDir . '/illuminate/macroable', $vendorDir . '/illuminate/collections', $vendorDir . '/illuminate/support'), + 'Illuminate\\Pagination\\' => array($vendorDir . '/illuminate/pagination'), + 'Illuminate\\Contracts\\' => array($vendorDir . '/illuminate/contracts'), + 'Doctrine\\Inflector\\' => array($vendorDir . '/doctrine/inflector/lib/Doctrine/Inflector'), + 'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 6ee0461..cc8e283 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -33,6 +33,18 @@ class ComposerAutoloaderInitb3a3dfb766a515d49b7f8665bad574b3 $loader->register(true); + $filesToLoad = \Composer\Autoload\ComposerStaticInitb3a3dfb766a515d49b7f8665bad574b3::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); + } + return $loader; } } diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 00513ac..85166ea 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -6,27 +6,131 @@ namespace Composer\Autoload; class ComposerStaticInitb3a3dfb766a515d49b7f8665bad574b3 { + public static $files = array ( + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + '60799491728b879e74601d83e38b2cad' => __DIR__ . '/..' . '/illuminate/collections/helpers.php', + 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php', + '72579e7bd17821bb1321b87411366eae' => __DIR__ . '/..' . '/illuminate/support/helpers.php', + ); + public static $prefixLengthsPsr4 = array ( + 'v' => + array ( + 'voku\\' => 5, + ), + 'W' => + array ( + 'Webklex\\PHPIMAP\\' => 16, + ), + 'S' => + array ( + 'Symfony\\Polyfill\\Php80\\' => 23, + 'Symfony\\Polyfill\\Mbstring\\' => 26, + 'Symfony\\Contracts\\Translation\\' => 30, + 'Symfony\\Component\\Translation\\' => 30, + 'Symfony\\Component\\HttpFoundation\\' => 33, + ), 'P' => array ( - 'PhpImap\\' => 8, + 'Psr\\SimpleCache\\' => 16, + 'Psr\\Container\\' => 14, + 'Psr\\Clock\\' => 10, 'PHPMailer\\PHPMailer\\' => 20, ), + 'I' => + array ( + 'Illuminate\\Support\\' => 19, + 'Illuminate\\Pagination\\' => 22, + 'Illuminate\\Contracts\\' => 21, + ), + 'D' => + array ( + 'Doctrine\\Inflector\\' => 19, + ), + 'C' => + array ( + 'Carbon\\' => 7, + ), ); public static $prefixDirsPsr4 = array ( - 'PhpImap\\' => + 'voku\\' => array ( - 0 => __DIR__ . '/..' . '/php-imap/php-imap/src/PhpImap', + 0 => __DIR__ . '/..' . '/voku/portable-ascii/src/voku', + ), + 'Webklex\\PHPIMAP\\' => + array ( + 0 => __DIR__ . '/..' . '/webklex/php-imap/src', + ), + 'Symfony\\Polyfill\\Php80\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', + ), + 'Symfony\\Polyfill\\Mbstring\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', + ), + 'Symfony\\Contracts\\Translation\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/translation-contracts', + ), + 'Symfony\\Component\\Translation\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/translation', + ), + 'Symfony\\Component\\HttpFoundation\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/http-foundation', + ), + 'Psr\\SimpleCache\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/simple-cache/src', + ), + 'Psr\\Container\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/container/src', + ), + 'Psr\\Clock\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/clock/src', ), 'PHPMailer\\PHPMailer\\' => array ( 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src', ), + 'Illuminate\\Support\\' => + array ( + 0 => __DIR__ . '/..' . '/illuminate/macroable', + 1 => __DIR__ . '/..' . '/illuminate/collections', + 2 => __DIR__ . '/..' . '/illuminate/support', + ), + 'Illuminate\\Pagination\\' => + array ( + 0 => __DIR__ . '/..' . '/illuminate/pagination', + ), + 'Illuminate\\Contracts\\' => + array ( + 0 => __DIR__ . '/..' . '/illuminate/contracts', + ), + 'Doctrine\\Inflector\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/inflector/lib/Doctrine/Inflector', + ), + 'Carbon\\' => + array ( + 0 => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon', + ), ); public static $classMap = array ( + 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', + 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', + 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', ); public static function getInitializer(ClassLoader $loader) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index ec7418b..d271251 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,49 +1,37 @@ { "packages": [ { - "name": "php-imap/php-imap", - "version": "5.0.0", - "version_normalized": "5.0.0.0", + "name": "doctrine/inflector", + "version": "2.1.x-dev", + "version_normalized": "2.1.9999999.9999999-dev", "source": { "type": "git", - "url": "https://github.com/barbushin/php-imap.git", - "reference": "13bdfa9a6f541798253e24e2d8f44332c8be098c" + "url": "https://github.com/doctrine/inflector.git", + "reference": "d62dadcaaf16432c7c1364bf50be9e03f26ff043" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barbushin/php-imap/zipball/13bdfa9a6f541798253e24e2d8f44332c8be098c", - "reference": "13bdfa9a6f541798253e24e2d8f44332c8be098c", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/d62dadcaaf16432c7c1364bf50be9e03f26ff043", + "reference": "d62dadcaaf16432c7c1364bf50be9e03f26ff043", "shasum": "" }, "require": { - "ext-fileinfo": "*", - "ext-iconv": "*", - "ext-imap": "*", - "ext-json": "*", - "ext-mbstring": "*", - "php": "^7.4 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.4", - "maglnet/composer-require-checker": "^2.0|^3.2", - "nikic/php-parser": "^4.3,<4.7|^4.10", - "paragonie/hidden-string": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpunit/phpunit": "^8.5|^9.5", - "povils/phpmnd": "^2.2", - "psalm/plugin-phpunit": "^0.10.0|^0.15.1", - "roave/security-advisories": "dev-master", - "sebastian/phpcpd": "^4.1|^6.0" + "doctrine/coding-standard": "^11.0", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^8.5 || ^9.5", + "vimeo/psalm": "^4.25 || ^5.4" }, - "suggest": { - "ext-fileinfo": "To facilitate IncomingMailAttachment::getFileInfo() auto-detection" - }, - "time": "2022-03-12T14:39:59+00:00", + "time": "2023-06-16T13:41:28+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "PhpImap\\": "src/PhpImap" + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" } }, "notification-url": "https://packagist.org/downloads/", @@ -52,26 +40,450 @@ ], "authors": [ { - "name": "Sergey Barbushin", - "email": "barbushin@gmail.com", - "homepage": "http://linkedin.com/in/barbushin" + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" } ], - "description": "Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)", - "homepage": "https://github.com/barbushin/php-imap", + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", "keywords": [ - "imap", - "mail", - "mailbox", + "inflection", + "inflector", + "lowercase", + "manipulation", "php", - "pop3", - "receive emails" + "plural", + "singular", + "strings", + "uppercase", + "words" ], "support": { - "issues": "https://github.com/barbushin/php-imap/issues", - "source": "https://github.com/barbushin/php-imap/tree/5.0.0" + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.1.x" }, - "install-path": "../php-imap/php-imap" + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "install-path": "../doctrine/inflector" + }, + { + "name": "illuminate/collections", + "version": "8.x-dev", + "version_normalized": "8.9999999.9999999.9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/illuminate/collections.git", + "reference": "705a4e1ef93cd492c45b9b3e7911cccc990a07f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/collections/zipball/705a4e1ef93cd492c45b9b3e7911cccc990a07f4", + "reference": "705a4e1ef93cd492c45b9b3e7911cccc990a07f4", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "php": "^7.3|^8.0" + }, + "suggest": { + "symfony/var-dumper": "Required to use the dump method (^5.4)." + }, + "time": "2022-06-23T15:29:49+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "helpers.php" + ], + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Collections package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "install-path": "../illuminate/collections" + }, + { + "name": "illuminate/contracts", + "version": "8.x-dev", + "version_normalized": "8.9999999.9999999.9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", + "reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0", + "psr/container": "^1.0", + "psr/simple-cache": "^1.0" + }, + "time": "2022-01-13T14:47:47+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Illuminate\\Contracts\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Contracts package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "install-path": "../illuminate/contracts" + }, + { + "name": "illuminate/macroable", + "version": "8.x-dev", + "version_normalized": "8.9999999.9999999.9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/illuminate/macroable.git", + "reference": "aed81891a6e046fdee72edd497f822190f61c162" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162", + "reference": "aed81891a6e046fdee72edd497f822190f61c162", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "time": "2021-11-16T13:57:03+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Macroable package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "install-path": "../illuminate/macroable" + }, + { + "name": "illuminate/pagination", + "version": "8.x-dev", + "version_normalized": "8.9999999.9999999.9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/illuminate/pagination.git", + "reference": "16fe8dc35f9d18c58a3471469af656a02e9ab692" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/pagination/zipball/16fe8dc35f9d18c58a3471469af656a02e9ab692", + "reference": "16fe8dc35f9d18c58a3471469af656a02e9ab692", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" + }, + "time": "2022-06-27T13:26:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Illuminate\\Pagination\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Pagination package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "install-path": "../illuminate/pagination" + }, + { + "name": "illuminate/support", + "version": "8.x-dev", + "version_normalized": "8.9999999.9999999.9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "ad030d68770e00a395822a4c243b931be3e4d3c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/ad030d68770e00a395822a4c243b931be3e4d3c7", + "reference": "ad030d68770e00a395822a4c243b931be3e4d3c7", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.4|^2.0", + "ext-json": "*", + "ext-mbstring": "*", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "nesbot/carbon": "^2.53.1", + "php": "^7.3|^8.0", + "voku/portable-ascii": "^1.6.1" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "suggest": { + "illuminate/filesystem": "Required to use the composer class (^8.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3|^2.0.2).", + "ramsey/uuid": "Required to use Str::uuid() (^4.2.2).", + "symfony/process": "Required to use the composer class (^5.4).", + "symfony/var-dumper": "Required to use the dd function (^5.4).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.4.1)." + }, + "time": "2023-06-11T21:11:10+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "helpers.php" + ], + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Support package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "install-path": "../illuminate/support" + }, + { + "name": "nesbot/carbon", + "version": "dev-master", + "version_normalized": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "98276233188583f2ff845a0f992a235472d9466a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/98276233188583f2ff845a0f992a235472d9466a", + "reference": "98276233188583f2ff845a0f992a235472d9466a", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "psr/clock": "^1.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "doctrine/dbal": "^2.0 || ^3.1.4", + "doctrine/orm": "^2.7", + "friendsofphp/php-cs-fixer": "^3.0", + "kylekatarnls/multi-tester": "^2.0", + "ondrejmirtes/better-reflection": "*", + "phpmd/phpmd": "^2.9", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.99 || ^1.7.14", + "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", + "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", + "squizlabs/php_codesniffer": "^3.4" + }, + "time": "2023-09-25T11:31:05+00:00", + "default-branch": true, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.x-dev", + "dev-master": "2.x-dev" + }, + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], + "install-path": "../nesbot/carbon" }, { "name": "phpmailer/phpmailer", @@ -80,12 +492,12 @@ "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "312ed95ab03e7f3f0316191e5bfb9f920b705825" + "reference": "a1fa2714c447adda7e6b07c4bfa290dfc1a035b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/312ed95ab03e7f3f0316191e5bfb9f920b705825", - "reference": "312ed95ab03e7f3f0316191e5bfb9f920b705825", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a1fa2714c447adda7e6b07c4bfa290dfc1a035b2", + "reference": "a1fa2714c447adda7e6b07c4bfa290dfc1a035b2", "shasum": "" }, "require": { @@ -114,7 +526,7 @@ "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, - "time": "2023-06-08T09:54:07+00:00", + "time": "2023-10-09T11:27:29+00:00", "default-branch": true, "type": "library", "installation-source": "dist", @@ -157,6 +569,666 @@ ], "install-path": "../phpmailer/phpmailer" }, + { + "name": "psr/clock", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "time": "2022-11-25T14:36:26+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "install-path": "../psr/clock" + }, + { + "name": "psr/container", + "version": "1.x-dev", + "version_normalized": "1.9999999.9999999.9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "time": "2021-11-05T16:50:12+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "install-path": "../psr/container" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2017-10-23T01:57:42+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "install-path": "../psr/simple-cache" + }, + { + "name": "symfony/deprecation-contracts", + "version": "2.5.x-dev", + "version_normalized": "2.5.9999999.9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2023-01-24T14:02:46+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/2.5" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/deprecation-contracts" + }, + { + "name": "symfony/http-foundation", + "version": "5.4.x-dev", + "version_normalized": "5.4.9999999.9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "365992c83a836dfe635f1e903ccca43ee03d3dd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/365992c83a836dfe635f1e903ccca43ee03d3dd2", + "reference": "365992c83a836dfe635f1e903ccca43ee03d3dd2", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php80": "^1.16" + }, + "require-dev": { + "predis/predis": "~1.0", + "symfony/cache": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4", + "symfony/mime": "^4.4|^5.0|^6.0", + "symfony/rate-limiter": "^5.2|^6.0" + }, + "suggest": { + "symfony/mime": "To use the file extension guesser" + }, + "time": "2023-08-21T07:23:18+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/5.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/http-foundation" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "1.x-dev", + "version_normalized": "1.9999999.9999999.9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "42292d99c55abe617799667f454222c54c60e229" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2023-07-28T09:04:16+00:00", + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-mbstring" + }, + { + "name": "symfony/polyfill-php80", + "version": "1.x-dev", + "version_normalized": "1.9999999.9999999.9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2023-01-26T09:26:14+00:00", + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php80" + }, + { + "name": "symfony/translation", + "version": "5.4.x-dev", + "version_normalized": "5.4.9999999.9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "96015d73801bb59de5a43d71906c5690759f29ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/96015d73801bb59de5a43d71906c5690759f29ea", + "reference": "96015d73801bb59de5a43d71906c5690759f29ea", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation-contracts": "^2.3" + }, + "conflict": { + "symfony/config": "<4.4", + "symfony/console": "<5.3", + "symfony/dependency-injection": "<5.0", + "symfony/http-kernel": "<5.0", + "symfony/twig-bundle": "<5.0", + "symfony/yaml": "<4.4" + }, + "provide": { + "symfony/translation-implementation": "2.3" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client-contracts": "^1.1|^2.0|^3.0", + "symfony/http-kernel": "^5.0|^6.0", + "symfony/intl": "^4.4|^5.0|^6.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/service-contracts": "^1.1.2|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "time": "2023-10-14T16:25:31+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/5.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/translation" + }, + { + "name": "symfony/translation-contracts", + "version": "2.5.x-dev", + "version_normalized": "2.5.9999999.9999999-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "129138dd46853de65d8e4fcc526ba1f3f777ba57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/129138dd46853de65d8e4fcc526ba1f3f777ba57", + "reference": "129138dd46853de65d8e4fcc526ba1f3f777ba57", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "time": "2023-05-29T12:43:27+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/2.5" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/translation-contracts" + }, { "name": "tinymce/tinymce", "version": "dev-master", @@ -164,15 +1236,15 @@ "source": { "type": "git", "url": "https://github.com/tinymce/tinymce-dist.git", - "reference": "6a37da4822eebcd2706793454b07bd891c5277a8" + "reference": "02e194ec4d37aab8335332f8ac3e8d2292ba2d47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tinymce/tinymce-dist/zipball/6a37da4822eebcd2706793454b07bd891c5277a8", - "reference": "6a37da4822eebcd2706793454b07bd891c5277a8", + "url": "https://api.github.com/repos/tinymce/tinymce-dist/zipball/02e194ec4d37aab8335332f8ac3e8d2292ba2d47", + "reference": "02e194ec4d37aab8335332f8ac3e8d2292ba2d47", "shasum": "" }, - "time": "2023-04-26T10:48:15+00:00", + "time": "2023-08-30T11:10:35+00:00", "default-branch": true, "type": "component", "extra": { @@ -216,9 +1288,167 @@ "wysiwyg" ], "support": { - "source": "https://github.com/tinymce/tinymce-dist/tree/6.4.2" + "source": "https://github.com/tinymce/tinymce-dist/tree/6.7.0" }, "install-path": "../tinymce/tinymce" + }, + { + "name": "voku/portable-ascii", + "version": "1.6.1", + "version_normalized": "1.6.1.0", + "source": { + "type": "git", + "url": "https://github.com/voku/portable-ascii.git", + "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/87337c91b9dfacee02452244ee14ab3c43bc485a", + "reference": "87337c91b9dfacee02452244ee14ab3c43bc485a", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "time": "2022-01-24T18:55:24+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "http://www.moelleken.org/" + } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/1.6.1" + }, + "funding": [ + { + "url": "https://www.paypal.me/moelleken", + "type": "custom" + }, + { + "url": "https://github.com/voku", + "type": "github" + }, + { + "url": "https://opencollective.com/portable-ascii", + "type": "open_collective" + }, + { + "url": "https://www.patreon.com/voku", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "type": "tidelift" + } + ], + "install-path": "../voku/portable-ascii" + }, + { + "name": "webklex/php-imap", + "version": "4.1.2", + "version_normalized": "4.1.2.0", + "source": { + "type": "git", + "url": "https://github.com/Webklex/php-imap.git", + "reference": "94bf93ae8868ac1e073cfbaef377f0ca1acac2bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Webklex/php-imap/zipball/94bf93ae8868ac1e073cfbaef377f0ca1acac2bc", + "reference": "94bf93ae8868ac1e073cfbaef377f0ca1acac2bc", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "ext-iconv": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "illuminate/pagination": ">=5.0.0", + "nesbot/carbon": ">=1.0", + "php": ">=7.0.0", + "symfony/http-foundation": ">=2.8.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "symfony/mime": "Recomended for better extension support" + }, + "time": "2022-12-14T15:45:15+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Webklex\\PHPIMAP\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Malte Goldenbaum", + "email": "github@webklex.com", + "role": "Developer" + } + ], + "description": "PHP IMAP client", + "homepage": "https://github.com/webklex/php-imap", + "keywords": [ + "imap", + "mail", + "php-imap", + "pop3", + "webklex" + ], + "support": { + "issues": "https://github.com/Webklex/php-imap/issues", + "source": "https://github.com/Webklex/php-imap/tree/4.1.2" + }, + "funding": [ + { + "url": "https://www.buymeacoffee.com/webklex", + "type": "custom" + }, + { + "url": "https://ko-fi.com/webklex", + "type": "ko_fi" + } + ], + "install-path": "../webklex/php-imap" } ], "dev": true, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index b98670e..8f52ac8 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '1c6f08b77a9f8f7d91de74616da0b18dfccef4e8', + 'reference' => '54d30dd3c3ff737ecc0ef62de19a7c9ed29fea2d', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,25 +13,81 @@ '__root__' => array( 'pretty_version' => 'dev-main', 'version' => 'dev-main', - 'reference' => '1c6f08b77a9f8f7d91de74616da0b18dfccef4e8', + 'reference' => '54d30dd3c3ff737ecc0ef62de19a7c9ed29fea2d', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), - 'php-imap/php-imap' => array( - 'pretty_version' => '5.0.0', - 'version' => '5.0.0.0', - 'reference' => '13bdfa9a6f541798253e24e2d8f44332c8be098c', + 'doctrine/inflector' => array( + 'pretty_version' => '2.1.x-dev', + 'version' => '2.1.9999999.9999999-dev', + 'reference' => 'd62dadcaaf16432c7c1364bf50be9e03f26ff043', 'type' => 'library', - 'install_path' => __DIR__ . '/../php-imap/php-imap', + 'install_path' => __DIR__ . '/../doctrine/inflector', 'aliases' => array(), 'dev_requirement' => false, ), + 'illuminate/collections' => array( + 'pretty_version' => '8.x-dev', + 'version' => '8.9999999.9999999.9999999-dev', + 'reference' => '705a4e1ef93cd492c45b9b3e7911cccc990a07f4', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/collections', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'illuminate/contracts' => array( + 'pretty_version' => '8.x-dev', + 'version' => '8.9999999.9999999.9999999-dev', + 'reference' => '5e0fd287a1b22a6b346a9f7cd484d8cf0234585d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/contracts', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'illuminate/macroable' => array( + 'pretty_version' => '8.x-dev', + 'version' => '8.9999999.9999999.9999999-dev', + 'reference' => 'aed81891a6e046fdee72edd497f822190f61c162', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/macroable', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'illuminate/pagination' => array( + 'pretty_version' => '8.x-dev', + 'version' => '8.9999999.9999999.9999999-dev', + 'reference' => '16fe8dc35f9d18c58a3471469af656a02e9ab692', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/pagination', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'illuminate/support' => array( + 'pretty_version' => '8.x-dev', + 'version' => '8.9999999.9999999.9999999-dev', + 'reference' => 'ad030d68770e00a395822a4c243b931be3e4d3c7', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/support', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'nesbot/carbon' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '98276233188583f2ff845a0f992a235472d9466a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../nesbot/carbon', + 'aliases' => array( + 0 => '2.x-dev', + ), + 'dev_requirement' => false, + ), 'phpmailer/phpmailer' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '312ed95ab03e7f3f0316191e5bfb9f920b705825', + 'reference' => 'a1fa2714c447adda7e6b07c4bfa290dfc1a035b2', 'type' => 'library', 'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'aliases' => array( @@ -39,10 +95,103 @@ ), 'dev_requirement' => false, ), + 'psr/clock' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'reference' => 'e41a24703d4560fd0acb709162f73b8adfc3aa0d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/clock', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/clock-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/container' => array( + 'pretty_version' => '1.x-dev', + 'version' => '1.9999999.9999999.9999999-dev', + 'reference' => '513e0666f7216c7459170d56df27dfcefe1689ea', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/container', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/simple-cache' => array( + 'pretty_version' => '1.0.1', + 'version' => '1.0.1.0', + 'reference' => '408d5eafb83c57f6365a3ca330ff23aa4a5fa39b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/simple-cache', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/deprecation-contracts' => array( + 'pretty_version' => '2.5.x-dev', + 'version' => '2.5.9999999.9999999-dev', + 'reference' => '80d075412b557d41002320b96a096ca65aa2c98d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/http-foundation' => array( + 'pretty_version' => '5.4.x-dev', + 'version' => '5.4.9999999.9999999-dev', + 'reference' => '365992c83a836dfe635f1e903ccca43ee03d3dd2', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/http-foundation', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/polyfill-mbstring' => array( + 'pretty_version' => '1.x-dev', + 'version' => '1.9999999.9999999.9999999-dev', + 'reference' => '42292d99c55abe617799667f454222c54c60e229', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/polyfill-php80' => array( + 'pretty_version' => '1.x-dev', + 'version' => '1.9999999.9999999.9999999-dev', + 'reference' => '6caa57379c4aec19c0a12a38b59b26487dcfe4b5', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/translation' => array( + 'pretty_version' => '5.4.x-dev', + 'version' => '5.4.9999999.9999999-dev', + 'reference' => '96015d73801bb59de5a43d71906c5690759f29ea', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/translation', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/translation-contracts' => array( + 'pretty_version' => '2.5.x-dev', + 'version' => '2.5.9999999.9999999-dev', + 'reference' => '129138dd46853de65d8e4fcc526ba1f3f777ba57', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/translation-contracts', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/translation-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '2.3', + ), + ), 'tinymce/tinymce' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '6a37da4822eebcd2706793454b07bd891c5277a8', + 'reference' => '02e194ec4d37aab8335332f8ac3e8d2292ba2d47', 'type' => 'component', 'install_path' => __DIR__ . '/../tinymce/tinymce', 'aliases' => array( @@ -50,5 +199,23 @@ ), 'dev_requirement' => false, ), + 'voku/portable-ascii' => array( + 'pretty_version' => '1.6.1', + 'version' => '1.6.1.0', + 'reference' => '87337c91b9dfacee02452244ee14ab3c43bc485a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../voku/portable-ascii', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'webklex/php-imap' => array( + 'pretty_version' => '4.1.2', + 'version' => '4.1.2.0', + 'reference' => '94bf93ae8868ac1e073cfbaef377f0ca1acac2bc', + 'type' => 'library', + 'install_path' => __DIR__ . '/../webklex/php-imap', + 'aliases' => array(), + 'dev_requirement' => false, + ), ), ); diff --git a/vendor/php-imap/php-imap/.codeclimate.yml b/vendor/php-imap/php-imap/.codeclimate.yml deleted file mode 100644 index 651c187..0000000 --- a/vendor/php-imap/php-imap/.codeclimate.yml +++ /dev/null @@ -1,36 +0,0 @@ -# Advanced Configuration for CodeClimate: https://docs.codeclimate.com/docs -languages: - PHP: true -exclude_paths: ["tests/*", "examples/*"] -version: "2" # required to adjust maintainability checks -checks: - argument-count: - config: - threshold: 5 - complex-logic: - config: - threshold: 4 - file-lines: - config: - threshold: 250 - method-complexity: - config: - threshold: 5 - method-count: - config: - threshold: 20 - method-lines: - config: - threshold: 40 - nested-control-flow: - config: - threshold: 4 - return-statements: - config: - threshold: 4 - similar-code: - config: - threshold: # language-specific defaults. an override will affect all languages. - identical-code: - config: - threshold: # language-specific defaults. an override will affect all languages. diff --git a/vendor/php-imap/php-imap/.editorconfig b/vendor/php-imap/php-imap/.editorconfig deleted file mode 100644 index b06b4db..0000000 --- a/vendor/php-imap/php-imap/.editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.yml] -indent_size = 2 - -[composer.json] -indent_style = space diff --git a/vendor/php-imap/php-imap/.github/CONTRIBUTING/contributing.md b/vendor/php-imap/php-imap/.github/CONTRIBUTING/contributing.md deleted file mode 100644 index 9751018..0000000 --- a/vendor/php-imap/php-imap/.github/CONTRIBUTING/contributing.md +++ /dev/null @@ -1,21 +0,0 @@ -# How to contribute - -First of all, thanks for taking the time to contribute! - -Every contribution, being it pull requests, bug reports or feature requests, will help to improve this library! - -## Ways to contribute - -* Found a bug? Want a feature? Or just having question? [Open an -issue!](https://github.com/barbushin/php-imap/issues/new/choose) -* Add a feature or fix a bug: - * Check for existing issue or create a new one. - * Fork the repo, make your changes. - * Create a pull request, and reference the issue. -* Add examples, tests, or improve documentation. - -## Test - -When committing code, please make sure to test before creating a pull request. - -We use PHPUnit for testing, feel free to add new tests. This is not a requirement, but helps us maintain code coverage. diff --git a/vendor/php-imap/php-imap/.github/ISSUE_TEMPLATE/bug_report.md b/vendor/php-imap/php-imap/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 10cb27e..0000000 --- a/vendor/php-imap/php-imap/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "[BUG] A short description of what the bug is" -labels: needs investigation -assignees: '' - ---- - -**Environment (please complete the following information):** - - PHP IMAP version: [e.g. 3.0.11] - - PHP Version: [e.g. 7.1.26] - - Type of execution: [e.g. Daemon / CLI or Web Server] - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior. - -The used code: -```php -$mailbox = new Mailbox(... -``` - -The headers of the parsed email, if required and possible (only, if it's NOT confidential): -``` -Received: from BN3NAM04HT142.eop-NAM04.prod.protection.outlook.com -(2603:10a6:209:2a::30) by AM6PR05MB6294.eurprd05.prod.outlook.com with HTTPS -via AM6PR07CA0017.EURPRD07.PROD.OUTLOOK.COM; Sun, 5 May 2019 12:29:42 +0000 -Received: from BN3NAM04FT054.eop-NAM04.prod.protection.outlook.com -(10.152.92.54) by BN3NAM04HT142.eop-NAM04.prod.protection.outlook.com -(10.152.92.244) with Microsoft SMTP Server (version=TLS1_2, -cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1835.13; Sun, 5 May -2019 12:29:41 +0000 -... -``` - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots / Outputs** -If applicable, add screenshots or outputs of your script to help explain your problem. - -**Additional context** -Add any other context about the problem here. diff --git a/vendor/php-imap/php-imap/.github/ISSUE_TEMPLATE/feature_request.md b/vendor/php-imap/php-imap/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 508eeef..0000000 --- a/vendor/php-imap/php-imap/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: "[Feature Request] A short description of what you want to happen" -labels: needs investigation -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/vendor/php-imap/php-imap/.github/ISSUE_TEMPLATE/other-issue.md b/vendor/php-imap/php-imap/.github/ISSUE_TEMPLATE/other-issue.md deleted file mode 100644 index af8fbe6..0000000 --- a/vendor/php-imap/php-imap/.github/ISSUE_TEMPLATE/other-issue.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -name: Other Issue -about: Ask your question, if it's not a bug or feature request -title: '' -labels: '' -assignees: '' - ---- - -**Environment (please complete the following information):** - - PHP IMAP version: [e.g. 3.0.11] - - PHP Version: [e.g. 7.1.26] - - Type of execution: [e.g. Daemon / CLI or Web Server] - -**Your Text** -A clear and concise description of what you want. diff --git a/vendor/php-imap/php-imap/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/vendor/php-imap/php-imap/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md deleted file mode 100644 index 256e2e6..0000000 --- a/vendor/php-imap/php-imap/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +++ /dev/null @@ -1,16 +0,0 @@ -**Describe the change(s)** - -A clear and concise description of what you changed and why you changed it. - -**Example code to use new / updated methods** - -```php -$mailbox = new Mailbox(... -``` - ---- -Make sure, that these boxes are checked before creating your pull request: - -- [ ] A short description of this change is provided -- [ ] A short example code is provided, if possible -- [ ] PHPUnit tests for your changes exists diff --git a/vendor/php-imap/php-imap/.github/workflows/php_code_coverage.yml b/vendor/php-imap/php-imap/.github/workflows/php_code_coverage.yml deleted file mode 100644 index 9b21626..0000000 --- a/vendor/php-imap/php-imap/.github/workflows/php_code_coverage.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: PHP Code Coverage - -on: - push: - branches: - - master - pull_request: - -jobs: - coverage: - name: Coverage - runs-on: ${{ matrix.operating-system }} - strategy: - matrix: - operating-system: ['ubuntu-20.04'] - php-versions: ['8.1'] - - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - coverage: xdebug - - - uses: actions/checkout@v2 - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache Files - uses: actions/cache@v2 - with: - path: | - ${{ steps.composer-cache.outputs.dir }} - **/.php_cs.cache - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer install --prefer-dist --no-progress --no-suggest - - - name: Run tests - uses: paambaati/codeclimate-action@v2.7.2 - env: - CC_TEST_REPORTER_ID: "945dfb58a832d233a3caeb84e3e6d3be212e8c7abcb48117fce63b9adcb43647" - with: - coverageCommand: ./vendor/bin/phpunit --testdox --stop-on-failure --coverage-clover=clover.xml diff --git a/vendor/php-imap/php-imap/.github/workflows/php_static_analysis.yml b/vendor/php-imap/php-imap/.github/workflows/php_static_analysis.yml deleted file mode 100644 index eb68eca..0000000 --- a/vendor/php-imap/php-imap/.github/workflows/php_static_analysis.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: PHP Static Analysis & Tests - -on: - push: - branches: - - master - pull_request: - -jobs: - static-analysis: - name: Static Analysis PHP ${{ matrix.php-versions }} - runs-on: ${{ matrix.operating-system }} - strategy: - matrix: - operating-system: ['ubuntu-20.04'] - php-versions: ['7.4', '8.0', '8.1'] - - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - coverage: none - - - uses: actions/checkout@v2 - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache Files - uses: actions/cache@v2 - with: - path: | - ${{ steps.composer-cache.outputs.dir }} - **/.php_cs.cache - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer install --prefer-dist --no-progress --no-suggest - - - name: Run static analysis - run: composer run static-analysis diff --git a/vendor/php-imap/php-imap/.github/workflows/php_unit_tests.yml b/vendor/php-imap/php-imap/.github/workflows/php_unit_tests.yml deleted file mode 100644 index fe1023f..0000000 --- a/vendor/php-imap/php-imap/.github/workflows/php_unit_tests.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: PHP Unit Tests - -on: - push: - branches: - - master - pull_request: - -jobs: - phpunit: - name: PHP ${{ matrix.php-versions }} Unit Tests - runs-on: ${{ matrix.operating-system }} - strategy: - matrix: - operating-system: ['ubuntu-20.04'] - php-versions: ['7.4', '8.0', '8.1'] - - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - coverage: none - - - uses: actions/checkout@v2 - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache Files - uses: actions/cache@v2 - with: - path: | - ${{ steps.composer-cache.outputs.dir }} - **/.php_cs.cache - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer install --prefer-dist --no-progress --no-suggest - - - name: Run tests - run: ./vendor/bin/phpunit --testdox --stop-on-failure diff --git a/vendor/php-imap/php-imap/.gitignore b/vendor/php-imap/php-imap/.gitignore deleted file mode 100644 index fb9818c..0000000 --- a/vendor/php-imap/php-imap/.gitignore +++ /dev/null @@ -1,179 +0,0 @@ -# All of the vendor directory should be installed by running 'composer install' -vendor/ -composer.lock -*.phar -.php-cs-fixer.cache -coverage/ -psalm/cache/ - -################# -## Eclipse -################# - -*.pydevproject -.project -.metadata -.idea -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.classpath -.settings/ -.loadpath - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# CDT-specific -.cproject - -# PDT-specific -.buildpath - - -################# -## Visual Studio -################# - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.sln.docstates - -# Build results -[Dd]ebug/ -[Rr]elease/ -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.vspscc -.builds -*.dotCover - -## TODO: If you have NuGet Package Restore enabled, uncomment this -#packages/ - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf - -# Visual Studio profiler -*.psess -*.vsp - -# ReSharper is a .NET coding add-in -_ReSharper* - -# Installshield output folder -[Ee]xpress - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish - -# Others -[Bb]in -[Oo]bj -sql -TestResults -*.Cache -ClientBin -stylecop.* -~$* -*.dbmdl -Generated_Code #added for RIA/Silverlight projects - -# Backup & report files from converting an old project file to a newer -# Visual Studio version. Backup files are not needed, because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML - - - -############ -## Windows -############ - -# Windows image file caches -Thumbs.db - -# Folder config file -Desktop.ini - - -############# -## Python -############# - -*.py[co] - -# Packages -*.egg -*.egg-info -dist -build -eggs -parts -bin -var -sdist -develop-eggs -.installed.cfg - -# Installer logs -pip-log.txt - -# Unit test / coverage reports -.coverage -.tox -clover.xml - -#Translations -*.mo - -#Mr Developer -.mr.developer.cfg - -# Mac crap -.DS_Store - -# NetBeans IDE -nbproject/ - -# Visual Studio Code -.vscode/ diff --git a/vendor/php-imap/php-imap/.php-cs-fixer.dist.php b/vendor/php-imap/php-imap/.php-cs-fixer.dist.php deleted file mode 100644 index 924761f..0000000 --- a/vendor/php-imap/php-imap/.php-cs-fixer.dist.php +++ /dev/null @@ -1,39 +0,0 @@ -setRiskyAllowed(true) - ->setRules([ - '@Symfony' => true, - '@Symfony:risky' => true, - '@PHP71Migration' => true, // @PHP72Migration does not exist - '@PHP71Migration:risky' => true, // @PHP72Migration:risky does not exist - 'array_syntax' => ['syntax' => 'short'], - 'declare_strict_types' => true, - 'global_namespace_import' => [ - 'import_classes' => true, - 'import_constants' => true, - 'import_functions' => false, - ], - 'native_constant_invocation' => true, - 'native_function_invocation' => [ - 'strict' => false, - 'include' => ['@compiler_optimized'], - ], - 'no_superfluous_phpdoc_tags' => true, - 'ordered_class_elements' => true, - 'ordered_imports' => true, - 'php_unit_dedicate_assert' => ['target' => 'newest'], - 'php_unit_method_casing' => true, - 'php_unit_test_case_static_method_calls' => ['call_type' => 'this'], - 'phpdoc_to_comment' => false, - 'void_return' => true, - ]) - ->setFinder(PhpCsFixer\Finder::create() - ->exclude('vendor') - ->in(__DIR__) - ) -; diff --git a/vendor/php-imap/php-imap/LICENSE b/vendor/php-imap/php-imap/LICENSE deleted file mode 100644 index df016aa..0000000 --- a/vendor/php-imap/php-imap/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012 Sergey Barbushin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/vendor/php-imap/php-imap/README.md b/vendor/php-imap/php-imap/README.md deleted file mode 100644 index ad978ba..0000000 --- a/vendor/php-imap/php-imap/README.md +++ /dev/null @@ -1,193 +0,0 @@ -# PHP IMAP - -[![GitHub release](https://img.shields.io/github/release/barbushin/php-imap.svg?style=flat-square)](https://packagist.org/packages/php-imap/php-imap) -[![Supported PHP Version](https://img.shields.io/packagist/php-v/php-imap/php-imap.svg)](README.md) -[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Packagist](https://img.shields.io/packagist/dt/php-imap/php-imap.svg?style=flat-square)](https://packagist.org/packages/php-imap/php-imap) - -[![CI PHP Unit Tests](https://github.com/barbushin/php-imap/actions/workflows/php_unit_tests.yml/badge.svg?branch=master)](https://github.com/barbushin/php-imap/actions/workflows/php_unit_tests.yml) -[![CI PHP Static Analysis](https://github.com/barbushin/php-imap/actions/workflows/php_static_analysis.yml/badge.svg?branch=master)](https://github.com/barbushin/php-imap/actions/workflows/php_static_analysis.yml) -[![CI PHP Code Coverage](https://github.com/barbushin/php-imap/actions/workflows/php_code_coverage.yml/badge.svg?branch=master)](https://github.com/barbushin/php-imap/actions/workflows/php_code_coverage.yml) - -[![Maintainability](https://api.codeclimate.com/v1/badges/02f72a4fd695cb7e2976/maintainability)](https://codeclimate.com/github/barbushin/php-imap/maintainability) -[![Test Coverage](https://api.codeclimate.com/v1/badges/02f72a4fd695cb7e2976/test_coverage)](https://codeclimate.com/github/barbushin/php-imap/test_coverage) -[![Type Coverage](https://shepherd.dev/github/barbushin/php-imap/coverage.svg)](https://shepherd.dev/github/barbushin/php-imap) - -Initially released in December 2012, the PHP IMAP Mailbox is a powerful and open source library to connect to a mailbox by POP3, IMAP and NNTP using the PHP IMAP extension. This library allows you to fetch emails from your email server. Extend the functionality or create powerful web applications to handle your incoming emails. - -### Features - -* Connect to mailbox by POP3/IMAP/NNTP, using [PHP IMAP extension](http://php.net/manual/book.imap.php) -* Get emails with attachments and inline images -* Get emails filtered or sorted by custom criteria -* Mark emails as seen/unseen -* Delete emails -* Manage mailbox folders - -### Requirements - -| PHP Version | php-imap Version | php-imap status | -| ------------- | ------------- | ------------- | -| 5.6 | 3.x | End of life | -| 7.0 | 3.x | End of life | -| 7.1 | 3.x | End of life | -| 7.2 | 3.x, 4.x | End of life | -| 7.3 | 3.x, 4.x | End of life | -| 7.4 | >3.0.33, 4.x, 5.x | Active support | -| 8.0 | >3.0.33, 4.x, 5.x | Active support | -| 8.1 | >4.3.0, 5.x | Active support | - -* PHP `fileinfo` extension must be present; so make sure this line is active in your php.ini: `extension=php_fileinfo.dll` -* PHP `iconv` extension must be present; so make sure this line is active in your php.ini: `extension=php_iconv.dll` -* PHP `imap` extension must be present; so make sure this line is active in your php.ini: `extension=php_imap.dll` -* PHP `mbstring` extension must be present; so make sure this line is active in your php.ini: `extension=php_mbstring.dll` -* PHP `json` extension must be present; so make sure this line is active in your php.ini: `extension=json.dll` - -### Installation by Composer - -Install the [latest available release](https://github.com/barbushin/php-imap/releases): - - $ composer require php-imap/php-imap - -Install the latest available and stable source code from `master`, which is may not released / tagged yet: - - $ composer require php-imap/php-imap:dev-master - -### Run Tests - -Before you can run the any tests you may need to run `composer install` to install all (development) dependencies. - -#### Run all tests - -You can run all available tests by running the following command (inside of the installed `php-imap` directory): `composer run tests` - -#### Run only PHPUnit tests - -You can run all PHPUnit tests by running the following command (inside of the installed `php-imap` directory): `php vendor/bin/phpunit --testdox` - -### Integration with frameworks - -* Symfony - https://github.com/secit-pl/imap-bundle - -### Getting Started Example - -Below, you'll find an example code how you can use this library. For further information and other examples, you may take a look at the [wiki](https://github.com/barbushin/php-imap/wiki). - -By default, this library uses random filenames for attachments as identical file names from other emails would overwrite other attachments. If you want to keep the original file name, you can set the attachment filename mode to ``true``, but then you also need to ensure, that those files don't get overwritten by other emails for example. - -```php -// Create PhpImap\Mailbox instance for all further actions -$mailbox = new PhpImap\Mailbox( - '{imap.gmail.com:993/imap/ssl}INBOX', // IMAP server and mailbox folder - 'some@gmail.com', // Username for the before configured mailbox - '*********', // Password for the before configured username - __DIR__, // Directory, where attachments will be saved (optional) - 'UTF-8', // Server encoding (optional) - true, // Trim leading/ending whitespaces of IMAP path (optional) - false // Attachment filename mode (optional; false = random filename; true = original filename) -); - -// set some connection arguments (if appropriate) -$mailbox->setConnectionArgs( - CL_EXPUNGE // expunge deleted mails upon mailbox close - | OP_SECURE // don't do non-secure authentication -); - -try { - // Get all emails (messages) - // PHP.net imap_search criteria: http://php.net/manual/en/function.imap-search.php - $mailsIds = $mailbox->searchMailbox('ALL'); -} catch(PhpImap\Exceptions\ConnectionException $ex) { - echo "IMAP connection failed: " . implode(",", $ex->getErrors('all')); - die(); -} - -// If $mailsIds is empty, no emails could be found -if(!$mailsIds) { - die('Mailbox is empty'); -} - -// Get the first message -// If '__DIR__' was defined in the first line, it will automatically -// save all attachments to the specified directory -$mail = $mailbox->getMail($mailsIds[0]); - -// Show, if $mail has one or more attachments -echo "\nMail has attachments? "; -if($mail->hasAttachments()) { - echo "Yes\n"; -} else { - echo "No\n"; -} - -// Print all information of $mail -print_r($mail); - -// Print all attachements of $mail -echo "\n\nAttachments:\n"; -print_r($mail->getAttachments()); -``` - -Method `imap()` allows to call any [PHP IMAP function](https://www.php.net/manual/ref.imap.php) in a context of the instance. Example: - -```php -// Call imap_check() - see http://php.net/manual/function.imap-check.php -$info = $mailbox->imap('check'); - - -// Show current time for the mailbox -$currentServerTime = isset($info->Date) && $info->Date ? date('Y-m-d H:i:s', strtotime($info->Date)) : 'Unknown'; - -echo $currentServerTime; -``` - -Some request require much time and resources: - -```php -// If you don't need to grab attachments you can significantly increase performance of your application -$mailbox->setAttachmentsIgnore(true); - -// get the list of folders/mailboxes -$folders = $mailbox->getMailboxes('*'); - -// loop through mailboxs -foreach($folders as $folder) { - - // switch to particular mailbox - $mailbox->switchMailbox($folder['fullpath']); - - // search in particular mailbox - $mails_ids[$folder['fullpath']] = $mailbox->searchMailbox('SINCE "1 Jan 2018" BEFORE "28 Jan 2018"'); -} - -print_r($mails_ids); -``` - -### Upgrading from 3.x - -Prior to 3.1, `Mailbox` used a "magic" method (`Mailbox::imap()`), with the -class `Imap` now performing it's purpose to call many `imap_*` functions with -automated string encoding/decoding of arguments and return values: - -Before: - -```php - public function checkMailbox() - { - return $this->imap('check'); - } -``` - -After: - -```php - public function checkMailbox(): object - { - return Imap::check($this->getImapStream()); - } -``` - -### Recommended - -* Google Chrome extension [PHP Console](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef) -* Google Chrome extension [JavaScript Errors Notifier](https://chrome.google.com/webstore/detail/javascript-errors-notifie/jafmfknfnkoekkdocjiaipcnmkklaajd) diff --git a/vendor/php-imap/php-imap/composer-require-checker.config.json b/vendor/php-imap/php-imap/composer-require-checker.config.json deleted file mode 100644 index 9020d1d..0000000 --- a/vendor/php-imap/php-imap/composer-require-checker.config.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "symbol-whitelist" : [ - "null", "true", "false", - "static", "self", "parent", - "array", "string", "int", "float", "bool", "iterable", "callable", "void", "object", "mixed", "never", - "IMAP\\Connection" - ], - "php-core-extensions" : [ - "Core", - "date", - "pcre", - "Phar", - "Reflection", - "SPL", - "standard" - ], - "scan-files" : [] -} diff --git a/vendor/php-imap/php-imap/composer.json b/vendor/php-imap/php-imap/composer.json deleted file mode 100644 index 9b44d8e..0000000 --- a/vendor/php-imap/php-imap/composer.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "php-imap/php-imap", - "description": "Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)", - "keywords": [ - "PHP", - "mail", - "IMAP", - "POP3", - "mailbox", - "receive emails" - ], - "homepage": "https://github.com/barbushin/php-imap", - "license": "MIT", - "type": "library", - "authors": [ - { - "name": "Sergey Barbushin", - "homepage": "http://linkedin.com/in/barbushin", - "email": "barbushin@gmail.com" - } - ], - "config": { - "sort-packages": true - }, - "require": { - "php": "^7.4 || ^8.0", - "ext-fileinfo": "*", - "ext-iconv": "*", - "ext-imap": "*", - "ext-mbstring": "*", - "ext-json": "*" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.4", - "maglnet/composer-require-checker": "^2.0|^3.2", - "nikic/php-parser": "^4.3,<4.7|^4.10", - "paragonie/hidden-string": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpunit/phpunit": "^8.5|^9.5", - "povils/phpmnd": "^2.2", - "psalm/plugin-phpunit": "^0.10.0|^0.15.1", - "roave/security-advisories": "dev-master", - "sebastian/phpcpd": "^4.1|^6.0" - }, - "scripts": { - "static-analysis": [ - "parallel-lint .php-cs-fixer.dist.php src tests examples", - "phpcpd src tests", - "composer-require-checker check --config-file=composer-require-checker.config.json ./composer.json", - "phpmnd ./ --exclude=./.github/ --exclude=./examples/ --exclude=./vendor/ --non-zero-exit-on-violation --hint", - "php-cs-fixer fix --allow-risky=yes --no-interaction --dry-run -v", - "psalm --show-info=false" - ], - "tests": [ - "@static-analysis", - "phpunit --testdox" - ] - }, - "suggest": { - "ext-fileinfo": "To facilitate IncomingMailAttachment::getFileInfo() auto-detection" - }, - "autoload-dev": { - "psr-4": { - "PhpImap\\": "tests/unit" - } - }, - "autoload": { - "psr-4": { - "PhpImap\\": "src/PhpImap" - } - } -} diff --git a/vendor/php-imap/php-imap/examples/get_and_parse_all_emails_with_matching_subject.php b/vendor/php-imap/php-imap/examples/get_and_parse_all_emails_with_matching_subject.php deleted file mode 100644 index ccd3d3d..0000000 --- a/vendor/php-imap/php-imap/examples/get_and_parse_all_emails_with_matching_subject.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ - declare(strict_types=1); - - require_once __DIR__.'/../vendor/autoload.php'; - - use PhpImap\Exceptions\ConnectionException; - use PhpImap\Mailbox; - - $mailbox = new Mailbox( - '{imap.gmail.com:993/imap/ssl}INBOX', // IMAP server and mailbox folder - 'some@gmail.com', // Username for the before configured mailbox - '*********', // Password for the before configured username - __DIR__, // Directory, where attachments will be saved (optional) - 'US-ASCII' // Server encoding (optional) - ); - - try { - $mail_ids = $mailbox->searchMailbox('SUBJECT "part of the subject"'); - } catch (ConnectionException $ex) { - exit('IMAP connection failed: '.$ex->getMessage()); - } catch (Exception $ex) { - exit('An error occured: '.$ex->getMessage()); - } - - foreach ($mail_ids as $mail_id) { - echo "+------ P A R S I N G ------+\n"; - - $email = $mailbox->getMail( - $mail_id, // ID of the email, you want to get - false // Do NOT mark emails as seen (optional) - ); - - echo 'from-name: '.(string) ($email->fromName ?? $email->fromAddress)."\n"; - echo 'from-email: '.(string) $email->fromAddress."\n"; - echo 'to: '.(string) $email->toString."\n"; - echo 'subject: '.(string) $email->subject."\n"; - echo 'message_id: '.(string) $email->messageId."\n"; - - echo 'mail has attachments? '; - if ($email->hasAttachments()) { - echo "Yes\n"; - } else { - echo "No\n"; - } - - if (!empty($email->getAttachments())) { - echo \count($email->getAttachments())." attachements\n"; - } - if ($email->textHtml) { - echo "Message HTML:\n".$email->textHtml; - } else { - echo "Message Plain:\n".$email->textPlain; - } - - if (!empty($email->autoSubmitted)) { - // Mark email as "read" / "seen" - $mailbox->markMailAsRead($mail_id); - echo "+------ IGNORING: Auto-Reply ------+\n"; - } - - if (!empty($email_content->precedence)) { - // Mark email as "read" / "seen" - $mailbox->markMailAsRead($mail_id); - echo "+------ IGNORING: Non-Delivery Report/Receipt ------+\n"; - } - } - - $mailbox->disconnect(); diff --git a/vendor/php-imap/php-imap/examples/get_and_parse_all_emails_without_saving_attachments.php b/vendor/php-imap/php-imap/examples/get_and_parse_all_emails_without_saving_attachments.php deleted file mode 100644 index 258129e..0000000 --- a/vendor/php-imap/php-imap/examples/get_and_parse_all_emails_without_saving_attachments.php +++ /dev/null @@ -1,84 +0,0 @@ - - */ - declare(strict_types=1); - - require_once __DIR__.'/../vendor/autoload.php'; - - use PhpImap\Exceptions\ConnectionException; - use PhpImap\Mailbox; - - $mailbox = new Mailbox( - '{imap.gmail.com:993/imap/ssl}INBOX', // IMAP server and mailbox folder - 'some@gmail.com', // Username for the before configured mailbox - '*********', // Password for the before configured username - null, // Directory, where attachments will be saved (optional) - 'US-ASCII' // Server encoding (optional) - ); - - // OR - $mailbox = new Mailbox( - '{imap.gmail.com:993/imap/ssl}INBOX', // IMAP server and mailbox folder - 'some@gmail.com', // Username for the before configured mailbox - '*********' // Password for the before configured username - ); - - // If you haven't defined the server encoding (charset) in 'new Mailbox()', you can change it any time - $mailbox->setServerEncoding('US-ASCII'); - - try { - $mail_ids = $mailbox->searchMailbox('UNSEEN'); - } catch (ConnectionException $ex) { - exit('IMAP connection failed: '.$ex->getMessage()); - } catch (Exception $ex) { - exit('An error occured: '.$ex->getMessage()); - } - - foreach ($mail_ids as $mail_id) { - echo "+------ P A R S I N G ------+\n"; - - $email = $mailbox->getMail( - $mail_id, // ID of the email, you want to get - false // Do NOT mark emails as seen (optional) - ); - - echo 'from-name: '.(string) ($email->fromName ?? $email->fromAddress)."\n"; - echo 'from-email: '.(string) $email->fromAddress."\n"; - echo 'to: '.(string) $email->toString."\n"; - echo 'subject: '.(string) $email->subject."\n"; - echo 'message_id: '.(string) $email->messageId."\n"; - - echo 'mail has attachments? '; - if ($email->hasAttachments()) { - echo "Yes\n"; - } else { - echo "No\n"; - } - - if (!empty($email->getAttachments())) { - echo \count($email->getAttachments())." attachements\n"; - } - if ($email->textHtml) { - echo "Message HTML:\n".$email->textHtml; - } else { - echo "Message Plain:\n".$email->textPlain; - } - - if (!empty($email->autoSubmitted)) { - // Mark email as "read" / "seen" - $mailbox->markMailAsRead($mail_id); - echo "+------ IGNORING: Auto-Reply ------+\n"; - } - - if (!empty($email_content->precedence)) { - // Mark email as "read" / "seen" - $mailbox->markMailAsRead($mail_id); - echo "+------ IGNORING: Non-Delivery Report/Receipt ------+\n"; - } - } - - $mailbox->disconnect(); diff --git a/vendor/php-imap/php-imap/examples/get_and_parse_unseen_emails.php b/vendor/php-imap/php-imap/examples/get_and_parse_unseen_emails.php deleted file mode 100644 index 12eb8bb..0000000 --- a/vendor/php-imap/php-imap/examples/get_and_parse_unseen_emails.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ - declare(strict_types=1); - - require_once __DIR__.'/../vendor/autoload.php'; - - use PhpImap\Exceptions\ConnectionException; - use PhpImap\Mailbox; - - $mailbox = new Mailbox( - '{imap.gmail.com:993/imap/ssl}INBOX', // IMAP server and mailbox folder - 'some@gmail.com', // Username for the before configured mailbox - '*********', // Password for the before configured username - __DIR__, // Directory, where attachments will be saved (optional) - 'US-ASCII' // Server encoding (optional) - ); - - try { - $mail_ids = $mailbox->searchMailbox('UNSEEN'); - } catch (ConnectionException $ex) { - exit('IMAP connection failed: '.$ex->getErrors('first')); - } catch (Exception $ex) { - exit('An error occured: '.$ex->getMessage()); - } - - foreach ($mail_ids as $mail_id) { - echo "+------ P A R S I N G ------+\n"; - - $email = $mailbox->getMail( - $mail_id, // ID of the email, you want to get - false // Do NOT mark emails as seen (optional) - ); - - echo 'from-name: '.(string) ($email->fromName ?? $email->fromAddress)."\n"; - echo 'from-email: '.(string) $email->fromAddress."\n"; - echo 'to: '.(string) $email->toString."\n"; - echo 'subject: '.(string) $email->subject."\n"; - echo 'message_id: '.(string) $email->messageId."\n"; - - echo 'mail has attachments? '; - if ($email->hasAttachments()) { - echo "Yes\n"; - } else { - echo "No\n"; - } - - if (!empty($email->getAttachments())) { - echo \count($email->getAttachments())." attachements\n"; - } - if ($email->textHtml) { - echo "Message HTML:\n".$email->textHtml; - } else { - echo "Message Plain:\n".$email->textPlain; - } - - if (!empty($email->autoSubmitted)) { - // Mark email as "read" / "seen" - $mailbox->markMailAsRead($mail_id); - echo "+------ IGNORING: Auto-Reply ------+\n"; - } - - if (!empty($email_content->precedence)) { - // Mark email as "read" / "seen" - $mailbox->markMailAsRead($mail_id); - echo "+------ IGNORING: Non-Delivery Report/Receipt ------+\n"; - } - } - - $mailbox->disconnect(); diff --git a/vendor/php-imap/php-imap/examples/get_and_parse_unseen_emails_save_attachments_one_by_one.php b/vendor/php-imap/php-imap/examples/get_and_parse_unseen_emails_save_attachments_one_by_one.php deleted file mode 100644 index 54a4899..0000000 --- a/vendor/php-imap/php-imap/examples/get_and_parse_unseen_emails_save_attachments_one_by_one.php +++ /dev/null @@ -1,92 +0,0 @@ - - */ - declare(strict_types=1); - - require_once __DIR__.'/../vendor/autoload.php'; - - use PhpImap\Exceptions\ConnectionException; - use PhpImap\Mailbox; - - $mailbox = new Mailbox( - '{imap.gmail.com:993/imap/ssl}INBOX', // IMAP server and mailbox folder - 'some@gmail.com', // Username for the before configured mailbox - '*********' // Password for the before configured username - ); - - try { - $mail_ids = $mailbox->searchMailbox('UNSEEN'); - } catch (ConnectionException $ex) { - exit('IMAP connection failed: '.$ex->getMessage()); - } catch (Exception $ex) { - exit('An error occured: '.$ex->getMessage()); - } - - foreach ($mail_ids as $mail_id) { - echo "+------ P A R S I N G ------+\n"; - - $email = $mailbox->getMail( - $mail_id, // ID of the email, you want to get - false // Do NOT mark emails as seen (optional) - ); - - echo 'from-name: '.(string) ($email->fromName ?? $email->fromAddress)."\n"; - echo 'from-email: '.(string) $email->fromAddress."\n"; - echo 'to: '.(string) $email->toString."\n"; - echo 'subject: '.(string) $email->subject."\n"; - echo 'message_id: '.(string) $email->messageId."\n"; - - echo 'mail has attachments? '; - if ($email->hasAttachments()) { - echo "Yes\n"; - } else { - echo "No\n"; - } - - if (!empty($email->getAttachments())) { - echo \count($email->getAttachments())." attachements\n"; - } - - // Save attachments one by one - if (!$mailbox->getAttachmentsIgnore()) { - $attachments = $email->getAttachments(); - - foreach ($attachments as $attachment) { - echo '--> Saving '.(string) $attachment->name.'...'; - - // Set individually filePath for each single attachment - // In this case, every file will get the current Unix timestamp - $attachment->setFilePath(__DIR__.'/files/'.\time()); - - if ($attachment->saveToDisk()) { - echo "OK, saved!\n"; - } else { - echo "ERROR, could not save!\n"; - } - } - } - - if ($email->textHtml) { - echo "Message HTML:\n".$email->textHtml; - } else { - echo "Message Plain:\n".$email->textPlain; - } - - if (!empty($email->autoSubmitted)) { - // Mark email as "read" / "seen" - $mailbox->markMailAsRead($mail_id); - echo "+------ IGNORING: Auto-Reply ------+\n"; - } - - if (!empty($email_content->precedence)) { - // Mark email as "read" / "seen" - $mailbox->markMailAsRead($mail_id); - echo "+------ IGNORING: Non-Delivery Report/Receipt ------+\n"; - } - } - - $mailbox->disconnect(); diff --git a/vendor/php-imap/php-imap/phpunit.xml b/vendor/php-imap/php-imap/phpunit.xml deleted file mode 100644 index 6e985a5..0000000 --- a/vendor/php-imap/php-imap/phpunit.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - src - - - - - tests - - - diff --git a/vendor/php-imap/php-imap/psalm.baseline.xml b/vendor/php-imap/php-imap/psalm.baseline.xml deleted file mode 100644 index 12cc8fb..0000000 --- a/vendor/php-imap/php-imap/psalm.baseline.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - $mailbox - - - - - \is_int($section) - !\is_string($section) && !\is_int($section) - \is_resource($maybe) - - - - - \in_array($imapSearchOption, $supported_options, true) - \in_array($key, $supported_params, true) - - - $element->charset - $element->text - $element->text - - - setConnectionRetry - setConnectionRetryDelay - setExpungeOnDisconnect - renameMailbox - getListingFolders - searchMailboxFrom - searchMailboxFromDisableServerEncoding - searchMailboxMergeResults - searchMailboxMergeResultsDisableServerEncoding - saveMail - moveMail - copyMail - markMailAsUnread - markMailAsImportant - markMailsAsRead - markMailsAsUnread - markMailsAsImportant - getMailboxHeaders - getMailboxInfo - getQuotaLimit - getQuotaUsage - getSubscribedMailboxes - subscribeMailbox - unsubscribeMailbox - - - - - self::ANYTHING - - - diff --git a/vendor/php-imap/php-imap/psalm.xml b/vendor/php-imap/php-imap/psalm.xml deleted file mode 100644 index dc5084c..0000000 --- a/vendor/php-imap/php-imap/psalm.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/vendor/php-imap/php-imap/src/PhpImap/DataPartInfo.php b/vendor/php-imap/php-imap/src/PhpImap/DataPartInfo.php deleted file mode 100644 index 6884101..0000000 --- a/vendor/php-imap/php-imap/src/PhpImap/DataPartInfo.php +++ /dev/null @@ -1,126 +0,0 @@ -mail = $mail; - $this->id = $id; - $this->part = $part; - $this->encoding = $encoding; - $this->options = $options; - } - - public function fetch(): string - { - if (0 === $this->part) { - $this->data = Imap::body($this->mail->getImapStream(), $this->id, $this->options); - } else { - if (null !== $this->data) { - return $this->data; - } - $this->data = Imap::fetchbody($this->mail->getImapStream(), $this->id, $this->part, $this->options); - } - - return $this->decodeAfterFetch($this->data); - } - - public function decodeAfterFetch(string $data): string - { - switch ($this->encoding) { - case ENC8BIT: - $this->data = \imap_utf8((string) $data); - break; - case ENCBINARY: - $this->data = \imap_binary((string) $data); - break; - case ENCBASE64: - $this->data = \base64_decode((string) $data, false); - break; - case ENCQUOTEDPRINTABLE: - $this->data = \quoted_printable_decode((string) $data); - break; - } - - return $this->convertEncodingAfterFetch(); - } - - protected function convertEncodingAfterFetch(): string - { - if (isset($this->charset) && !empty(\trim($this->charset))) { - $this->data = $this->mail->decodeMimeStr( - (string) $this->data // Data to convert - ); - - $this->data = $this->mail->convertToUtf8( - $this->data, - $this->charset - ); - } - - return (null === $this->data) ? '' : $this->data; - } -} diff --git a/vendor/php-imap/php-imap/src/PhpImap/Exceptions/ConnectionException.php b/vendor/php-imap/php-imap/src/PhpImap/Exceptions/ConnectionException.php deleted file mode 100644 index fb64497..0000000 --- a/vendor/php-imap/php-imap/src/PhpImap/Exceptions/ConnectionException.php +++ /dev/null @@ -1,42 +0,0 @@ -getMessage(); - - switch (strtolower($select)) { - case 'all': - return json_decode($message); - break; - default: - case 'first': - $message = json_decode($message); - - return $message[0]; - break; - case 'last': - $message = json_decode($message); - - return $message[\count($message) - 1]; - break; - } - } -} diff --git a/vendor/php-imap/php-imap/src/PhpImap/Exceptions/InvalidParameterException.php b/vendor/php-imap/php-imap/src/PhpImap/Exceptions/InvalidParameterException.php deleted file mode 100644 index f91e302..0000000 --- a/vendor/php-imap/php-imap/src/PhpImap/Exceptions/InvalidParameterException.php +++ /dev/null @@ -1,16 +0,0 @@ -, - * type:int, - * subtype:string - * } - */ -final class Imap -{ - /** @psalm-var list */ - public const SORT_CRITERIA = [ - SORTARRIVAL, - SORTCC, - SORTDATE, - SORTFROM, - SORTSIZE, - SORTSUBJECT, - SORTTO, - ]; - - /** @psalm-var list */ - public const TIMEOUT_TYPES = [ - IMAP_CLOSETIMEOUT, - IMAP_OPENTIMEOUT, - IMAP_READTIMEOUT, - IMAP_WRITETIMEOUT, - ]; - - /** @psalm-var list */ - public const CLOSE_FLAGS = [ - 0, - CL_EXPUNGE, - ]; - - /** - * @param resource|false $imap_stream - * - * @return true - * - * @see imap_append() - */ - public static function append( - $imap_stream, - string $mailbox, - string $message, - string $options = null, - string $internal_date = null - ): bool { - \imap_errors(); // flush errors - - $imap_stream = self::EnsureConnection($imap_stream, __METHOD__, 1); - - if (null !== $options && null !== $internal_date) { - $result = \imap_append( - $imap_stream, - $mailbox, - $message, - $options, - $internal_date - ); - } elseif (null !== $options) { - $result = \imap_append($imap_stream, $mailbox, $message, $options); - } else { - $result = \imap_append($imap_stream, $mailbox, $message); - } - - if (false === $result) { - throw new UnexpectedValueException('Could not append message to mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_append')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - */ - public static function body( - $imap_stream, - int $msg_number, - int $options = 0 - ): string { - \imap_errors(); // flush errors - - $result = \imap_body( - self::EnsureConnection($imap_stream, __METHOD__, 1), - $msg_number, - $options - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not fetch message body from mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_body')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - */ - public static function check($imap_stream): object - { - \imap_errors(); // flush errors - - $result = \imap_check(self::EnsureConnection($imap_stream, __METHOD__, 1)); - - if (false === $result) { - throw new UnexpectedValueException('Could not check imap mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_check')); - } - - /** @var object */ - return $result; - } - - /** - * @param false|resource $imap_stream - * @param int|string $sequence - * - * @return true - */ - public static function clearflag_full( - $imap_stream, - $sequence, - string $flag, - int $options = 0 - ): bool { - \imap_errors(); // flush errors - - $result = \imap_clearflag_full( - self::EnsureConnection($imap_stream, __METHOD__, 1), - self::encodeStringToUtf7Imap(static::EnsureRange( - $sequence, - __METHOD__, - 2, - true - )), - self::encodeStringToUtf7Imap($flag), - $options - ); - - if (!$result) { - throw new UnexpectedValueException('Could not clear flag on messages!', 0, self::HandleErrors(\imap_errors(), 'imap_clearflag_full')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * - * @psalm-param value-of $flag - * - * @return true - */ - public static function close($imap_stream, int $flag = 0): bool - { - \imap_errors(); // flush errors - - /** @var int */ - $flag = $flag; - - $result = \imap_close(self::EnsureConnection($imap_stream, __METHOD__, 1), $flag); - - if (false === $result) { - $message = 'Could not close imap connection'; - - if (CL_EXPUNGE === ($flag & CL_EXPUNGE)) { - $message .= ', messages may not have been expunged'; - } - - $message .= '!'; - throw new UnexpectedValueException($message, 0, self::HandleErrors(\imap_errors(), 'imap_close')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * - * @return true - */ - public static function createmailbox($imap_stream, string $mailbox): bool - { - \imap_errors(); // flush errors - - $result = \imap_createmailbox( - self::EnsureConnection($imap_stream, __METHOD__, 1), - static::encodeStringToUtf7Imap($mailbox) - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not create mailbox!', 0, self::HandleErrors(\imap_errors(), 'createmailbox')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * @param string|int $msg_number - * - * @return true - */ - public static function delete( - $imap_stream, - $msg_number, - int $options = 0 - ): bool { - /** - * @var int - * - * @todo remove docblock pending resolution of https://github.com/vimeo/psalm/issues/2620 - */ - $msg_number = self::encodeStringToUtf7Imap(self::EnsureRange( - $msg_number, - __METHOD__, - 1 - )); - - \imap_errors(); // flush errors - - $result = \imap_delete( - self::EnsureConnection($imap_stream, __METHOD__, 1), - $msg_number, - $options - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not delete message from mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_delete')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * - * @return true - */ - public static function deletemailbox($imap_stream, string $mailbox): bool - { - \imap_errors(); // flush errors - - $result = \imap_deletemailbox( - self::EnsureConnection($imap_stream, __METHOD__, 1), - static::encodeStringToUtf7Imap($mailbox) - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not delete mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_deletemailbox')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * - * @return true - */ - public static function expunge($imap_stream): bool - { - \imap_errors(); // flush errors - - $result = \imap_expunge( - self::EnsureConnection($imap_stream, __METHOD__, 1) - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not expunge messages from mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_expunge')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * @param int|string $sequence - * - * @return object[] - * - * @psalm-return list - */ - public static function fetch_overview( - $imap_stream, - $sequence, - int $options = 0 - ): array { - \imap_errors(); // flush errors - - $result = \imap_fetch_overview( - self::EnsureConnection($imap_stream, __METHOD__, 1), - self::encodeStringToUtf7Imap(self::EnsureRange( - $sequence, - __METHOD__, - 1, - true - )), - $options - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not fetch overview for message from mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_fetch_overview')); - } - - /** @psalm-var list */ - return $result; - } - - /** - * @param false|resource $imap_stream - * @param string|int $section - */ - public static function fetchbody( - $imap_stream, - int $msg_number, - $section, - int $options = 0 - ): string { - if (!\is_string($section) && !\is_int($section)) { - throw new InvalidArgumentException('Argument 3 passed to '.__METHOD__.'() must be a string or integer, '.\gettype($section).' given!'); - } - - \imap_errors(); // flush errors - - $result = \imap_fetchbody( - self::EnsureConnection($imap_stream, __METHOD__, 1), - $msg_number, - self::encodeStringToUtf7Imap((string) $section), - $options - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not fetch message body from mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_fetchbody')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - */ - public static function fetchheader( - $imap_stream, - int $msg_number, - int $options = 0 - ): string { - \imap_errors(); // flush errors - - $result = \imap_fetchheader( - self::EnsureConnection($imap_stream, __METHOD__, 1), - $msg_number, - $options - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not fetch message header from mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_fetchheader')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * - * @psalm-return PARTSTRUCTURE - */ - public static function fetchstructure( - $imap_stream, - int $msg_number, - int $options = 0 - ): object { - \imap_errors(); // flush errors - - $result = \imap_fetchstructure( - self::EnsureConnection($imap_stream, __METHOD__, 1), - $msg_number, - $options - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not fetch message structure from mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_fetchstructure')); - } - - /** @psalm-var PARTSTRUCTURE */ - return $result; - } - - /** - * @param false|resource $imap_stream - * - * @todo add return array shape pending resolution of https://github.com/vimeo/psalm/issues/2620 - */ - public static function get_quotaroot( - $imap_stream, - string $quota_root - ): array { - \imap_errors(); // flush errors - - $result = \imap_get_quotaroot( - self::EnsureConnection($imap_stream, __METHOD__, 1), - self::encodeStringToUtf7Imap($quota_root) - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not quota for mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_get_quotaroot')); - } - - return $result; - } - - /** - * @param resource|false $imap_stream - * - * @return object[] - * - * @psalm-return list - */ - public static function getmailboxes( - $imap_stream, - string $ref, - string $pattern - ): array { - \imap_errors(); // flush errors - - $result = \imap_getmailboxes( - self::EnsureConnection($imap_stream, __METHOD__, 1), - $ref, - $pattern - ); - - if (false === $result) { - $errors = \imap_errors(); - - if (false === $errors) { - /* - * if there were no errors then there were no mailboxes, - * rather than a failure to get mailboxes. - */ - return []; - } - - throw new UnexpectedValueException('Call to imap_getmailboxes() with supplied arguments returned false, not array!', 0, self::HandleErrors(\imap_errors(), 'imap_getmailboxes')); - } - - /** @psalm-var list */ - return $result; - } - - /** - * @param resource|false $imap_stream - * - * @return object[] - * - * @psalm-return list - */ - public static function getsubscribed( - $imap_stream, - string $ref, - string $pattern - ): array { - \imap_errors(); // flush errors - - $result = \imap_getsubscribed( - self::EnsureConnection($imap_stream, __METHOD__, 1), - $ref, - $pattern - ); - - if (false === $result) { - throw new UnexpectedValueException('Call to imap_getsubscribed() with supplied arguments returned false, not array!', 0, self::HandleErrors(\imap_errors(), 'imap_getsubscribed')); - } - - /** @psalm-var list */ - return $result; - } - - /** - * @param false|resource $imap_stream - */ - public static function headers($imap_stream): array - { - \imap_errors(); // flush errors - - $result = \imap_headers( - self::EnsureConnection($imap_stream, __METHOD__, 1) - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not fetch headers from mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_headers')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * - * @return string[] - * - * @psalm-return list - */ - public static function listOfMailboxes($imap_stream, string $ref, string $pattern): array - { - \imap_errors(); // flush errors - - $result = \imap_list( - self::EnsureConnection($imap_stream, __METHOD__, 1), - static::encodeStringToUtf7Imap($ref), - static::encodeStringToUtf7Imap($pattern) - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not list folders mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_list')); - } - - return \array_values(\array_map( - static function (string $folder): string { - return static::decodeStringFromUtf7ImapToUtf8($folder); - }, - $result - )); - } - - /** - * @param mixed[] An associative array of headers fields - * @param mixed[] An indexed array of bodies - * - * @psalm-param array{ - * subject?:string - * } $envelope An associative array of headers fields (docblock is not complete) - * @psalm-param list $body An indexed array of bodies (docblock is not complete) - * - * @todo flesh out array shape pending resolution of https://github.com/vimeo/psalm/issues/1518 - * - * @psalm-pure - */ - public static function mail_compose(array $envelope, array $body): string - { - return \imap_mail_compose($envelope, $body); - } - - /** - * @param false|resource $imap_stream - * @param int|string $msglist - * - * @return true - */ - public static function mail_copy( - $imap_stream, - $msglist, - string $mailbox, - int $options = 0 - ): bool { - \imap_errors(); // flush errors - - $result = \imap_mail_copy( - self::EnsureConnection($imap_stream, __METHOD__, 1), - static::encodeStringToUtf7Imap(self::EnsureRange( - $msglist, - __METHOD__, - 2, - true - )), - static::encodeStringToUtf7Imap($mailbox), - $options - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not copy messages!', 0, self::HandleErrors(\imap_errors(), 'imap_mail_copy')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * @param int|string $msglist - * - * @return true - */ - public static function mail_move( - $imap_stream, - $msglist, - string $mailbox, - int $options = 0 - ): bool { - \imap_errors(); // flush errors - - $result = \imap_mail_move( - self::EnsureConnection($imap_stream, __METHOD__, 1), - static::encodeStringToUtf7Imap(self::EnsureRange( - $msglist, - __METHOD__, - 2, - true - )), - static::encodeStringToUtf7Imap($mailbox), - $options - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not move messages!', 0, self::HandleErrors(\imap_errors(), 'imap_mail_move')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - */ - public static function mailboxmsginfo($imap_stream): stdClass - { - \imap_errors(); // flush errors - - $result = \imap_mailboxmsginfo( - self::EnsureConnection($imap_stream, __METHOD__, 1) - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not fetch mailboxmsginfo from mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_mailboxmsginfo')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - */ - public static function num_msg($imap_stream): int - { - \imap_errors(); // flush errors - - $result = \imap_num_msg(self::EnsureConnection($imap_stream, __METHOD__, 1)); - - if (false === $result) { - throw new UnexpectedValueException('Could not get the number of messages in the mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_num_msg')); - } - - return $result; - } - - /** - * @psalm-param array{DISABLE_AUTHENTICATOR:string}|array $params - * - * @return resource - */ - public static function open( - string $mailbox, - string $username, - string $password, - int $options = 0, - int $n_retries = 0, - array $params = [] - ) { - if (\preg_match("/^\{.*\}(.*)$/", $mailbox, $matches)) { - $mailbox_name = $matches[1] ?? ''; - - if (!\mb_detect_encoding($mailbox_name, 'ASCII', true)) { - $mailbox = static::encodeStringToUtf7Imap($mailbox); - } - } - - \imap_errors(); // flush errors - - $result = @\imap_open($mailbox, $username, $password, $options, $n_retries, $params); - - if (!$result) { - throw new ConnectionException(\imap_errors()); - } - - return $result; - } - - /** - * @param resource|false $imap_stream - * - * @psalm-pure - */ - public static function ping($imap_stream): bool - { - return (\is_resource($imap_stream) || $imap_stream instanceof \IMAP\Connection) && \imap_ping($imap_stream); - } - - /** - * @param false|resource $imap_stream - * - * @return true - */ - public static function renamemailbox( - $imap_stream, - string $old_mbox, - string $new_mbox - ): bool { - $imap_stream = self::EnsureConnection($imap_stream, __METHOD__, 1); - - $old_mbox = static::encodeStringToUtf7Imap($old_mbox); - $new_mbox = static::encodeStringToUtf7Imap($new_mbox); - - \imap_errors(); // flush errors - - $result = \imap_renamemailbox($imap_stream, $old_mbox, $new_mbox); - - if (!$result) { - throw new UnexpectedValueException('Could not rename mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_renamemailbox')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * - * @return true - */ - public static function reopen( - $imap_stream, - string $mailbox, - int $options = 0, - int $n_retries = 0 - ): bool { - $imap_stream = self::EnsureConnection($imap_stream, __METHOD__, 1); - - $mailbox = static::encodeStringToUtf7Imap($mailbox); - - \imap_errors(); // flush errors - - $result = \imap_reopen($imap_stream, $mailbox, $options, $n_retries); - - if (!$result) { - throw new UnexpectedValueException('Could not reopen mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_reopen')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * @param string|false|resource $file - * - * @return true - */ - public static function savebody( - $imap_stream, - $file, - int $msg_number, - string $part_number = '', - int $options = 0 - ): bool { - $imap_stream = self::EnsureConnection($imap_stream, __METHOD__, 1); - $file = \is_string($file) ? $file : self::EnsureResource($file, __METHOD__, 2); - $part_number = self::encodeStringToUtf7Imap($part_number); - - \imap_errors(); // flush errors - - $result = \imap_savebody($imap_stream, $file, $msg_number, $part_number, $options); - - if (!$result) { - throw new UnexpectedValueException('Could not reopen mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_savebody')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * - * @return int[] - * - * @psalm-return list - */ - public static function search( - $imap_stream, - string $criteria, - int $options = SE_FREE, - string $charset = null, - bool $encodeCriteriaAsUtf7Imap = false - ): array { - \imap_errors(); // flush errors - - $imap_stream = static::EnsureConnection($imap_stream, __METHOD__, 1); - - if ($encodeCriteriaAsUtf7Imap) { - $criteria = static::encodeStringToUtf7Imap($criteria); - } - - if (\is_string($charset)) { - $result = \imap_search( - $imap_stream, - $criteria, - $options, - static::encodeStringToUtf7Imap($charset) - ); - } else { - $result = \imap_search($imap_stream, $criteria, $options); - } - - if (!$result) { - $errors = \imap_errors(); - - if (false === $errors) { - /* - * if there were no errors then there were no matches, - * rather than a failure to parse criteria. - */ - return []; - } - - throw new UnexpectedValueException('Could not search mailbox!', 0, self::HandleErrors($errors, 'imap_search')); - } - - /** @psalm-var list */ - return $result; - } - - /** - * @param false|resource $imap_stream - * @param int|string $sequence - * - * @return true - */ - public static function setflag_full( - $imap_stream, - $sequence, - string $flag, - int $options = NIL - ): bool { - \imap_errors(); // flush errors - - $result = \imap_setflag_full( - self::EnsureConnection($imap_stream, __METHOD__, 1), - self::encodeStringToUtf7Imap(static::EnsureRange( - $sequence, - __METHOD__, - 2, - true - )), - self::encodeStringToUtf7Imap($flag), - $options - ); - - if (!$result) { - throw new UnexpectedValueException('Could not set flag on messages!', 0, self::HandleErrors(\imap_errors(), 'imap_setflag_full')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - * - * @psalm-param value-of $criteria - * @psalm-suppress InvalidArgument - * - * @todo InvalidArgument, although it's correct: Argument 3 of imap_sort expects int, bool provided https://www.php.net/manual/de/function.imap-sort.php - * - * @return int[] - * - * @psalm-return list - */ - public static function sort( - $imap_stream, - int $criteria, - bool $reverse, - int $options, - string $search_criteria = null, - string $charset = null - ): array { - \imap_errors(); // flush errors - - $imap_stream = self::EnsureConnection($imap_stream, __METHOD__, 1); - - /** @var int */ - $criteria = $criteria; - - if (PHP_MAJOR_VERSION < 8) { - /** @var int */ - $reverse = (int) $reverse; - } else { - /** @var bool */ - $reverse = $reverse; - } - - if (null !== $search_criteria && null !== $charset) { - $result = \imap_sort( - $imap_stream, - $criteria, - $reverse, - $options, - self::encodeStringToUtf7Imap($search_criteria), - self::encodeStringToUtf7Imap($charset) - ); - } elseif (null !== $search_criteria) { - $result = \imap_sort( - $imap_stream, - $criteria, - $reverse, - $options, - self::encodeStringToUtf7Imap($search_criteria) - ); - } else { - $result = \imap_sort( - $imap_stream, - $criteria, - $reverse, - $options - ); - } - - if (false === $result) { - throw new UnexpectedValueException('Could not sort messages!', 0, self::HandleErrors(\imap_errors(), 'imap_sort')); - } - - /** @psalm-var list */ - return $result; - } - - /** - * @param false|resource $imap_stream - * - * @psalm-param SA_MESSAGES|SA_RECENT|SA_UNSEEN|SA_UIDNEXT|SA_UIDVALIDITY|SA_ALL $flags - */ - public static function status($imap_stream, string $mailbox, int $options): stdClass - { - $imap_stream = self::EnsureConnection($imap_stream, __METHOD__, 1); - - $mailbox = static::encodeStringToUtf7Imap($mailbox); - - \imap_errors(); // flush errors - - $result = \imap_status($imap_stream, $mailbox, $options); - - if (!$result) { - throw new UnexpectedValueException('Could not get status of mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_status')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - */ - public static function subscribe($imap_stream, string $mailbox): void - { - $imap_stream = self::EnsureConnection($imap_stream, __METHOD__, 1); - - $mailbox = static::encodeStringToUtf7Imap($mailbox); - - \imap_errors(); // flush errors - - $result = \imap_subscribe($imap_stream, $mailbox); - - if (false === $result) { - throw new UnexpectedValueException('Could not subscribe to mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_subscribe')); - } - } - - /** - * @psalm-param value-of $timeout_type - * - * @return true|int - */ - public static function timeout( - int $timeout_type, - int $timeout = -1 - ) { - \imap_errors(); // flush errors - - /** @var int */ - $timeout_type = $timeout_type; - - $result = \imap_timeout( - $timeout_type, - $timeout - ); - - if (false === $result) { - throw new UnexpectedValueException('Could not get/set connection timeout!', 0, self::HandleErrors(\imap_errors(), 'imap_timeout')); - } - - return $result; - } - - /** - * @param false|resource $imap_stream - */ - public static function unsubscribe( - $imap_stream, - string $mailbox - ): void { - $imap_stream = self::EnsureConnection($imap_stream, __METHOD__, 1); - - $mailbox = static::encodeStringToUtf7Imap($mailbox); - - \imap_errors(); // flush errors - - $result = \imap_unsubscribe($imap_stream, $mailbox); - - if (false === $result) { - throw new UnexpectedValueException('Could not unsubscribe from mailbox!', 0, self::HandleErrors(\imap_errors(), 'imap_unsubscribe')); - } - } - - /** - * Returns the provided string in UTF7-IMAP encoded format. - * - * @return string $str UTF-7 encoded string - * - * @psalm-pure - */ - public static function encodeStringToUtf7Imap(string $str): string - { - $out = \mb_convert_encoding($str, 'UTF7-IMAP', \mb_detect_encoding($str, 'UTF-8, ISO-8859-1, ISO-8859-15', true)); - - if (!\is_string($out)) { - throw new UnexpectedValueException('mb_convert_encoding($str, \'UTF-8\', {detected}) could not convert $str'); - } - - return $out; - } - - /** - * Returns the provided string in UTF-8 encoded format. - * - * @return string $str, but UTF-8 encoded - * - * @psalm-pure - */ - public static function decodeStringFromUtf7ImapToUtf8(string $str): string - { - $out = \mb_convert_encoding($str, 'UTF-8', 'UTF7-IMAP'); - - if (!\is_string($out)) { - throw new UnexpectedValueException('mb_convert_encoding($str, \'UTF-8\', \'UTF7-IMAP\') could not convert $str'); - } - - return $out; - } - - /** - * @param false|resource $maybe - * - * @throws InvalidArgumentException if $maybe is not a valid resource - * - * @return resource - * - * @psalm-pure - */ - private static function EnsureResource($maybe, string $method, int $argument) - { - if (!$maybe || (!\is_resource($maybe) && !$maybe instanceof \IMAP\Connection)) { - throw new InvalidArgumentException('Argument '.(string) $argument.' passed to '.$method.' must be a valid resource!'); - } - - /** @var resource */ - return $maybe; - } - - /** - * @param false|resource $maybe - * - * @throws Exceptions\ConnectionException if $maybe is not a valid resource - * - * @return resource - */ - private static function EnsureConnection($maybe, string $method, int $argument) - { - try { - return self::EnsureResource($maybe, $method, $argument); - } catch (Throwable $e) { - throw new Exceptions\ConnectionException('Argument '.(string) $argument.' passed to '.$method.' must be valid resource!', 0, $e); - } - } - - /** - * @param array|false $errors - * - * @psalm-pure - */ - private static function HandleErrors($errors, string $method): UnexpectedValueException - { - if ($errors) { - return new UnexpectedValueException('IMAP method '.$method.'() failed with error: '.\implode('. ', $errors)); - } - - return new UnexpectedValueException('IMAP method '.$method.'() failed!'); - } - - /** - * @param scalar $msg_number - * - * @psalm-pure - */ - private static function EnsureRange( - $msg_number, - string $method, - int $argument, - bool $allow_sequence = false - ): string { - if (!\is_int($msg_number) && !\is_string($msg_number)) { - throw new InvalidArgumentException('Argument 1 passed to '.__METHOD__.'() must be an integer or a string!'); - } - - $regex = '/^\d+:\d+$/'; - $suffix = '() did not appear to be a valid message id range!'; - - if ($allow_sequence) { - $regex = '/^\d+(?:(?:,\d+)+|:\d+)$/'; - $suffix = '() did not appear to be a valid message id range or sequence!'; - } - - if (\is_int($msg_number) || \preg_match('/^\d+$/', $msg_number)) { - return \sprintf('%1$s:%1$s', $msg_number); - } elseif (1 !== \preg_match($regex, $msg_number)) { - throw new InvalidArgumentException('Argument '.(string) $argument.' passed to '.$method.$suffix); - } - - return $msg_number; - } -} diff --git a/vendor/php-imap/php-imap/src/PhpImap/IncomingMail.php b/vendor/php-imap/php-imap/src/PhpImap/IncomingMail.php deleted file mode 100644 index d955261..0000000 --- a/vendor/php-imap/php-imap/src/PhpImap/IncomingMail.php +++ /dev/null @@ -1,247 +0,0 @@ -, 1:list} - */ - protected $dataInfo = [[], []]; - - /** @var string|null */ - private $textPlain; - - /** @var string|null */ - private $textHtml; - - /** - * __get() is utilized for reading data from inaccessible (protected - * or private) or non-existing properties. - * - * @param string $name Name of the property (eg. textPlain) - * - * @return string Value of the property (eg. Plain text message) - */ - public function __get(string $name): string - { - $type = false; - if ('textPlain' == $name) { - $type = DataPartInfo::TEXT_PLAIN; - } - if ('textHtml' == $name) { - $type = DataPartInfo::TEXT_HTML; - } - if (('textPlain' === $name || 'textHtml' === $name) && isset($this->$name)) { - return (string) $this->$name; - } - if (false === $type) { - \trigger_error("Undefined property: IncomingMail::$name"); - } - if (!isset($this->$name)) { - $this->$name = ''; - } - foreach ($this->dataInfo[$type] as $data) { - $this->$name .= \trim($data->fetch()); - } - - /** @var string */ - return $this->$name; - } - - /** - * The method __isset() is triggered by calling isset() or empty() - * on inaccessible (protected or private) or non-existing properties. - * - * @param string $name Name of the property (eg. textPlain) - * - * @return bool True, if property is set or empty - */ - public function __isset(string $name): bool - { - self::__get($name); - - return isset($this->$name); - } - - public function setHeader(IncomingMailHeader $header): void - { - /** @psalm-var array */ - $array = \get_object_vars($header); - foreach ($array as $property => $value) { - $this->$property = $value; - } - } - - /** - * @param DataPartInfo::TEXT_PLAIN|DataPartInfo::TEXT_HTML $type - */ - public function addDataPartInfo(DataPartInfo $dataInfo, int $type): void - { - $this->dataInfo[$type][] = $dataInfo; - } - - public function addAttachment(IncomingMailAttachment $attachment): void - { - if (!\is_string($attachment->id)) { - throw new InvalidArgumentException('Argument 1 passed to '.__METHOD__.'() does not have an id specified!'); - } - $this->attachments[$attachment->id] = $attachment; - - $this->setHasAttachments(true); - } - - /** - * Sets property $hasAttachments. - * - * @param bool $hasAttachments True, if IncomingMail[] has one or more attachments - */ - public function setHasAttachments(bool $hasAttachments): void - { - $this->hasAttachments = $hasAttachments; - } - - /** - * Returns, if the mail has attachments or not. - * - * @return bool true or false - */ - public function hasAttachments(): bool - { - return $this->hasAttachments; - } - - /** - * @return IncomingMailAttachment[] - */ - public function getAttachments(): array - { - return $this->attachments; - } - - /** - * @param string $id The attachment id - */ - public function removeAttachment(string $id): bool - { - if (!isset($this->attachments[$id])) { - return false; - } - - unset($this->attachments[$id]); - - $this->setHasAttachments([] !== $this->attachments); - - return true; - } - - /** - * Get array of internal HTML links placeholders. - * - * @return array attachmentId => link placeholder - * - * @psalm-return array - */ - public function getInternalLinksPlaceholders(): array - { - $fetchedHtml = $this->__get('textHtml'); - - $match = \preg_match_all('/=["\'](ci?d:([\w\.%*@-]+))["\']/i', $fetchedHtml, $matches); - - /** @psalm-var array{1:list, 2:list} */ - $matches = $matches; - - return $match ? \array_combine($matches[2], $matches[1]) : []; - } - - public function replaceInternalLinks(string $baseUri): string - { - $baseUri = \rtrim($baseUri, '\\/').'/'; - $fetchedHtml = $this->textHtml; - $search = []; - $replace = []; - foreach ($this->getInternalLinksPlaceholders() as $attachmentId => $placeholder) { - foreach ($this->attachments as $attachment) { - if ($attachment->contentId == $attachmentId) { - if (!\is_string($attachment->id)) { - throw new InvalidArgumentException('Argument 1 passed to '.__METHOD__.'() does not have an id specified!'); - } - $search[] = $placeholder; - $replace[] = $baseUri.\basename($this->attachments[$attachment->id]->filePath); - } - } - } - - /** @psalm-var string */ - return \str_replace($search, $replace, $fetchedHtml); - } - - /** - * Embed inline image attachments as base64 to allow for - * email html to display inline images automatically. - */ - public function embedImageAttachments(): void - { - $fetchedHtml = $this->__get('textHtml'); - - \preg_match_all("/\bcid:[^'\"\s]{1,256}/mi", $fetchedHtml, $matches); - - if (isset($matches[0]) && \is_array($matches[0]) && \count($matches[0])) { - /** @var list */ - $matches = $matches[0]; - $attachments = $this->getAttachments(); - foreach ($matches as $match) { - $cid = \str_replace('cid:', '', $match); - - foreach ($attachments as $attachment) { - /** - * Inline images can contain a "Content-Disposition: inline", but only a "Content-ID" is also enough. - * See https://github.com/barbushin/php-imap/issues/569. - */ - if ($attachment->contentId == $cid || 'inline' == \mb_strtolower((string) $attachment->disposition)) { - $contents = $attachment->getContents(); - $contentType = $attachment->getFileInfo(FILEINFO_MIME_TYPE); - - if (!\strstr($contentType, 'image')) { - continue; - } elseif (!\is_string($attachment->id)) { - throw new InvalidArgumentException('Argument 1 passed to '.__METHOD__.'() does not have an id specified!'); - } - - $base64encoded = \base64_encode($contents); - $replacement = 'data:'.$contentType.';base64, '.$base64encoded; - - $this->textHtml = \str_replace($match, $replacement, $this->textHtml); - - $this->removeAttachment($attachment->id); - } - } - } - } - } -} diff --git a/vendor/php-imap/php-imap/src/PhpImap/IncomingMailAttachment.php b/vendor/php-imap/php-imap/src/PhpImap/IncomingMailAttachment.php deleted file mode 100644 index 2e29ce8..0000000 --- a/vendor/php-imap/php-imap/src/PhpImap/IncomingMailAttachment.php +++ /dev/null @@ -1,169 +0,0 @@ -file_path)) { - return false; - } - - $this->filePath = $this->file_path; - - if (@\file_exists($this->file_path)) { - return $this->filePath; - } - - return $this->filePath; - } - - /** - * Sets the file path. - * - * @param string $filePath File path incl. file name and optional extension - */ - public function setFilePath(string $filePath): void - { - $this->file_path = $filePath; - } - - /** - * Sets the data part info. - * - * @param DataPartInfo $dataInfo Date info (file content) - */ - public function addDataPartInfo(DataPartInfo $dataInfo): void - { - $this->dataInfo = $dataInfo; - } - - /** - * Gets information about a file. - * - * @param int $fileinfo_const Any predefined constant. See https://www.php.net/manual/en/fileinfo.constants.php - * - * @psalm-param fileinfoconst $fileinfo_const - */ - public function getFileInfo(int $fileinfo_const = FILEINFO_NONE): string - { - $finfo = new finfo($fileinfo_const); - - return $finfo->buffer($this->getContents()); - } - - /** - * Gets the file content. - */ - public function getContents(): string - { - if (null === $this->dataInfo) { - throw new UnexpectedValueException(static::class.'::$dataInfo has not been set by calling '.self::class.'::addDataPartInfo()'); - } - - return $this->dataInfo->fetch(); - } - - /** - * Saves the attachment object on the disk. - * - * @return bool True, if it could save the attachment on the disk - */ - public function saveToDisk(): bool - { - if (null === $this->dataInfo) { - return false; - } - - if (false === \file_put_contents($this->__get('filePath'), $this->dataInfo->fetch())) { - unset($this->filePath, $this->file_path); - - return false; - } - - return true; - } -} diff --git a/vendor/php-imap/php-imap/src/PhpImap/IncomingMailHeader.php b/vendor/php-imap/php-imap/src/PhpImap/IncomingMailHeader.php deleted file mode 100644 index 908c4f3..0000000 --- a/vendor/php-imap/php-imap/src/PhpImap/IncomingMailHeader.php +++ /dev/null @@ -1,149 +0,0 @@ - - */ - public $to = []; - - /** @var string|null */ - public $toString; - - /** - * @var (string|null)[] - * - * @psalm-var array - */ - public $cc = []; - - /** @var string|null */ - public $ccString; - - /** - * @var (string|null)[] - * - * @psalm-var array - */ - public $bcc = []; - - /** - * @var (string|null)[] - * - * @psalm-var array - */ - public $replyTo = []; - - /** @var string|null */ - public $messageId; -} diff --git a/vendor/php-imap/php-imap/src/PhpImap/Mailbox.php b/vendor/php-imap/php-imap/src/PhpImap/Mailbox.php deleted file mode 100644 index 4edc8df..0000000 --- a/vendor/php-imap/php-imap/src/PhpImap/Mailbox.php +++ /dev/null @@ -1,2069 +0,0 @@ -, - * type:int, - * subtype:string - * } - * @psalm-type HOSTNAMEANDADDRESS_ENTRY = object{host?:string, personal?:string, mailbox:string} - * @psalm-type HOSTNAMEANDADDRESS = array{0:HOSTNAMEANDADDRESS_ENTRY, 1?:HOSTNAMEANDADDRESS_ENTRY} - * @psalm-type COMPOSE_ENVELOPE = array{ - * subject?:string - * } - * @psalm-type COMPOSE_BODY = list - * - * @todo see @todo of Imap::mail_compose() - */ -class Mailbox -{ - public const EXPECTED_SIZE_OF_MESSAGE_AS_ARRAY = 2; - - public const MAX_LENGTH_FILEPATH = 255; - - public const PART_TYPE_TWO = 2; - - public const IMAP_OPTIONS_SUPPORTED_VALUES = - OP_READONLY // 2 - | OP_ANONYMOUS // 4 - | OP_HALFOPEN // 64 - | CL_EXPUNGE // 32768 - | OP_DEBUG // 1 - | OP_SHORTCACHE // 8 - | OP_SILENT // 16 - | OP_PROTOTYPE // 32 - | OP_SECURE // 256 - ; - - /** @var string */ - public $decodeMimeStrDefaultCharset = 'default'; - - /** @var string */ - protected $imapPath; - - /** @var string */ - protected $imapLogin; - - /** @var string */ - protected $imapPassword; - - /** @var int */ - protected $imapSearchOption = SE_UID; - - /** @var int */ - protected $connectionRetry = 0; - - /** @var int */ - protected $connectionRetryDelay = 100; - - /** @var int */ - protected $imapOptions = 0; - - /** @var int */ - protected $imapRetriesNum = 0; - - /** @psalm-var array{DISABLE_AUTHENTICATOR?:string} */ - protected $imapParams = []; - - /** @var string */ - protected $serverEncoding = 'UTF-8'; - - /** @var string|null */ - protected $attachmentsDir = null; - - /** @var bool */ - protected $expungeOnDisconnect = true; - - /** - * @var int[] - * - * @psalm-var array{1?:int, 2?:int, 3?:int, 4?:int} - */ - protected $timeouts = []; - - /** @var bool */ - protected $attachmentsIgnore = false; - - /** @var string */ - protected $pathDelimiter = '.'; - - /** @var string */ - protected $mailboxFolder; - - /** @var bool|false */ - protected $attachmentFilenameMode = false; - - /** @var resource|null */ - private $imapStream; - - /** - * @throws InvalidParameterException - */ - public function __construct(string $imapPath, string $login, string $password, string $attachmentsDir = null, string $serverEncoding = 'UTF-8', bool $trimImapPath = true, bool $attachmentFilenameMode = false) - { - $this->imapPath = (true == $trimImapPath) ? \trim($imapPath) : $imapPath; - $this->imapLogin = \trim($login); - $this->imapPassword = $password; - $this->setServerEncoding($serverEncoding); - if (null != $attachmentsDir) { - $this->setAttachmentsDir($attachmentsDir); - } - $this->setAttachmentFilenameMode($attachmentFilenameMode); - - $this->setMailboxFolder(); - } - - /** - * Disconnects from the IMAP server / mailbox. - */ - public function __destruct() - { - $this->disconnect(); - } - - /** - * Sets / Changes the path delimiter character (Supported values: '.', '/'). - * - * @param string $delimiter Path delimiter - * - * @throws InvalidParameterException - */ - public function setPathDelimiter(string $delimiter): void - { - if (!$this->validatePathDelimiter($delimiter)) { - throw new InvalidParameterException('setPathDelimiter() can only set the delimiter to these characters: ".", "/"'); - } - - $this->pathDelimiter = $delimiter; - } - - /** - * Returns the current set path delimiter character. - * - * @return string Path delimiter - */ - public function getPathDelimiter(): string - { - return $this->pathDelimiter; - } - - /** - * Validates the given path delimiter character. - * - * @param string $delimiter Path delimiter - * - * @return bool true (supported) or false (unsupported) - * - * @psalm-pure - */ - public function validatePathDelimiter(string $delimiter): bool - { - $supported_delimiters = ['.', '/']; - - if (!\in_array($delimiter, $supported_delimiters)) { - return false; - } - - return true; - } - - /** - * Returns the current set server encoding. - * - * @return string Server encoding (eg. 'UTF-8') - */ - public function getServerEncoding(): string - { - return $this->serverEncoding; - } - - /** - * Sets / Changes the server encoding. - * - * @param string $serverEncoding Server encoding (eg. 'UTF-8') - * - * @throws InvalidParameterException - */ - public function setServerEncoding(string $serverEncoding): void - { - $serverEncoding = \strtoupper(\trim($serverEncoding)); - - $supported_encodings = \array_map('strtoupper', \mb_list_encodings()); - - if (!\in_array($serverEncoding, $supported_encodings) && 'US-ASCII' != $serverEncoding) { - throw new InvalidParameterException('"'.$serverEncoding.'" is not supported by setServerEncoding(). Your system only supports these encodings: US-ASCII, '.\implode(', ', $supported_encodings)); - } - - $this->serverEncoding = $serverEncoding; - } - - /** - * Returns the current set attachment filename mode. - * - * @return bool Attachment filename mode (e.g. true) - */ - public function getAttachmentFilenameMode(): bool - { - return $this->attachmentFilenameMode; - } - - /** - * Sets / Changes the attachment filename mode. - * - * @param bool $attachmentFilenameMode Attachment filename mode (e.g. false) - * - * @throws InvalidParameterException - */ - public function setAttachmentFilenameMode(bool $attachmentFilenameMode): void - { - if (!\is_bool($attachmentFilenameMode)) { - throw new InvalidParameterException('"'.$attachmentFilenameMode.'" is not supported by setOriginalAttachmentFilename(). Only boolean values are allowed: true (use original filename), false (use random generated filename)'); - } - - $this->attachmentFilenameMode = $attachmentFilenameMode; - } - - /** - * Returns the current set IMAP search option. - * - * @return int IMAP search option (eg. 'SE_UID') - */ - public function getImapSearchOption(): int - { - return $this->imapSearchOption; - } - - /** - * Sets / Changes the IMAP search option. - * - * @param int $imapSearchOption IMAP search option (eg. 'SE_UID') - * - * @psalm-param 1|2 $imapSearchOption - * - * @throws InvalidParameterException - */ - public function setImapSearchOption(int $imapSearchOption): void - { - $supported_options = [SE_FREE, SE_UID]; - - if (!\in_array($imapSearchOption, $supported_options, true)) { - throw new InvalidParameterException('"'.$imapSearchOption.'" is not supported by setImapSearchOption(). Supported options are SE_FREE and SE_UID.'); - } - - $this->imapSearchOption = $imapSearchOption; - } - - /** - * Set $this->attachmentsIgnore param. Allow to ignore attachments when they are not required and boost performance. - */ - public function setAttachmentsIgnore(bool $attachmentsIgnore): void - { - $this->attachmentsIgnore = $attachmentsIgnore; - } - - /** - * Get $this->attachmentsIgnore param. - * - * @return bool $attachmentsIgnore - */ - public function getAttachmentsIgnore(): bool - { - return $this->attachmentsIgnore; - } - - /** - * Sets the timeout of all or one specific type. - * - * @param int $timeout Timeout in seconds - * @param array $types One of the following: IMAP_OPENTIMEOUT, IMAP_READTIMEOUT, IMAP_WRITETIMEOUT, IMAP_CLOSETIMEOUT - * - * @psalm-param list<1|2|3|4> $types - * - * @throws InvalidParameterException - */ - public function setTimeouts(int $timeout, array $types = [IMAP_OPENTIMEOUT, IMAP_READTIMEOUT, IMAP_WRITETIMEOUT, IMAP_CLOSETIMEOUT]): void - { - $supported_types = [IMAP_OPENTIMEOUT, IMAP_READTIMEOUT, IMAP_WRITETIMEOUT, IMAP_CLOSETIMEOUT]; - - $found_types = \array_intersect($types, $supported_types); - - if (\count($types) != \count($found_types)) { - throw new InvalidParameterException('You have provided at least one unsupported timeout type. Supported types are: IMAP_OPENTIMEOUT, IMAP_READTIMEOUT, IMAP_WRITETIMEOUT, IMAP_CLOSETIMEOUT'); - } - - /** @var array{1?:int, 2?:int, 3?:int, 4?:int} */ - $this->timeouts = \array_fill_keys($types, $timeout); - } - - /** - * Returns the IMAP login (usually an email address). - * - * @return string IMAP login - */ - public function getLogin(): string - { - return $this->imapLogin; - } - - /** - * Set custom connection arguments of imap_open method. See http://php.net/imap_open. - * - * @param string[]|null $params - * - * @psalm-param array{DISABLE_AUTHENTICATOR?:string}|array|null $params - * - * @throws InvalidParameterException - */ - public function setConnectionArgs(int $options = 0, int $retriesNum = 0, array $params = null): void - { - if (0 !== $options) { - if (($options & self::IMAP_OPTIONS_SUPPORTED_VALUES) !== $options) { - throw new InvalidParameterException('Please check your option for setConnectionArgs()! Unsupported option "'.$options.'". Available options: https://www.php.net/manual/de/function.imap-open.php'); - } - $this->imapOptions = $options; - } - - if (0 != $retriesNum) { - if ($retriesNum < 0) { - throw new InvalidParameterException('Invalid number of retries provided for setConnectionArgs()! It must be a positive integer. (eg. 1 or 3)'); - } - $this->imapRetriesNum = $retriesNum; - } - - if (\is_array($params) && \count($params) > 0) { - $supported_params = ['DISABLE_AUTHENTICATOR']; - - foreach (\array_keys($params) as $key) { - if (!\in_array($key, $supported_params, true)) { - throw new InvalidParameterException('Invalid array key of params provided for setConnectionArgs()! Only DISABLE_AUTHENTICATOR is currently valid.'); - } - } - - $this->imapParams = $params; - } - } - - /** - * Set custom folder for attachments in case you want to have tree of folders for each email - * i.e. a/1 b/1 c/1 where a,b,c - senders, i.e. john@smith.com. - * - * @param string $attachmentsDir Folder where to save attachments - * - * @throws InvalidParameterException - */ - public function setAttachmentsDir(string $attachmentsDir): void - { - if (empty(\trim($attachmentsDir))) { - throw new InvalidParameterException('setAttachmentsDir() expects a string as first parameter!'); - } - if (!\is_dir($attachmentsDir)) { - throw new InvalidParameterException('Directory "'.$attachmentsDir.'" not found'); - } - $this->attachmentsDir = \rtrim(\realpath($attachmentsDir), '\\/'); - } - - /** - * Get current saving folder for attachments. - * - * @return string|null Attachments dir - */ - public function getAttachmentsDir(): ?string - { - return $this->attachmentsDir; - } - - /** - * Sets / Changes the attempts / retries to connect. - */ - public function setConnectionRetry(int $maxAttempts): void - { - $this->connectionRetry = $maxAttempts; - } - - /** - * Sets / Changes the delay between each attempt / retry to connect. - */ - public function setConnectionRetryDelay(int $milliseconds): void - { - $this->connectionRetryDelay = $milliseconds; - } - - /** - * Get IMAP mailbox connection stream. - * - * @param bool $forceConnection Initialize connection if it's not initialized - * - * @return resource - */ - public function getImapStream(bool $forceConnection = true) - { - if ($forceConnection) { - $this->pingOrDisconnect(); - if (!$this->imapStream) { - $this->imapStream = $this->initImapStreamWithRetry(); - } - } - - /** @var resource */ - return $this->imapStream; - } - - public function hasImapStream(): bool - { - return (\is_resource($this->imapStream) || $this->imapStream instanceof \IMAP\Connection) && \imap_ping($this->imapStream); - } - - /** - * Returns the provided string in UTF7-IMAP encoded format. - * - * @return string $str UTF-7 encoded string - * - * @psalm-pure - */ - public function encodeStringToUtf7Imap(string $str): string - { - return imap_utf7_encode($str); - } - - /** - * Returns the provided string in UTF-8 encoded format. - * - * @return string $str UTF-7 encoded string or same as before, when it's no string - * - * @psalm-pure - */ - public function decodeStringFromUtf7ImapToUtf8(string $str): string - { - $out = imap_utf7_decode($str); - - if (!\is_string($out)) { - throw new UnexpectedValueException('mb_convert_encoding($str, \'UTF-8\', \'UTF7-IMAP\') could not convert $str'); - } - - return $out; - } - - /** - * Sets the folder of the current mailbox. - */ - public function setMailboxFolder(): void - { - $imapPathParts = \explode('}', $this->imapPath); - $this->mailboxFolder = (!empty($imapPathParts[1])) ? $imapPathParts[1] : 'INBOX'; - } - - /** - * Switch mailbox without opening a new connection. - * - * @throws Exception - */ - public function switchMailbox(string $imapPath, bool $absolute = true): void - { - if (\strpos($imapPath, '}') > 0) { - $this->imapPath = $imapPath; - } else { - $this->imapPath = $this->getCombinedPath($imapPath, $absolute); - } - - $this->setMailboxFolder(); - - Imap::reopen($this->getImapStream(), $this->imapPath); - } - - /** - * Disconnects from IMAP server / mailbox. - */ - public function disconnect(): void - { - if ($this->hasImapStream()) { - Imap::close($this->getImapStream(false), $this->expungeOnDisconnect ? CL_EXPUNGE : 0); - } - } - - /** - * Sets 'expunge on disconnect' parameter. - */ - public function setExpungeOnDisconnect(bool $isEnabled): void - { - $this->expungeOnDisconnect = $isEnabled; - } - - /** - * Get information about the current mailbox. - * - * Returns the information in an object with following properties: - * Date - current system time formatted according to RFC2822 - * Driver - protocol used to access this mailbox: POP3, IMAP, NNTP - * Mailbox - the mailbox name - * Nmsgs - number of mails in the mailbox - * Recent - number of recent mails in the mailbox - * - * @see imap_check - */ - public function checkMailbox(): object - { - return Imap::check($this->getImapStream()); - } - - /** - * Creates a new mailbox. - * - * @param string $name Name of new mailbox (eg. 'PhpImap') - * - * @see imap_createmailbox() - */ - public function createMailbox(string $name): void - { - Imap::createmailbox($this->getImapStream(), $this->getCombinedPath($name)); - } - - /** - * Deletes a specific mailbox. - * - * @param string $name Name of mailbox, which you want to delete (eg. 'PhpImap') - * - * @see imap_deletemailbox() - */ - public function deleteMailbox(string $name, bool $absolute = false): bool - { - return Imap::deletemailbox($this->getImapStream(), $this->getCombinedPath($name, $absolute)); - } - - /** - * Rename an existing mailbox from $oldName to $newName. - * - * @param string $oldName Current name of mailbox, which you want to rename (eg. 'PhpImap') - * @param string $newName New name of mailbox, to which you want to rename it (eg. 'PhpImapTests') - */ - public function renameMailbox(string $oldName, string $newName): void - { - Imap::renamemailbox($this->getImapStream(), $this->getCombinedPath($oldName), $this->getCombinedPath($newName)); - } - - /** - * Gets status information about the given mailbox. - * - * This function returns an object containing status information. - * The object has the following properties: messages, recent, unseen, uidnext, and uidvalidity. - */ - public function statusMailbox(?string $mailbox = null): stdClass - { - return Imap::status($this->getImapStream(), $mailbox ?: $this->imapPath, SA_ALL); - } - - /** - * Gets listing the folders. - * - * This function returns an object containing listing the folders. - * The object has the following properties: messages, recent, unseen, uidnext, and uidvalidity. - * - * @return string[] listing the folders - * - * @psalm-return list - */ - public function getListingFolders(string $pattern = '*'): array - { - return Imap::listOfMailboxes($this->getImapStream(), $this->imapPath, $pattern); - } - - /** - * This function uses imap_search() to perform a search on the mailbox currently opened in the given IMAP stream. - * For example, to match all unanswered mails sent by Mom, you'd use: "UNANSWERED FROM mom". - * - * @param string $criteria See http://php.net/imap_search for a complete list of available criteria - * @param bool $disableServerEncoding Disables server encoding while searching for mails (can be useful on Exchange servers) - * - * @return int[] mailsIds (or empty array) - * - * @psalm-return list - */ - public function searchMailbox(string $criteria = 'ALL', bool $disableServerEncoding = false): array - { - if ($disableServerEncoding) { - /** @psalm-var list */ - return Imap::search($this->getImapStream(), $criteria, $this->imapSearchOption); - } - - /** @psalm-var list */ - return Imap::search($this->getImapStream(), $criteria, $this->imapSearchOption, $this->getServerEncoding()); - } - - /** - * Search the mailbox for emails from multiple, specific senders. - * - * @see Mailbox::searchMailboxFromWithOrWithoutDisablingServerEncoding() - * - * @return int[] - * - * @psalm-return list - */ - public function searchMailboxFrom(string $criteria, string $sender, string ...$senders): array - { - return $this->searchMailboxFromWithOrWithoutDisablingServerEncoding($criteria, false, $sender, ...$senders); - } - - /** - * Search the mailbox for emails from multiple, specific senders whilst not using server encoding. - * - * @see Mailbox::searchMailboxFromWithOrWithoutDisablingServerEncoding() - * - * @return int[] - * - * @psalm-return list - */ - public function searchMailboxFromDisableServerEncoding(string $criteria, string $sender, string ...$senders): array - { - return $this->searchMailboxFromWithOrWithoutDisablingServerEncoding($criteria, true, $sender, ...$senders); - } - - /** - * Search the mailbox using multiple criteria merging the results. - * - * @param string $single_criteria - * @param string ...$criteria - * - * @return int[] - * - * @psalm-return list - */ - public function searchMailboxMergeResults($single_criteria, ...$criteria) - { - return $this->searchMailboxMergeResultsWithOrWithoutDisablingServerEncoding(false, $single_criteria, ...$criteria); - } - - /** - * Search the mailbox using multiple criteria merging the results. - * - * @param string $single_criteria - * @param string ...$criteria - * - * @return int[] - * - * @psalm-return list - */ - public function searchMailboxMergeResultsDisableServerEncoding($single_criteria, ...$criteria) - { - return $this->searchMailboxMergeResultsWithOrWithoutDisablingServerEncoding(false, $single_criteria, ...$criteria); - } - - /** - * Save a specific body section to a file. - * - * @param int $mailId message number - * - * @see imap_savebody() - */ - public function saveMail(int $mailId, string $filename = 'email.eml'): void - { - Imap::savebody($this->getImapStream(), $filename, $mailId, '', (SE_UID === $this->imapSearchOption) ? FT_UID : 0); - } - - /** - * Marks mails listed in mailId for deletion. - * - * @param int $mailId message number - * - * @see imap_delete() - */ - public function deleteMail(int $mailId): void - { - Imap::delete($this->getImapStream(), $mailId, (SE_UID === $this->imapSearchOption) ? FT_UID : 0); - } - - /** - * Moves mails listed in mailId into new mailbox. - * - * @param string|int $mailId a range or message number - * @param string $mailBox Mailbox name - * - * @see imap_mail_move() - */ - public function moveMail($mailId, string $mailBox): void - { - Imap::mail_move($this->getImapStream(), $mailId, $mailBox, CP_UID); - $this->expungeDeletedMails(); - } - - /** - * Copies mails listed in mailId into new mailbox. - * - * @param string|int $mailId a range or message number - * @param string $mailBox Mailbox name - * - * @see imap_mail_copy() - */ - public function copyMail($mailId, string $mailBox): void - { - Imap::mail_copy($this->getImapStream(), $mailId, $mailBox, CP_UID); - $this->expungeDeletedMails(); - } - - /** - * Deletes all the mails marked for deletion by imap_delete(), imap_mail_move(), or imap_setflag_full(). - * - * @see imap_expunge() - */ - public function expungeDeletedMails(): void - { - Imap::expunge($this->getImapStream()); - } - - /** - * Add the flag \Seen to a mail. - */ - public function markMailAsRead(int $mailId): void - { - $this->setFlag([$mailId], '\\Seen'); - } - - /** - * Remove the flag \Seen from a mail. - */ - public function markMailAsUnread(int $mailId): void - { - $this->clearFlag([$mailId], '\\Seen'); - } - - /** - * Add the flag \Flagged to a mail. - */ - public function markMailAsImportant(int $mailId): void - { - $this->setFlag([$mailId], '\\Flagged'); - } - - /** - * Add the flag \Seen to a mails. - * - * @param int[] $mailId - * - * @psalm-param list $mailId - */ - public function markMailsAsRead(array $mailId): void - { - $this->setFlag($mailId, '\\Seen'); - } - - /** - * Remove the flag \Seen from some mails. - * - * @param int[] $mailId - * - * @psalm-param list $mailId - */ - public function markMailsAsUnread(array $mailId): void - { - $this->clearFlag($mailId, '\\Seen'); - } - - /** - * Add the flag \Flagged to some mails. - * - * @param int[] $mailId - * - * @psalm-param list $mailId - */ - public function markMailsAsImportant(array $mailId): void - { - $this->setFlag($mailId, '\\Flagged'); - } - - /** - * Check, if the specified flag for the mail is set or not. - * - * @param int $mailId A single mail ID - * @param string $flag Which you can get are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060 - * - * @return bool True, when the flag is set, false when not - * - * @psalm-param int $mailId - */ - public function flagIsSet(int $mailId, string $flag): bool - { - $flag = str_replace('\\', '', strtolower($flag)); - - $overview = Imap::fetch_overview($this->getImapStream(), $mailId, ST_UID); - - if ($overview[0]->$flag == 1) { - return true; - } - - return false; - } - - /** - * Causes a store to add the specified flag to the flags set for the mails in the specified sequence. - * - * @param array $mailsIds Array of mail IDs - * @param string $flag Which you can set are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060 - * - * @psalm-param list $mailsIds - */ - public function setFlag(array $mailsIds, string $flag): void - { - Imap::setflag_full($this->getImapStream(), \implode(',', $mailsIds), $flag, ST_UID); - } - - /** - * Causes a store to delete the specified flag to the flags set for the mails in the specified sequence. - * - * @param array $mailsIds Array of mail IDs - * @param string $flag Which you can delete are \Seen, \Answered, \Flagged, \Deleted, and \Draft as defined by RFC2060 - */ - public function clearFlag(array $mailsIds, string $flag): void - { - Imap::clearflag_full($this->getImapStream(), \implode(',', $mailsIds), $flag, ST_UID); - } - - /** - * Fetch mail headers for listed mails ids. - * - * Returns an array of objects describing one mail header each. The object will only define a property if it exists. The possible properties are: - * subject - the mails subject - * from - who sent it - * sender - who sent it - * to - recipient - * date - when was it sent - * message_id - Mail-ID - * references - is a reference to this mail id - * in_reply_to - is a reply to this mail id - * size - size in bytes - * uid - UID the mail has in the mailbox - * msgno - mail sequence number in the mailbox - * recent - this mail is flagged as recent - * flagged - this mail is flagged - * answered - this mail is flagged as answered - * deleted - this mail is flagged for deletion - * seen - this mail is flagged as already read - * draft - this mail is flagged as being a draft - * - * @return array $mailsIds Array of mail IDs - * - * @psalm-return list - * - * @todo adjust types & conditionals pending resolution of https://github.com/vimeo/psalm/issues/2619 - */ - public function getMailsInfo(array $mailsIds): array - { - $mails = Imap::fetch_overview( - $this->getImapStream(), - \implode(',', $mailsIds), - (SE_UID === $this->imapSearchOption) ? FT_UID : 0 - ); - if (\count($mails)) { - foreach ($mails as $index => &$mail) { - if (isset($mail->subject) && !\is_string($mail->subject)) { - throw new UnexpectedValueException('subject property at index '.(string) $index.' of argument 1 passed to '.__METHOD__.'() was not a string!'); - } - if (isset($mail->from) && !\is_string($mail->from)) { - throw new UnexpectedValueException('from property at index '.(string) $index.' of argument 1 passed to '.__METHOD__.'() was not a string!'); - } - if (isset($mail->sender) && !\is_string($mail->sender)) { - throw new UnexpectedValueException('sender property at index '.(string) $index.' of argument 1 passed to '.__METHOD__.'() was not a string!'); - } - if (isset($mail->to) && !\is_string($mail->to)) { - throw new UnexpectedValueException('to property at index '.(string) $index.' of argument 1 passed to '.__METHOD__.'() was not a string!'); - } - - if (isset($mail->subject) && !empty(\trim($mail->subject))) { - $mail->subject = $this->decodeMimeStr($mail->subject); - } - if (isset($mail->from) && !empty(\trim($mail->from))) { - $mail->from = $this->decodeMimeStr($mail->from); - } - if (isset($mail->sender) && !empty(\trim($mail->sender))) { - $mail->sender = $this->decodeMimeStr($mail->sender); - } - if (isset($mail->to) && !empty(\trim($mail->to))) { - $mail->to = $this->decodeMimeStr($mail->to); - } - } - } - - /** @var list */ - return $mails; - } - - /** - * Get headers for all messages in the defined mailbox, - * returns an array of string formatted with header info, - * one element per mail message. - * - * @see imap_headers() - */ - public function getMailboxHeaders(): array - { - return Imap::headers($this->getImapStream()); - } - - /** - * Get information about the current mailbox. - * - * Returns an object with following properties: - * Date - last change (current datetime) - * Driver - driver - * Mailbox - name of the mailbox - * Nmsgs - number of messages - * Recent - number of recent messages - * Unread - number of unread messages - * Deleted - number of deleted messages - * Size - mailbox size - * - * @return stdClass Object with info - * - * @see mailboxmsginfo - */ - public function getMailboxInfo(): stdClass - { - return Imap::mailboxmsginfo($this->getImapStream()); - } - - /** - * Gets mails ids sorted by some criteria. - * - * Criteria can be one (and only one) of the following constants: - * SORTDATE - mail Date - * SORTARRIVAL - arrival date (default) - * SORTFROM - mailbox in first From address - * SORTSUBJECT - mail subject - * SORTTO - mailbox in first To address - * SORTCC - mailbox in first cc address - * SORTSIZE - size of mail in octets - * - * @param int $criteria Sorting criteria (eg. SORTARRIVAL) - * @param bool $reverse Sort reverse or not - * @param string|null $searchCriteria See http://php.net/imap_search for a complete list of available criteria - * - * @psalm-param value-of $criteria - * - * @return int[] Mails ids - * - * @psalm-return list - */ - public function sortMails( - int $criteria = SORTARRIVAL, - bool $reverse = true, - ?string $searchCriteria = 'ALL', - string $charset = null - ): array { - return Imap::sort( - $this->getImapStream(), - $criteria, - $reverse, - $this->imapSearchOption, - $searchCriteria, - $charset - ); - } - - /** - * Get mails count in mail box. - * - * @see imap_num_msg() - */ - public function countMails(): int - { - return Imap::num_msg($this->getImapStream()); - } - - /** - * Return quota limit in KB. - * - * @param string $quota_root Should normally be in the form of which mailbox (i.e. INBOX) - */ - public function getQuotaLimit(string $quota_root = 'INBOX'): int - { - $quota = $this->getQuota($quota_root); - - /** @var int */ - return $quota['STORAGE']['limit'] ?? 0; - } - - /** - * Return quota usage in KB. - * - * @param string $quota_root Should normally be in the form of which mailbox (i.e. INBOX) - * - * @return int|false FALSE in the case of call failure - */ - public function getQuotaUsage(string $quota_root = 'INBOX') - { - $quota = $this->getQuota($quota_root); - - /** @var int|false */ - return $quota['STORAGE']['usage'] ?? 0; - } - - /** - * Get raw mail data. - * - * @param int $msgId ID of the message - * @param bool $markAsSeen Mark the email as seen, when set to true - * - * @return string Message of the fetched body - */ - public function getRawMail(int $msgId, bool $markAsSeen = true): string - { - $options = (SE_UID == $this->imapSearchOption) ? FT_UID : 0; - if (!$markAsSeen) { - $options |= FT_PEEK; - } - - return Imap::fetchbody($this->getImapStream(), $msgId, '', $options); - } - - /** - * Get mail header field value. - * - * @param string $headersRaw RAW headers as single string - * @param string $header_field_name Name of the required header field - * - * @return string Value of the header field - */ - public function getMailHeaderFieldValue(string $headersRaw, string $header_field_name): string - { - $header_field_value = ''; - - if (\preg_match("/$header_field_name\:(.*)/i", $headersRaw, $matches)) { - if (isset($matches[1])) { - return \trim($matches[1]); - } - } - - return $header_field_value; - } - - /** - * Get mail header. - * - * @param int $mailId ID of the message - * - * @throws Exception - * - * @todo update type checking pending resolution of https://github.com/vimeo/psalm/issues/2619 - */ - public function getMailHeader(int $mailId): IncomingMailHeader - { - $headersRaw = Imap::fetchheader( - $this->getImapStream(), - $mailId, - (SE_UID === $this->imapSearchOption) ? FT_UID : 0 - ); - - /** @var object{ - * date?:scalar, - * Date?:scalar, - * subject?:scalar, - * from?:HOSTNAMEANDADDRESS, - * to?:HOSTNAMEANDADDRESS, - * cc?:HOSTNAMEANDADDRESS, - * bcc?:HOSTNAMEANDADDRESS, - * reply_to?:HOSTNAMEANDADDRESS, - * sender?:HOSTNAMEANDADDRESS - * } - */ - $head = \imap_rfc822_parse_headers($headersRaw); - - if (isset($head->date) && !\is_string($head->date)) { - throw new UnexpectedValueException('date property of parsed headers corresponding to argument 1 passed to '.__METHOD__.'() was present but not a string!'); - } - if (isset($head->Date) && !\is_string($head->Date)) { - throw new UnexpectedValueException('Date property of parsed headers corresponding to argument 1 passed to '.__METHOD__.'() was present but not a string!'); - } - if (isset($head->subject) && !\is_string($head->subject)) { - throw new UnexpectedValueException('subject property of parsed headers corresponding to argument 1 passed to '.__METHOD__.'() was present but not a string!'); - } - if (isset($head->from) && !\is_array($head->from)) { - throw new UnexpectedValueException('from property of parsed headers corresponding to argument 1 passed to '.__METHOD__.'() was present but not an array!'); - } - if (isset($head->sender) && !\is_array($head->sender)) { - throw new UnexpectedValueException('sender property of parsed headers corresponding to argument 1 passed to '.__METHOD__.'() was present but not an array!'); - } - if (isset($head->to) && !\is_array($head->to)) { - throw new UnexpectedValueException('to property of parsed headers corresponding to argument 1 passed to '.__METHOD__.'() was present but not an array!'); - } - if (isset($head->cc) && !\is_array($head->cc)) { - throw new UnexpectedValueException('cc property of parsed headers corresponding to argument 1 passed to '.__METHOD__.'() was present but not an array!'); - } - if (isset($head->bcc) && !\is_array($head->bcc)) { - throw new UnexpectedValueException('bcc property of parsed headers corresponding to argument 1 passed to '.__METHOD__.'() was present but not an array!'); - } - if (isset($head->reply_to) && !\is_array($head->reply_to)) { - throw new UnexpectedValueException('reply_to property of parsed headers corresponding to argument 1 passed to '.__METHOD__.'() was present but not an array!'); - } - - $header = new IncomingMailHeader(); - $header->headersRaw = $headersRaw; - $header->headers = $head; - $header->id = $mailId; - $header->imapPath = $this->imapPath; - $header->mailboxFolder = $this->mailboxFolder; - $header->isSeen = ($this->flagIsSet($mailId, '\Seen')) ? true : false; - $header->isAnswered = ($this->flagIsSet($mailId, '\Answered')) ? true : false; - $header->isRecent = ($this->flagIsSet($mailId, '\Recent')) ? true : false; - $header->isFlagged = ($this->flagIsSet($mailId, '\Flagged')) ? true : false; - $header->isDeleted = ($this->flagIsSet($mailId, '\Deleted')) ? true : false; - $header->isDraft = ($this->flagIsSet($mailId, '\Draft')) ? true : false; - $header->mimeVersion = $this->getMailHeaderFieldValue($headersRaw, 'MIME-Version'); - $header->xVirusScanned = $this->getMailHeaderFieldValue($headersRaw, 'X-Virus-Scanned'); - $header->organization = $this->getMailHeaderFieldValue($headersRaw, 'Organization'); - $header->contentType = $this->getMailHeaderFieldValue($headersRaw, 'Content-Type'); - $header->xMailer = $this->getMailHeaderFieldValue($headersRaw, 'X-Mailer'); - $header->contentLanguage = $this->getMailHeaderFieldValue($headersRaw, 'Content-Language'); - $header->xSenderIp = $this->getMailHeaderFieldValue($headersRaw, 'X-Sender-IP'); - $header->priority = $this->getMailHeaderFieldValue($headersRaw, 'Priority'); - $header->importance = $this->getMailHeaderFieldValue($headersRaw, 'Importance'); - $header->sensitivity = $this->getMailHeaderFieldValue($headersRaw, 'Sensitivity'); - $header->autoSubmitted = $this->getMailHeaderFieldValue($headersRaw, 'Auto-Submitted'); - $header->precedence = $this->getMailHeaderFieldValue($headersRaw, 'Precedence'); - $header->failedRecipients = $this->getMailHeaderFieldValue($headersRaw, 'Failed-Recipients'); - $header->xOriginalTo = $this->getMailHeaderFieldValue($headersRaw, 'X-Original-To'); - - if (isset($head->date) && !empty(\trim($head->date))) { - $header->date = self::parseDateTime($head->date); - } elseif (isset($head->Date) && !empty(\trim($head->Date))) { - $header->date = self::parseDateTime($head->Date); - } else { - $now = new DateTime(); - $header->date = self::parseDateTime($now->format('Y-m-d H:i:s')); - } - - $header->subject = (isset($head->subject) && !empty(\trim($head->subject))) ? $this->decodeMimeStr($head->subject) : null; - if (isset($head->from) && !empty($head->from)) { - [$header->fromHost, $header->fromName, $header->fromAddress] = $this->possiblyGetHostNameAndAddress($head->from); - } elseif (\preg_match('/smtp.mailfrom=[-0-9a-zA-Z.+_]+@[-0-9a-zA-Z.+_]+.[a-zA-Z]{2,4}/', $headersRaw, $matches)) { - $header->fromAddress = \substr($matches[0], 14); - } - if (isset($head->sender) && !empty($head->sender)) { - [$header->senderHost, $header->senderName, $header->senderAddress] = $this->possiblyGetHostNameAndAddress($head->sender); - } - if (isset($head->to)) { - $toStrings = []; - foreach ($head->to as $to) { - $to_parsed = $this->possiblyGetEmailAndNameFromRecipient($to); - if ($to_parsed) { - [$toEmail, $toName] = $to_parsed; - $toStrings[] = $toName ? "$toName <$toEmail>" : $toEmail; - $header->to[$toEmail] = $toName; - } - } - $header->toString = \implode(', ', $toStrings); - } - - if (isset($head->cc)) { - $ccStrings = []; - foreach ($head->cc as $cc) { - $cc_parsed = $this->possiblyGetEmailAndNameFromRecipient($cc); - if ($cc_parsed) { - [$ccEmail, $ccName] = $cc_parsed; - $ccStrings[] = $ccName ? "$ccName <$ccEmail>" : $ccEmail; - $header->cc[$ccEmail] = $ccName; - } - } - $header->ccString = \implode(', ', $ccStrings); - } - - if (isset($head->bcc)) { - foreach ($head->bcc as $bcc) { - $bcc_parsed = $this->possiblyGetEmailAndNameFromRecipient($bcc); - if ($bcc_parsed) { - $header->bcc[$bcc_parsed[0]] = $bcc_parsed[1]; - } - } - } - - if (isset($head->reply_to)) { - foreach ($head->reply_to as $replyTo) { - $replyTo_parsed = $this->possiblyGetEmailAndNameFromRecipient($replyTo); - if ($replyTo_parsed) { - $header->replyTo[$replyTo_parsed[0]] = $replyTo_parsed[1]; - } - } - } - - if (isset($head->message_id)) { - if (!\is_string($head->message_id)) { - throw new UnexpectedValueException('Message ID was expected to be a string, '.\gettype($head->message_id).' found!'); - } - $header->messageId = $head->message_id; - } - - return $header; - } - - /** - * taken from https://www.electrictoolbox.com/php-imap-message-parts/. - * - * @param stdClass[] $messageParts - * @param stdClass[] $flattenedParts - * - * @psalm-param array $flattenedParts - * - * @return stdClass[] - * - * @psalm-return array - */ - public function flattenParts(array $messageParts, array $flattenedParts = [], string $prefix = '', int $index = 1, bool $fullPrefix = true): array - { - foreach ($messageParts as $part) { - $flattenedParts[$prefix.$index] = $part; - if (isset($part->parts)) { - /** @var stdClass[] */ - $part_parts = $part->parts; - - if (self::PART_TYPE_TWO == $part->type) { - $flattenedParts = $this->flattenParts($part_parts, $flattenedParts, $prefix.$index.'.', 0, false); - } elseif ($fullPrefix) { - $flattenedParts = $this->flattenParts($part_parts, $flattenedParts, $prefix.$index.'.'); - } else { - $flattenedParts = $this->flattenParts($part_parts, $flattenedParts, $prefix); - } - unset($flattenedParts[$prefix.$index]->parts); - } - ++$index; - } - - /** @var array */ - return $flattenedParts; - } - - /** - * Get mail data. - * - * @param int $mailId ID of the mail - * @param bool $markAsSeen Mark the email as seen, when set to true - */ - public function getMail(int $mailId, bool $markAsSeen = true): IncomingMail - { - $mail = new IncomingMail(); - $mail->setHeader($this->getMailHeader($mailId)); - - $mailStructure = Imap::fetchstructure( - $this->getImapStream(), - $mailId, - (SE_UID === $this->imapSearchOption) ? FT_UID : 0 - ); - - if (empty($mailStructure->parts)) { - $this->initMailPart($mail, $mailStructure, 0, $markAsSeen); - } else { - /** @var array */ - $parts = $mailStructure->parts; - foreach ($this->flattenParts($parts) as $partNum => $partStructure) { - $this->initMailPart($mail, $partStructure, $partNum, $markAsSeen); - } - } - - return $mail; - } - - /** - * Download attachment. - * - * @param array $params Array of params of mail - * @param object $partStructure Part of mail - * @param bool $emlOrigin True, if it indicates, that the attachment comes from an EML (mail) file - * - * @psalm-param array $params - * @psalm-param PARTSTRUCTURE $partStructure - * - * @return IncomingMailAttachment $attachment - */ - public function downloadAttachment(DataPartInfo $dataInfo, array $params, object $partStructure, bool $emlOrigin = false): IncomingMailAttachment - { - if ('RFC822' == $partStructure->subtype && isset($partStructure->disposition) && 'attachment' == $partStructure->disposition) { - $fileName = \strtolower($partStructure->subtype).'.eml'; - } elseif ('ALTERNATIVE' == $partStructure->subtype) { - $fileName = \strtolower($partStructure->subtype).'.eml'; - } elseif ((!isset($params['filename']) || empty(\trim($params['filename']))) && (!isset($params['name']) || empty(\trim($params['name'])))) { - $fileName = \strtolower($partStructure->subtype); - } else { - $fileName = (isset($params['filename']) && !empty(\trim($params['filename']))) ? $params['filename'] : $params['name']; - $fileName = $this->decodeMimeStr($fileName); - $fileName = $this->decodeRFC2231($fileName); - } - - /** @var scalar|array|object|null */ - $sizeInBytes = $partStructure->bytes ?? null; - - /** @var scalar|array|object|null */ - $encoding = $partStructure->encoding ?? null; - - if (null !== $sizeInBytes && !\is_int($sizeInBytes)) { - throw new UnexpectedValueException('Supplied part structure specifies a non-integer, non-null bytes header!'); - } - if (null !== $encoding && !\is_int($encoding)) { - throw new UnexpectedValueException('Supplied part structure specifies a non-integer, non-null encoding header!'); - } - if (isset($partStructure->type) && !\is_int($partStructure->type)) { - throw new UnexpectedValueException('Supplied part structure specifies a non-integer, non-null type header!'); - } - - $partStructure_id = ($partStructure->ifid && isset($partStructure->id)) ? \trim($partStructure->id) : null; - - $attachment = new IncomingMailAttachment(); - $attachment->id = \bin2hex(\random_bytes(20)); - $attachment->contentId = isset($partStructure_id) ? \trim($partStructure_id, ' <>') : null; - if (isset($partStructure->type)) { - $attachment->type = $partStructure->type; - } - $attachment->encoding = $encoding; - $attachment->subtype = ($partStructure->ifsubtype && isset($partStructure->subtype)) ? \trim($partStructure->subtype) : null; - $attachment->description = ($partStructure->ifdescription && isset($partStructure->description)) ? \trim((string) $partStructure->description) : null; - $attachment->name = $fileName; - $attachment->sizeInBytes = $sizeInBytes; - $attachment->disposition = (isset($partStructure->disposition) && \is_string($partStructure->disposition)) ? $partStructure->disposition : null; - - /** @var scalar|array|object|resource|null */ - $charset = $params['charset'] ?? null; - - if (isset($charset) && !\is_string($charset)) { - throw new InvalidArgumentException('Argument 2 passed to '.__METHOD__.'() must specify charset as a string when specified!'); - } - $attachment->charset = (isset($charset) && !empty(\trim($charset))) ? $charset : null; - $attachment->emlOrigin = $emlOrigin; - - $attachment->addDataPartInfo($dataInfo); - - $attachment->fileInfoRaw = $attachment->getFileInfo(FILEINFO_RAW); - $attachment->fileInfo = $attachment->getFileInfo(FILEINFO_NONE); - $attachment->mime = $attachment->getFileInfo(FILEINFO_MIME); - $attachment->mimeType = $attachment->getFileInfo(FILEINFO_MIME_TYPE); - $attachment->mimeEncoding = $attachment->getFileInfo(FILEINFO_MIME_ENCODING); - $attachment->fileExtension = $attachment->getFileInfo(FILEINFO_EXTENSION); - - $attachmentsDir = $this->getAttachmentsDir(); - - if (null != $attachmentsDir) { - if (true == $this->getAttachmentFilenameMode()) { - $fileSysName = $attachment->name; - } else { - $fileSysName = \bin2hex(\random_bytes(16)).'.bin'; - } - - $filePath = $attachmentsDir.DIRECTORY_SEPARATOR.$fileSysName; - - if (\strlen($filePath) > self::MAX_LENGTH_FILEPATH) { - $ext = \pathinfo($filePath, PATHINFO_EXTENSION); - $filePath = \substr($filePath, 0, self::MAX_LENGTH_FILEPATH - 1 - \strlen($ext)).'.'.$ext; - } - - $attachment->setFilePath($filePath); - $attachment->saveToDisk(); - } - - return $attachment; - } - - /** - * Converts a string to UTF-8. - * - * @param string $string MIME string to decode - * @param string $fromCharset Charset to convert from - * - * @return string Converted string if conversion was successful, or the original string if not - */ - public function convertToUtf8(string $string, string $fromCharset): string - { - $fromCharset = mb_strtolower($fromCharset); - $newString = ''; - - if ('default' === $fromCharset) { - $fromCharset = $this->decodeMimeStrDefaultCharset; - } - - switch ($fromCharset) { - case 'default': // Charset default is already ASCII (not encoded) - case 'utf-8': // Charset UTF-8 is OK - $newString .= $string; - break; - default: - // If charset exists in mb_list_encodings(), convert using mb_convert function - if (\in_array($fromCharset, $this->lowercase_mb_list_encodings(), true)) { - $newString .= \mb_convert_encoding($string, 'UTF-8', $fromCharset); - } else { - // Fallback: Try to convert with iconv() - $iconv_converted_string = @\iconv($fromCharset, 'UTF-8', $string); - if (!$iconv_converted_string) { - // If iconv() could also not convert, return string as it is - // (unknown charset) - $newString .= $string; - } else { - $newString .= $iconv_converted_string; - } - } - break; - } - - return $newString; - } - - /** - * Decodes a mime string. - * - * @param string $string MIME string to decode - * - * @return string Converted string if conversion was successful, or the original string if not - * - * @throws Exception - * - * @todo update implementation pending resolution of https://github.com/vimeo/psalm/issues/2619 & https://github.com/vimeo/psalm/issues/2620 - */ - public function decodeMimeStr(string $string): string - { - $newString = ''; - /** @var list|false */ - $elements = \imap_mime_header_decode($string); - - if (false === $elements) { - return $string; - } - - foreach ($elements as $element) { - $newString .= $this->convertToUtf8($element->text, $element->charset); - } - - return $newString; - } - - /** - * @psalm-pure - */ - public function isUrlEncoded(string $string): bool - { - $hasInvalidChars = \preg_match('#[^%a-zA-Z0-9\-_\.\+]#', $string); - $hasEscapedChars = \preg_match('#%[a-zA-Z0-9]{2}#', $string); - - return !$hasInvalidChars && $hasEscapedChars; - } - - /** - * Converts the datetime to a RFC 3339 compliant format. - * - * @param string $dateHeader Header datetime - * - * @return string RFC 3339 compliant format or original (unchanged) format, - * if conversation is not possible - * - * @psalm-pure - */ - public function parseDateTime(string $dateHeader): string - { - if (empty(\trim($dateHeader))) { - throw new InvalidParameterException('parseDateTime() expects parameter 1 to be a parsable string datetime'); - } - - $dateHeaderUnixtimestamp = \strtotime($dateHeader); - - if (!$dateHeaderUnixtimestamp) { - return $dateHeader; - } - - $dateHeaderRfc3339 = \date(DATE_RFC3339, $dateHeaderUnixtimestamp); - - if (!$dateHeaderRfc3339) { - return $dateHeader; - } - - return $dateHeaderRfc3339; - } - - /** - * Gets IMAP path. - */ - public function getImapPath(): string - { - return $this->imapPath; - } - - /** - * Get message in MBOX format. - * - * @param int $mailId message number - */ - public function getMailMboxFormat(int $mailId): string - { - $option = (SE_UID == $this->imapSearchOption) ? FT_UID : 0; - - return Imap::fetchheader($this->getImapStream(), $mailId, $option | FT_PREFETCHTEXT).Imap::body($this->getImapStream(), $mailId, $option); - } - - /** - * Get folders list. - * - * @return (false|mixed|string)[][] - * - * @psalm-return list - */ - public function getMailboxes(string $search = '*'): array - { - /** @psalm-var array */ - $mailboxes = Imap::getmailboxes($this->getImapStream(), $this->imapPath, $search); - - return $this->possiblyGetMailboxes($mailboxes); - } - - /** - * Get folders list. - * - * @return (false|mixed|string)[][] - * - * @psalm-return list - */ - public function getSubscribedMailboxes(string $search = '*'): array - { - /** @psalm-var array */ - $mailboxes = Imap::getsubscribed($this->getImapStream(), $this->imapPath, $search); - - return $this->possiblyGetMailboxes($mailboxes); - } - - /** - * Subscribe to a mailbox. - * - * @throws Exception - */ - public function subscribeMailbox(string $mailbox): void - { - Imap::subscribe( - $this->getImapStream(), - $this->getCombinedPath($mailbox) - ); - } - - /** - * Unsubscribe from a mailbox. - * - * @throws Exception - */ - public function unsubscribeMailbox(string $mailbox): void - { - Imap::unsubscribe( - $this->getImapStream(), - $this->getCombinedPath($mailbox) - ); - } - - /** - * Appends $message to $mailbox. - * - * @param string|array $message - * - * @psalm-param string|array{0:COMPOSE_ENVELOPE, 1:COMPOSE_BODY} $message - * - * @return true - * - * @see Imap::append() - */ - public function appendMessageToMailbox( - $message, - string $mailbox = '', - string $options = null, - string $internal_date = null - ): bool { - if ( - \is_array($message) && - self::EXPECTED_SIZE_OF_MESSAGE_AS_ARRAY === \count($message) && - isset($message[0], $message[1]) - ) { - $message = Imap::mail_compose($message[0], $message[1]); - } - - if (!\is_string($message)) { - throw new InvalidArgumentException('Argument 1 passed to '.__METHOD__.' must be a string or envelope/body pair.'); - } - - return Imap::append( - $this->getImapStream(), - $this->getCombinedPath($mailbox), - $message, - $options, - $internal_date - ); - } - - /** - * Returns the list of available encodings in lower case. - * - * @return string[] - * - * @psalm-return list - */ - protected function lowercase_mb_list_encodings(): array - { - $lowercase_encodings = []; - $encodings = \mb_list_encodings(); - foreach ($encodings as $encoding) { - $lowercase_encodings[] = \strtolower($encoding); - } - - return $lowercase_encodings; - } - - /** @return resource */ - protected function initImapStreamWithRetry() - { - $retry = $this->connectionRetry; - - do { - try { - return $this->initImapStream(); - } catch (ConnectionException $exception) { - } - } while (--$retry > 0 && (!$this->connectionRetryDelay || !\usleep((int) $this->connectionRetryDelay * 1000))); - - throw $exception; - } - - /** - * Retrieve the quota settings per user. - * - * @param string $quota_root Should normally be in the form of which mailbox (i.e. INBOX) - * - * @see imap_get_quotaroot() - */ - protected function getQuota(string $quota_root = 'INBOX'): array - { - return Imap::get_quotaroot($this->getImapStream(), $quota_root); - } - - /** - * Open an IMAP stream to a mailbox. - * - * @throws Exception if an error occured - * - * @return resource IMAP stream on success - */ - protected function initImapStream() - { - foreach ($this->timeouts as $type => $timeout) { - Imap::timeout($type, $timeout); - } - - $imapStream = Imap::open( - $this->imapPath, - $this->imapLogin, - $this->imapPassword, - $this->imapOptions, - $this->imapRetriesNum, - $this->imapParams - ); - - return $imapStream; - } - - /** - * @param string|0 $partNum - * - * @psalm-param PARTSTRUCTURE $partStructure - * @psalm-suppress InvalidArgument - * - * @todo refactor type checking pending resolution of https://github.com/vimeo/psalm/issues/2619 - */ - protected function initMailPart(IncomingMail $mail, object $partStructure, $partNum, bool $markAsSeen = true, bool $emlParse = false): void - { - if (!isset($mail->id)) { - throw new InvalidArgumentException('Argument 1 passeed to '.__METHOD__.'() did not have the id property set!'); - } - - $options = (SE_UID === $this->imapSearchOption) ? FT_UID : 0; - - if (!$markAsSeen) { - $options |= FT_PEEK; - } - $dataInfo = new DataPartInfo($this, $mail->id, $partNum, $partStructure->encoding, $options); - - /** @var array */ - $params = []; - if (!empty($partStructure->parameters)) { - foreach ($partStructure->parameters as $param) { - $params[\strtolower($param->attribute)] = ''; - $value = $param->value ?? null; - if (isset($value) && '' !== \trim($value)) { - $params[\strtolower($param->attribute)] = $this->decodeMimeStr($value); - } - } - } - if (!empty($partStructure->dparameters)) { - foreach ($partStructure->dparameters as $param) { - $paramName = \strtolower(\preg_match('~^(.*?)\*~', $param->attribute, $matches) ? (!isset($matches[1]) ?: $matches[1]) : $param->attribute); - if (isset($params[$paramName])) { - $params[$paramName] .= $param->value; - } else { - $params[$paramName] = $param->value; - } - } - } - - $isAttachment = isset($params['filename']) || isset($params['name']) || isset($partStructure->id); - - $dispositionAttachment = (isset($partStructure->disposition) && - \is_string($partStructure->disposition) && - 'attachment' === \mb_strtolower($partStructure->disposition)); - - // ignore contentId on body when mail isn't multipart (https://github.com/barbushin/php-imap/issues/71) - if ( - !$partNum && - TYPETEXT === $partStructure->type && - !$dispositionAttachment - ) { - $isAttachment = false; - } - - if ($isAttachment) { - $mail->setHasAttachments(true); - } - - // check if the part is a subpart of another attachment part (RFC822) - if ('RFC822' === $partStructure->subtype && isset($partStructure->disposition) && 'attachment' === $partStructure->disposition) { - // Although we are downloading each part separately, we are going to download the EML to a single file - //incase someone wants to process or parse in another process - $attachment = self::downloadAttachment($dataInfo, $params, $partStructure, false); - $mail->addAttachment($attachment); - } - - // If it comes from an EML file it is an attachment - if ($emlParse) { - $isAttachment = true; - } - - // Do NOT parse attachments, when getAttachmentsIgnore() is true - if ( - $this->getAttachmentsIgnore() - && (TYPEMULTIPART !== $partStructure->type - && (TYPETEXT !== $partStructure->type || !\in_array(\mb_strtolower($partStructure->subtype), ['plain', 'html'], true))) - ) { - return; - } - - if ($isAttachment) { - $attachment = self::downloadAttachment($dataInfo, $params, $partStructure, $emlParse); - $mail->addAttachment($attachment); - } else { - if (isset($params['charset']) && !empty(\trim($params['charset']))) { - $dataInfo->charset = $params['charset']; - } - } - - if (!empty($partStructure->parts)) { - foreach ($partStructure->parts as $subPartNum => $subPartStructure) { - $not_attachment = (!isset($partStructure->disposition) || 'attachment' !== $partStructure->disposition); - - if (TYPEMESSAGE === $partStructure->type && 'RFC822' === $partStructure->subtype && $not_attachment) { - $this->initMailPart($mail, $subPartStructure, $partNum, $markAsSeen); - } elseif (TYPEMULTIPART === $partStructure->type && 'ALTERNATIVE' === $partStructure->subtype && $not_attachment) { - // https://github.com/barbushin/php-imap/issues/198 - $this->initMailPart($mail, $subPartStructure, $partNum, $markAsSeen); - } elseif ('RFC822' === $partStructure->subtype && isset($partStructure->disposition) && 'attachment' === $partStructure->disposition) { - //If it comes from am EML attachment, download each part separately as a file - $this->initMailPart($mail, $subPartStructure, $partNum.'.'.($subPartNum + 1), $markAsSeen, true); - } else { - $this->initMailPart($mail, $subPartStructure, $partNum.'.'.($subPartNum + 1), $markAsSeen); - } - } - } else { - if (TYPETEXT === $partStructure->type) { - if ('plain' === \mb_strtolower($partStructure->subtype)) { - if ($dispositionAttachment) { - return; - } - - $mail->addDataPartInfo($dataInfo, DataPartInfo::TEXT_PLAIN); - } elseif (!$partStructure->ifdisposition) { - $mail->addDataPartInfo($dataInfo, DataPartInfo::TEXT_HTML); - } elseif (!\is_string($partStructure->disposition)) { - throw new InvalidArgumentException('disposition property of object passed as argument 2 to '.__METHOD__.'() was present but not a string!'); - } elseif (!$dispositionAttachment) { - $mail->addDataPartInfo($dataInfo, DataPartInfo::TEXT_HTML); - } - } elseif (TYPEMESSAGE === $partStructure->type) { - $mail->addDataPartInfo($dataInfo, DataPartInfo::TEXT_PLAIN); - } - } - } - - protected function decodeRFC2231(string $string): string - { - if (\preg_match("/^(.*?)'.*?'(.*?)$/", $string, $matches)) { - $data = $matches[2] ?? ''; - if ($this->isUrlEncoded($data)) { - $string = $this->decodeMimeStr(\urldecode($data)); - } - } - - return $string; - } - - /** - * Combine Subfolder or Folder to the connection. - * Have the imapPath a folder added to the connection info, then will the $folder added as subfolder. - * If the parameter $absolute TRUE, then will the connection new builded only with this folder as root element. - * - * @param string $folder Folder, the will added to the path - * @param bool $absolute Add folder as root element to the connection and remove all other from this - * - * @return string Return the new path - */ - protected function getCombinedPath(string $folder, bool $absolute = false): string - { - if (empty(\trim($folder))) { - return $this->imapPath; - } elseif ('}' === \substr($this->imapPath, -1)) { - return $this->imapPath.$folder; - } elseif (true === $absolute) { - $folder = ('/' === $folder) ? '' : $folder; - $posConnectionDefinitionEnd = \strpos($this->imapPath, '}'); - - if (false === $posConnectionDefinitionEnd) { - throw new UnexpectedValueException('"}" was not present in IMAP path!'); - } - - return \substr($this->imapPath, 0, $posConnectionDefinitionEnd + 1).$folder; - } - - return $this->imapPath.$this->getPathDelimiter().$folder; - } - - /** - * @psalm-return array{0: string, 1: null|string}|null - * - * @return (null|string)[]|null - */ - protected function possiblyGetEmailAndNameFromRecipient(object $recipient): ?array - { - if (isset($recipient->mailbox, $recipient->host)) { - /** @var string */ - $recipientMailbox = $recipient->mailbox; - /** @var string */ - $recipientHost = $recipient->host; - /** @var string|null */ - $recipientPersonal = $recipient->personal ?? null; - - if (!\is_string($recipientMailbox)) { - throw new UnexpectedValueException('mailbox was present on argument 1 passed to '.__METHOD__.'() but was not a string!'); - } elseif (!\is_string($recipientHost)) { - throw new UnexpectedValueException('host was present on argument 1 passed to '.__METHOD__.'() but was not a string!'); - } elseif (null !== $recipientPersonal && !\is_string($recipientPersonal)) { - throw new UnexpectedValueException('personal was present on argument 1 passed to '.__METHOD__.'() but was not a string!'); - } - - if ('' !== \trim($recipientMailbox) && '' !== \trim($recipientHost)) { - $recipientEmail = \strtolower($recipientMailbox.'@'.$recipientHost); - $recipientName = (\is_string($recipientPersonal) && '' !== \trim($recipientPersonal)) ? $this->decodeMimeStr($recipientPersonal) : null; - - return [ - $recipientEmail, - $recipientName, - ]; - } - } - - return null; - } - - /** - * @psalm-param array $t - * - * @todo revisit implementation pending resolution of https://github.com/vimeo/psalm/issues/2619 - * - * @return (false|mixed|string)[][] - * - * @psalm-return list - */ - protected function possiblyGetMailboxes(array $t): array - { - $arr = []; - if ($t) { - foreach ($t as $index => $item) { - if (!\is_object($item)) { - throw new UnexpectedValueException('Index '.(string) $index.' of argument 1 passed to '.__METHOD__.'() corresponds to a non-object value, '.\gettype($item).' given!'); - } - /** @var scalar|array|object|resource|null */ - $item_name = $item->name ?? null; - - if (!isset($item->name, $item->attributes, $item->delimiter)) { - throw new UnexpectedValueException('The object at index '.(string) $index.' of argument 1 passed to '.__METHOD__.'() was missing one or more of the required properties "name", "attributes", "delimiter"!'); - } elseif (!\is_string($item_name)) { - throw new UnexpectedValueException('The object at index '.(string) $index.' of argument 1 passed to '.__METHOD__.'() has a non-string value for the name property!'); - } - - // https://github.com/barbushin/php-imap/issues/339 - $name = $this->decodeStringFromUtf7ImapToUtf8($item_name); - $name_pos = \strpos($name, '}'); - if (false === $name_pos) { - throw new UnexpectedValueException('Expected token "}" not found in subscription name!'); - } - $arr[] = [ - 'fullpath' => $name, - 'attributes' => $item->attributes, - 'delimiter' => $item->delimiter, - 'shortpath' => \substr($name, $name_pos + 1), - ]; - } - } - - return $arr; - } - - /** - * @psalm-param HOSTNAMEANDADDRESS $t - * - * @psalm-return array{0:string|null, 1:string|null, 2:string} - */ - protected function possiblyGetHostNameAndAddress(array $t): array - { - $out = [ - $t[0]->host ?? (isset($t[1], $t[1]->host) ? $t[1]->host : null), - 1 => null, - ]; - foreach ([0, 1] as $index) { - $maybe = isset($t[$index], $t[$index]->personal) ? $t[$index]->personal : null; - if (\is_string($maybe) && '' !== \trim($maybe)) { - $out[1] = $this->decodeMimeStr($maybe); - - break; - } - } - - /** @var string */ - $out[] = \strtolower($t[0]->mailbox.'@'.(string) $out[0]); - - /** @var array{0:string|null, 1:string|null, 2:string} */ - return $out; - } - - /** - * @todo revisit redundant condition issues pending fix of https://github.com/vimeo/psalm/issues/2626 - */ - protected function pingOrDisconnect(): void - { - if ($this->imapStream && !Imap::ping($this->imapStream)) { - $this->disconnect(); - $this->imapStream = null; - } - } - - /** - * Search the mailbox for emails from multiple, specific senders. - * - * This function wraps Mailbox::searchMailbox() to overcome a shortcoming in ext-imap - * - * @return int[] - * - * @psalm-return list - */ - protected function searchMailboxFromWithOrWithoutDisablingServerEncoding(string $criteria, bool $disableServerEncoding, string $sender, string ...$senders): array - { - \array_unshift($senders, $sender); - - $senders = \array_values(\array_unique(\array_map( - /** - * @param string $sender - * - * @return string - */ - static function ($sender) use ($criteria): string { - return $criteria.' FROM '.\mb_strtolower($sender); - }, - $senders - ))); - - return $this->searchMailboxMergeResultsWithOrWithoutDisablingServerEncoding( - $disableServerEncoding, - ...$senders - ); - } - - /** - * Search the mailbox using different criteria, then merge the results. - * - * @param bool $disableServerEncoding - * @param string $single_criteria - * @param string ...$criteria - * - * @return int[] - * - * @psalm-return list - */ - protected function searchMailboxMergeResultsWithOrWithoutDisablingServerEncoding($disableServerEncoding, $single_criteria, ...$criteria) - { - \array_unshift($criteria, $single_criteria); - - $criteria = \array_values(\array_unique($criteria)); - - $out = []; - - foreach ($criteria as $criterion) { - $out = \array_merge($out, $this->searchMailbox($criterion, $disableServerEncoding)); - } - - /** @psalm-var list */ - return \array_values(\array_unique($out, SORT_NUMERIC)); - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/AbstractLiveMailboxTest.php b/vendor/php-imap/php-imap/tests/unit/AbstractLiveMailboxTest.php deleted file mode 100644 index f679102..0000000 --- a/vendor/php-imap/php-imap/tests/unit/AbstractLiveMailboxTest.php +++ /dev/null @@ -1,210 +0,0 @@ - - */ -abstract class AbstractLiveMailboxTest extends TestCase -{ - use LiveMailboxTestingTrait; - - /** - * @psalm-return Generator - */ - public function ComposeProvider(): Generator - { - yield from []; - } - - /** - * @psalm-return Generator - */ - public function AppendProvider(): Generator - { - foreach ($this->MailBoxProvider() as $mailbox_args) { - foreach ($this->ComposeProvider() as $compose_args) { - [$envelope, $body, $expected_compose_result] = $compose_args; - - yield [$mailbox_args, $envelope, $body, $expected_compose_result, false]; - } - - foreach ($this->ComposeProvider() as $compose_args) { - [$envelope, $body, $expected_compose_result] = $compose_args; - - yield [$mailbox_args, $envelope, $body, $expected_compose_result, true]; - } - } - } - - /** - * @dataProvider AppendProvider - * - * @group live - * - * @depends testGetImapStream - * @depends testMailCompose - * - * @psalm-param MAILBOX_ARGS $mailbox_args - * @psalm-param COMPOSE_ENVELOPE $envelope - * @psalm-param COMPOSE_BODY $body - */ - public function testAppend( - array $mailbox_args, - array $envelope, - array $body, - string $_expected_compose_result, - bool $pre_compose - ): void { - if ($this->MaybeSkipAppendTest($envelope)) { - return; - } - - [$search_criteria] = $this->SubjectSearchCriteriaAndSubject($envelope); - - [$mailbox, $remove_mailbox, $path] = $this->getMailboxFromArgs( - $mailbox_args - ); - - /** @var Throwable|null */ - $exception = null; - - $mailboxDeleted = false; - - try { - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 0, - $search, - ( - 'If a subject was found,'. - ' then the message is insufficiently unique to assert that'. - ' a newly-appended message was actually created.' - ) - ); - - $message = [$envelope, $body]; - - if ($pre_compose) { - $message = Imap::mail_compose($envelope, $body); - } - - $mailbox->appendMessageToMailbox($message); - - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 1, - $search, - ( - 'If a subject was not found, '. - ' then Mailbox::appendMessageToMailbox() failed'. - ' despite not throwing an exception.' - ) - ); - - $mailbox->deleteMail($search[0]); - - $mailbox->expungeDeletedMails(); - - $mailbox->switchMailbox($path->getString()); - $mailbox->deleteMailbox($remove_mailbox); - $mailboxDeleted = true; - - $this->assertCount( - 0, - $mailbox->searchMailbox($search_criteria), - ( - 'If a subject was found,'. - ' then the message is was not expunged as requested.' - ) - ); - } catch (Throwable $ex) { - $exception = $ex; - } finally { - $mailbox->switchMailbox($path->getString()); - if (!$mailboxDeleted) { - $mailbox->deleteMailbox($remove_mailbox); - } - $mailbox->disconnect(); - } - - if (null !== $exception) { - throw $exception; - } - } - - /** - * Get subject search criteria and subject. - * - * @psalm-param array{subject?:mixed} $envelope - * - * @psalm-return array{0:string, 1:string} - */ - protected function SubjectSearchCriteriaAndSubject(array $envelope): array - { - /** @var string|null */ - $subject = $envelope['subject'] ?? null; - - $this->assertIsString($subject); - - $search_criteria = \sprintf('SUBJECT "%s"', $subject); - - /** @psalm-var array{0:string, 1:string} */ - return [$search_criteria, $subject]; - } - - protected function MaybeSkipAppendTest(array $envelope): bool - { - if (!isset($envelope['subject'])) { - $this->markTestSkipped( - 'Cannot search for message by subject, no subject specified!' - ); - - return true; - } - - return false; - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/Fixtures/DataPartInfo.php b/vendor/php-imap/php-imap/tests/unit/Fixtures/DataPartInfo.php deleted file mode 100644 index 7f01282..0000000 --- a/vendor/php-imap/php-imap/tests/unit/Fixtures/DataPartInfo.php +++ /dev/null @@ -1,23 +0,0 @@ -decodeAfterFetch($this->data); - } - - public function setData(string $data = null): void - { - $this->data = $data; - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/Fixtures/IncomingMailAttachment.php b/vendor/php-imap/php-imap/tests/unit/Fixtures/IncomingMailAttachment.php deleted file mode 100644 index 65c31ac..0000000 --- a/vendor/php-imap/php-imap/tests/unit/Fixtures/IncomingMailAttachment.php +++ /dev/null @@ -1,27 +0,0 @@ -override_getFileInfo_mime_type) - ) { - return $this->override_getFileInfo_mime_type; - } - - return parent::getFileInfo($fileinfo_const); - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/Fixtures/Mailbox.php b/vendor/php-imap/php-imap/tests/unit/Fixtures/Mailbox.php deleted file mode 100644 index 0e9fa45..0000000 --- a/vendor/php-imap/php-imap/tests/unit/Fixtures/Mailbox.php +++ /dev/null @@ -1,20 +0,0 @@ -imapPassword; - } - - public function getImapOptions(): int - { - return $this->imapOptions; - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/Fixtures/rgbkw5x1.png b/vendor/php-imap/php-imap/tests/unit/Fixtures/rgbkw5x1.png deleted file mode 100644 index aebc850..0000000 Binary files a/vendor/php-imap/php-imap/tests/unit/Fixtures/rgbkw5x1.png and /dev/null differ diff --git a/vendor/php-imap/php-imap/tests/unit/Fixtures/rgbkw5x1.webp b/vendor/php-imap/php-imap/tests/unit/Fixtures/rgbkw5x1.webp deleted file mode 100644 index 80f2621..0000000 Binary files a/vendor/php-imap/php-imap/tests/unit/Fixtures/rgbkw5x1.webp and /dev/null differ diff --git a/vendor/php-imap/php-imap/tests/unit/ImapTest.php b/vendor/php-imap/php-imap/tests/unit/ImapTest.php deleted file mode 100644 index d5cd6fc..0000000 --- a/vendor/php-imap/php-imap/tests/unit/ImapTest.php +++ /dev/null @@ -1,152 +0,0 @@ - - * } $args - */ -class ImapTest extends Base -{ - use LiveMailboxTestingTrait; - - /** - * @psalm-return Generator<'CI ENV with invalid password'|'empty mailbox/username/password', array{0: ConnectionException::class, 1: '/^[AUTHENTICATIONFAILED]/'|'Can't open mailbox : no such mailbox', 2: array{0: HiddenString, 1: HiddenString, 2: HiddenString, 3: 0, 4: 0, 5: array}, 3?: true}, mixed, void> - */ - public function OpenFailure(): Generator - { - yield 'empty mailbox/username/password' => [ - ConnectionException::class, - 'Can\'t open mailbox : no such mailbox', - [ - new HiddenString(''), - new HiddenString(''), - new HiddenString(''), - 0, - 0, - [], - ], - ]; - - $imapPath = \getenv('PHPIMAP_IMAP_PATH'); - $login = \getenv('PHPIMAP_LOGIN'); - $password = \getenv('PHPIMAP_PASSWORD'); - - if (\is_string($imapPath) && \is_string($login) && \is_string($password)) { - yield 'CI ENV with invalid password' => [ - ConnectionException::class, - '/^\[AUTHENTICATIONFAILED\].*/', - [ - new HiddenString($imapPath, true, true), - new HiddenString($login, true, true), - new HiddenString(\strrev($password), true, true), - 0, - 0, - [], - ], - true, - ]; - } - } - - /** - * @dataProvider OpenFailure - * - * @psalm-param class-string $exception - * @psalm-param PSALM_OPEN_ARGS $args - */ - public function testOpenFailure( - string $exception, - string $message, - array $args, - bool $message_as_regex = false - ): void { - $this->expectException($exception); - - if ($message_as_regex) { - $this->expectExceptionMessageMatches($message); - } else { - $this->expectExceptionMessage($message); - } - - Imap::open( - $args[0]->getString(), - $args[1]->getString(), - $args[2]->getString(), - $args[3], - $args[4], - $args[5] - ); - } - - /** - * @dataProvider MailBoxProvider - * - * @group live - */ - public function testSortEmpty( - HiddenString $path, - HiddenString $login, - HiddenString $password - ): void { - [$mailbox, $remove_mailbox, $path] = $this->getMailboxFromArgs([ - $path, - $login, - $password, - \sys_get_temp_dir(), - ]); - - /** @var Throwable|null */ - $exception = null; - - $mailboxDeleted = false; - - try { - $this->assertSame( - [], - Imap::sort( - $mailbox->getImapStream(), - SORTARRIVAL, - false, - 0 - ) - ); - } catch (Throwable $ex) { - $exception = $ex; - } finally { - $mailbox->switchMailbox($path->getString()); - if (!$mailboxDeleted) { - $mailbox->deleteMailbox($remove_mailbox); - } - $mailbox->disconnect(); - } - - if (null !== $exception) { - throw $exception; - } - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/IncomingMailTest.php b/vendor/php-imap/php-imap/tests/unit/IncomingMailTest.php deleted file mode 100644 index a43ca77..0000000 --- a/vendor/php-imap/php-imap/tests/unit/IncomingMailTest.php +++ /dev/null @@ -1,93 +0,0 @@ -id = 1; - $header->id = 2; - - $mail->isDraft = true; - $header->isDraft = false; - - $mail->date = \date(DATE_RFC3339, 0); - $header->date = \date(DATE_RFC3339, 60 * 60 * 24); - - $mail->setHeader($header); - - foreach ( - [ - 'id', - 'isDraft', - 'date', - ] as $property - ) { - /** @var scalar|array|object|resource|null */ - $headerPropertyValue = $header->$property; - $this->assertSame($headerPropertyValue, $mail->$property); - } - } - - public function testDataPartInfo(): void - { - $mail = new IncomingMail(); - $mailbox = new Mailbox('', '', ''); - - $data_part = new Fixtures\DataPartInfo($mailbox, 1, 0, ENCOTHER, 0); - $data_part->setData('foo'); - - $this->assertSame('foo', $data_part->fetch()); - - $mail->addDataPartInfo($data_part, DataPartInfo::TEXT_PLAIN); - - $this->assertSame('foo', $mail->textPlain); - - $this->assertTrue($mail->__isset('textPlain')); - } - - public function testAttachments(): void - { - $mail = new IncomingMail(); - - $this->assertFalse($mail->hasAttachments()); - $this->assertSame([], $mail->getAttachments()); - - $attachments = [ - new IncomingMailAttachment(), - ]; - - foreach ($attachments as $i => $attachment) { - $attachment->id = (string) $i; - $mail->addAttachment($attachment); - } - - $this->assertTrue($mail->hasAttachments()); - $this->assertSame($attachments, $mail->getAttachments()); - - foreach ($attachments as $attachment) { - $this->assertIsString($attachment->id); - $this->assertTrue($mail->removeAttachment($attachment->id)); - } - - $this->assertFalse($mail->hasAttachments()); - $this->assertSame([], $mail->getAttachments()); - - foreach ($attachments as $attachment) { - $this->assertIsString($attachment->id); - $this->assertFalse($mail->removeAttachment($attachment->id)); - } - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/Issue509Test.php b/vendor/php-imap/php-imap/tests/unit/Issue509Test.php deleted file mode 100644 index 0d5aa9b..0000000 --- a/vendor/php-imap/php-imap/tests/unit/Issue509Test.php +++ /dev/null @@ -1,56 +0,0 @@ -decodeMimeStrDefaultCharset = 'EUC-KR'; - $decoded = $mailbox->decodeMimeStr(\base64_decode(self::base64)); - - $this->assertSame(self::sha256, \hash('sha256', $decoded)); - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/Issue519Test.php b/vendor/php-imap/php-imap/tests/unit/Issue519Test.php deleted file mode 100644 index 215bb15..0000000 --- a/vendor/php-imap/php-imap/tests/unit/Issue519Test.php +++ /dev/null @@ -1,184 +0,0 @@ -'; - - public const MIME_TYPE = 'image/jpeg'; - - public const EXPECTED_ATTACHMENT_COUNT = 1; - - public const EXPECTED_ATTACHMENT_COUNT_AFTER_EMBED = 0; - - /** - * @psalm-return array - * - * @return string[][] - */ - public function provider(): array - { - $out = []; - - foreach (self::HEADER_VALUES as $value) { - $out[$value] = [$value]; - } - - return $out; - } - - /** - * @dataProvider provider - */ - public function test(string $header_value): void - { - $mailbox = new Mailbox('', '', ''); - $mail = new IncomingMail(); - $attachment = new Fixtures\IncomingMailAttachment(); - $part = new Fixtures\DataPartInfo( - $mailbox, - 0, - 0, - ENCBASE64, - 0 - ); - - $html = new Fixtures\DataPartInfo( - $mailbox, - 0, - 0, - ENC8BIT, - 0 - ); - - $html_string = ''; - - $html->setData($html_string); - $part->setData(''); - - $attachment->id = self::ID; - $attachment->contentId = self::ID; - $attachment->type = TYPEIMAGE; - $attachment->encoding = ENCBASE64; - $attachment->subtype = self::SUBTYPE; - $attachment->description = self::ID; - $attachment->name = self::ID; - $attachment->sizeInBytes = self::SIZE_IN_BYTES; - $attachment->disposition = $header_value; - $attachment->override_getFileInfo_mime_type = self::MIME_TYPE; - - $attachment->addDataPartInfo($part); - - $mail->addDataPartInfo($html, DataPartInfo::TEXT_HTML); - $mail->addAttachment($attachment); - - $this->assertTrue($mail->hasAttachments()); - - $this->assertCount( - self::EXPECTED_ATTACHMENT_COUNT, - $mail->getAttachments() - ); - - $this->assertSame($html_string, $mail->textHtml); - - $mail->embedImageAttachments(); - - $this->assertCount( - self::EXPECTED_ATTACHMENT_COUNT_AFTER_EMBED, - $mail->getAttachments() - ); - - $this->assertSame(self::HTML_EMBED, $mail->textHtml); - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/LiveMailboxIssue250Test.php b/vendor/php-imap/php-imap/tests/unit/LiveMailboxIssue250Test.php deleted file mode 100644 index b66a4cc..0000000 --- a/vendor/php-imap/php-imap/tests/unit/LiveMailboxIssue250Test.php +++ /dev/null @@ -1,89 +0,0 @@ - - */ -class LiveMailboxIssue250Test extends AbstractLiveMailboxTest -{ - /** - * @psalm-return Generator - */ - public function ComposeProvider(): Generator - { - $random_subject = 'barbushin/php-imap#250 测试: '.\bin2hex(\random_bytes(16)); - - yield [ - ['subject' => $random_subject], - [ - [ - 'type' => TYPETEXT, - 'contents.data' => 'test', - ], - ], - ( - 'Subject: '.$random_subject."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: TEXT/PLAIN; CHARSET=US-ASCII'."\r\n". - "\r\n". - 'test'."\r\n" - ), - ]; - } - - /** - * @dataProvider AppendProvider - * - * @group live - * @group live-issue-250 - * - * @psalm-param MAILBOX_ARGS $mailbox_args - * @psalm-param COMPOSE_ENVELOPE $envelope - * @psalm-param COMPOSE_BODY $body - */ - public function testAppend( - array $mailbox_args, - array $envelope, - array $body, - string $expected_compose_result, - bool $pre_compose - ): void { - parent::testAppend( - $mailbox_args, - $envelope, - $body, - $expected_compose_result, - $pre_compose - ); - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/LiveMailboxIssue490Test.php b/vendor/php-imap/php-imap/tests/unit/LiveMailboxIssue490Test.php deleted file mode 100644 index 695bc93..0000000 --- a/vendor/php-imap/php-imap/tests/unit/LiveMailboxIssue490Test.php +++ /dev/null @@ -1,141 +0,0 @@ -getMailbox( - $imapPath, - $login, - $password, - $attachmentsDir, - $serverEncoding - ); - - $exception = null; - - try { - $envelope = [ - 'subject' => 'barbushin/php-imap#501: '.\bin2hex(\random_bytes(16)), - ]; - - [$search_criteria] = $this->SubjectSearchCriteriaAndSubject( - $envelope - ); - - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 0, - $search, - ( - 'If a subject was found,'. - ' then the message is insufficiently unique to assert that'. - ' a newly-appended message was actually created.' - ) - ); - - $message = Imap::mail_compose( - $envelope, - [ - [ - 'type' => TYPEMULTIPART, - ], - [ - 'type' => TYPETEXT, - 'contents.data' => 'foo', - ], - [ - 'type' => TYPEMULTIPART, - 'subtype' => 'plain', - 'description' => 'bar.txt', - 'disposition.type' => 'attachment', - 'disposition' => ['filename' => 'bar.txt'], - 'type.parameters' => ['name' => 'bar.txt'], - 'contents.data' => 'bar', - ], - [ - 'type' => TYPEMULTIPART, - 'subtype' => 'plain', - 'description' => 'baz.txt', - 'disposition.type' => 'attachment', - 'disposition' => ['filename' => 'baz.txt'], - 'type.parameters' => ['name' => 'baz.txt'], - 'contents.data' => 'baz', - ], - ] - ); - - $mailbox->appendMessageToMailbox($message); - - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 1, - $search, - ( - 'If a subject was not found, '. - ' then Mailbox::appendMessageToMailbox() failed'. - ' despite not throwing an exception.' - ) - ); - - $mail = $mailbox->getMail($search[0], false); - - $this->assertSame('foo', $mail->textPlain); - - $attachments = $mail->getAttachments(); - $keys = \array_keys($attachments); - - $this->assertCount(2, $attachments); - - $this->assertSame('bar', $attachments[$keys[0]]->getContents()); - $this->assertSame('baz', $attachments[$keys[1]]->getContents()); - } catch (Exception $ex) { - $exception = $ex; - } finally { - $mailbox->switchMailbox($imapPath->getString()); - $mailbox->deleteMailbox($remove_mailbox); - $mailbox->disconnect(); - } - - if (null !== $exception) { - throw $exception; - } - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/LiveMailboxIssue501Test.php b/vendor/php-imap/php-imap/tests/unit/LiveMailboxIssue501Test.php deleted file mode 100644 index 34ebc9e..0000000 --- a/vendor/php-imap/php-imap/tests/unit/LiveMailboxIssue501Test.php +++ /dev/null @@ -1,130 +0,0 @@ -assertSame([], \imap_mime_header_decode('')); - - // example credentials nabbed from MailboxTest::testConstructorTrimsPossibleVariables() - $imapPath = ' {imap.example.com:993/imap/ssl}INBOX '; - $login = ' php-imap@example.com'; - $password = ' v3rY!53cEt&P4sSWöRd$'; - // directory names can contain spaces before AND after on Linux/Unix systems. Windows trims these spaces automatically. - $attachmentsDir = '.'; - $serverEncoding = 'UTF-8 '; - - $mailbox = new Mailbox($imapPath, $login, $password, $attachmentsDir, $serverEncoding); - - $this->assertSame('', $mailbox->decodeMimeStr('')); - } - - /** - * @dataProvider MailBoxProvider - * - * @group live - * @group live-issue-501 - */ - public function testGetEmptyBody( - HiddenString $imapPath, - HiddenString $login, - HiddenString $password, - string $attachmentsDir, - string $serverEncoding = 'UTF-8' - ): void { - [$mailbox, $remove_mailbox] = $this->getMailbox( - $imapPath, - $login, - $password, - $attachmentsDir, - $serverEncoding - ); - - $exception = null; - - try { - $envelope = [ - 'subject' => 'barbushin/php-imap#501: '.\bin2hex(\random_bytes(16)), - ]; - - [$search_criteria] = $this->SubjectSearchCriteriaAndSubject( - $envelope - ); - - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 0, - $search, - ( - 'If a subject was found,'. - ' then the message is insufficiently unique to assert that'. - ' a newly-appended message was actually created.' - ) - ); - - $mailbox->appendMessageToMailbox(Imap::mail_compose( - $envelope, - [ - [ - 'type' => TYPETEXT, - 'contents.data' => '', - ], - ] - )); - - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 1, - $search, - ( - 'If a subject was not found, '. - ' then Mailbox::appendMessageToMailbox() failed'. - ' despite not throwing an exception.' - ) - ); - - $mail = $mailbox->getMail($search[0], false); - - $this->assertSame('', $mail->textPlain); - } catch (Exception $ex) { - $exception = $ex; - } finally { - $mailbox->switchMailbox($imapPath->getString()); - $mailbox->deleteMailbox($remove_mailbox); - $mailbox->disconnect(); - } - - if (null !== $exception) { - throw $exception; - } - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/LiveMailboxIssue514Test.php b/vendor/php-imap/php-imap/tests/unit/LiveMailboxIssue514Test.php deleted file mode 100644 index 1c8edba..0000000 --- a/vendor/php-imap/php-imap/tests/unit/LiveMailboxIssue514Test.php +++ /dev/null @@ -1,258 +0,0 @@ - 'barbushin/php-imap#514--'.\bin2hex(\random_bytes(16)), - ]; - - [$search_criteria] = $this->SubjectSearchCriteriaAndSubject($envelope); - - $body = [ - [ - 'type' => TYPEMULTIPART, - ], - [ - 'type' => TYPETEXT, - 'subtype' => 'plain', - 'contents.data' => 'foo', - ], - [ - 'type' => TYPETEXT, - 'subtype' => 'html', - 'contents.data' => \implode('', [ - 'png', - 'webp', - ]), - ], - [ - 'type' => TYPEIMAGE, - 'subtype' => 'png', - 'encoding' => ENCBASE64, - 'id' => 'foo.png', - 'description' => 'foo.png', - 'disposition' => ['filename' => 'foo.png'], - 'disposition.type' => 'inline', - 'type.parameters' => ['name' => 'foo.png'], - 'contents.data' => \base64_encode( - \file_get_contents(__DIR__.'/Fixtures/rgbkw5x1.png') - ), - ], - [ - 'type' => TYPEIMAGE, - 'subtype' => 'webp', - 'encoding' => ENCBASE64, - 'id' => 'foo.webp', - 'description' => 'foo.webp', - 'disposition' => ['filename' => 'foo.webp'], - 'disposition.type' => 'inline', - 'type.parameters' => ['name' => 'foo.webp'], - 'contents.data' => \base64_encode( - \file_get_contents(__DIR__.'/Fixtures/rgbkw5x1.webp') - ), - ], - ]; - - $message = Imap::mail_compose( - $envelope, - $body - ); - - [$mailbox, $remove_mailbox, $path] = $this->getMailboxFromArgs([ - $imapPath, - $login, - $password, - $attachmentsDir, - $serverEncoding, - ]); - - $result = null; - - try { - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 0, - $search, - ( - 'If a subject was found,'. - ' then the message is insufficiently unique to assert that'. - ' a newly-appended message was actually created.' - ) - ); - - $mailbox->appendMessageToMailbox($message); - - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 1, - $search, - ( - 'If a subject was not found, '. - ' then Mailbox::appendMessageToMailbox() failed'. - ' despite not throwing an exception.' - ) - ); - - $result = $mailbox->getMail($search[0], false); - - /** @var array */ - $counts = []; - - foreach ($result->getAttachments() as $attachment) { - if (!isset($counts[(string) $attachment->contentId])) { - $counts[(string) $attachment->contentId] = 0; - } - - ++$counts[(string) $attachment->contentId]; - } - - $this->assertCount( - 2, - $counts, - ( - 'counts should only contain foo.png and foo.webp, found: '. - \implode( - ', ', - \array_keys($counts) - ) - ) - ); - - foreach ($counts as $cid => $count) { - $this->assertSame( - 1, - $count, - $cid.' had '.(string) $count.', expected 1.' - ); - } - - $this->assertSame( - 'foo', - $result->textPlain, - 'plain text body did not match expected result!' - ); - - $embedded = \implode('', [ - 'png', - 'webp', - ]); - - $this->assertSame( - [ - 'foo.png' => 'cid:foo.png', - 'foo.webp' => 'cid:foo.webp', - ], - $result->getInternalLinksPlaceholders(), - 'Internal link placeholders did not match expected result!' - ); - - $replaced = \implode('', [ - 'png', - 'webp', - ]); - - foreach ($result->getAttachments() as $attachment) { - if ('foo.png' === $attachment->contentId) { - $replaced = \str_replace( - 'foo.png', - '/'.\basename($attachment->filePath), - $replaced - ); - } elseif ('foo.webp' === $attachment->contentId) { - $replaced = \str_replace( - 'foo.webp', - '/'.\basename($attachment->filePath), - $replaced - ); - } - } - - $this->assertSame( - $replaced, - $result->replaceInternalLinks(''), - 'replaced html body did not match expected result!' - ); - - $this->assertSame( - $body[2]['contents.data'], - $result->textHtml, - 'unembeded html body did not match expected result!' - ); - - $result->embedImageAttachments(); - - $this->assertSame( - $embedded, - $result->textHtml, - 'embeded html body did not match expected result!' - ); - - $mailbox->deleteMail($search[0]); - } catch (Throwable $ex) { - $exception = $ex; - } finally { - $mailbox->switchMailbox($path->getString()); - - if (!$mailboxDeleted) { - $mailbox->deleteMailbox($remove_mailbox); - } - - $mailbox->disconnect(); - } - - if (null !== $exception) { - throw $exception; - } - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/LiveMailboxStringDecodingConvertingTest.php b/vendor/php-imap/php-imap/tests/unit/LiveMailboxStringDecodingConvertingTest.php deleted file mode 100644 index 5025a4a..0000000 --- a/vendor/php-imap/php-imap/tests/unit/LiveMailboxStringDecodingConvertingTest.php +++ /dev/null @@ -1,91 +0,0 @@ - [ - ENCQUOTEDPRINTABLE, - 'iso-8859-1', - 'mountainguan', - 'mountainguan', - 'e94a37111edb29a8d3f6078dc4810953964f19562613cf2bd15e21b69d30822a', - ]; - - yield 'Issue #250 utf-7' => [ - ENCQUOTEDPRINTABLE, - 'utf-7', - '+bUuL1Q-', - '测试', - '6aa8f49cc992dfd75a114269ed26de0ad6d4e7d7a70d9c8afb3d7a57a88a73ed', - ]; - - yield 'Issue #250 utf-7 with chinese' => [ - ENCQUOTEDPRINTABLE, - 'utf-7', - 'mountainguan+bUuL1Q-', - 'mountainguan测试', - '62a5022b682b7e02bda8d18424fa06501cdd71cce2832e95129673f63da2e177', - ]; - - yield 'Issue #250 utf-8 with chinese' => [ - ENCQUOTEDPRINTABLE, - 'utf-8', - 'mountainguan=E6=B5=8B=E8=AF=95', - 'mountainguan测试', - '62a5022b682b7e02bda8d18424fa06501cdd71cce2832e95129673f63da2e177', - ]; - - yield 'Issue #657' => [ - ENCQUOTEDPRINTABLE, - 'iso-8859-2', - '=EC=B9=E8=F8=BE=FD=E1=ED=E9', - 'ěščřžýáíé', - 'a05e42c7e14de716cd501e135f3f5e49545f71069de316a1e9f7bb153f9a7356', - ]; - - yield 'Emoji utf-8' => [ - ENCQUOTEDPRINTABLE, - 'utf-8', - 'Some subject here =F0=9F=98=98', - 'Some subject here 😘', - 'da66c62e7e82316b8b543f52f1ecc4415c4dc93bc87e2239ee5f98bdf00a8c50', - ]; - } - - /** - * Test that string decoding and converting works as expected. - * - * @dataProvider stringDecodeProvider - */ - public function testStringDecode(int $encoding, string $charset, string $iso_8859_2, string $utf8, string $sha256): void - { - $mailbox = new Mailbox('', '', ''); - - $dataInfo = new DataPartInfo($mailbox, 1337, '', $encoding, 0); - $dataInfo->charset = $charset; - - $decoded = $dataInfo->decodeAfterFetch($iso_8859_2); - - $this->assertSame($utf8, $decoded); - - $this->assertSame($sha256, \hash('sha256', $decoded)); - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/LiveMailboxTest.php b/vendor/php-imap/php-imap/tests/unit/LiveMailboxTest.php deleted file mode 100644 index f27de94..0000000 --- a/vendor/php-imap/php-imap/tests/unit/LiveMailboxTest.php +++ /dev/null @@ -1,678 +0,0 @@ - - * - * @todo see @todo of Imap::mail_compose() - */ -class LiveMailboxTest extends AbstractLiveMailboxTest -{ - public const RANDOM_MAILBOX_SAMPLE_SIZE = 3; - - public const ISSUE_EXPECTED_ATTACHMENT_COUNT = [ - 448 => 1, - 391 => 2, - ]; - - /** - * @dataProvider MailBoxProvider - * - * @group live - */ - public function testGetImapStream(HiddenString $imapPath, HiddenString $login, HiddenString $password, string $attachmentsDir, string $serverEncoding = 'UTF-8'): void - { - [$mailbox, $remove_mailbox] = $this->getMailbox( - $imapPath, - $login, - $password, - $attachmentsDir, - $serverEncoding - ); - - /** @var Throwable|null */ - $exception = null; - - try { - $mailbox->getImapStream(); - $this->assertTrue($mailbox->hasImapStream()); - - $mailboxes = $mailbox->getMailboxes(); - \shuffle($mailboxes); - - $mailboxes = \array_values($mailboxes); - - $limit = \min(\count($mailboxes), self::RANDOM_MAILBOX_SAMPLE_SIZE); - - for ($i = 0; $i < $limit; ++$i) { - $this->assertIsArray($mailboxes[$i]); - $this->assertTrue(isset($mailboxes[$i]['shortpath'])); - $this->assertIsString($mailboxes[$i]['shortpath']); - $mailbox->switchMailbox($mailboxes[$i]['shortpath']); - - $check = $mailbox->checkMailbox(); - - foreach ([ - 'Date', - 'Driver', - 'Mailbox', - 'Nmsgs', - 'Recent', - ] as $expectedProperty) { - $this->assertTrue(\property_exists($check, $expectedProperty)); - } - - $this->assertIsString($check->Date, 'Date property of Mailbox::checkMailbox() result was not a string!'); - - $unix = \strtotime($check->Date); - - if (false === $unix && \preg_match('/[+-]\d{1,2}:?\d{2} \([^\)]+\)$/', $check->Date)) { - /** @var int */ - $pos = \strrpos($check->Date, '('); - - // Although the date property is likely RFC2822-compliant, it will not be parsed by strtotime() - $unix = \strtotime(\substr($check->Date, 0, $pos)); - } - - $this->assertIsInt($unix, 'Date property of Mailbox::checkMailbox() result was not a valid date!'); - $this->assertTrue(\in_array($check->Driver, ['POP3', 'IMAP', 'NNTP', 'pop3', 'imap', 'nntp'], true), 'Driver property of Mailbox::checkMailbox() result was not of an expected value!'); - $this->assertIsInt($check->Nmsgs, 'Nmsgs property of Mailbox::checkMailbox() result was not of an expected type!'); - $this->assertIsInt($check->Recent, 'Recent property of Mailbox::checkMailbox() result was not of an expected type!'); - - $status = $mailbox->statusMailbox(); - - foreach ([ - 'messages', - 'recent', - 'unseen', - 'uidnext', - 'uidvalidity', - ] as $expectedProperty) { - $this->assertTrue(\property_exists($status, $expectedProperty)); - } - - $this->assertSame($check->Nmsgs, $mailbox->countMails(), 'Mailbox::checkMailbox()->Nmsgs did not match Mailbox::countMails()!'); - } - } catch (Throwable $ex) { - $exception = $ex; - } finally { - $mailbox->switchMailbox($imapPath->getString()); - $mailbox->deleteMailbox($remove_mailbox); - $mailbox->disconnect(); - } - - if (null !== $exception) { - throw $exception; - } - } - - /** - * @psalm-return Generator - */ - public function ComposeProvider(): Generator - { - $random_subject = 'test: '.\bin2hex(\random_bytes(16)); - - yield [ - ['subject' => $random_subject], - [ - [ - 'type' => TYPETEXT, - 'contents.data' => 'test', - ], - ], - ( - 'Subject: '.$random_subject."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: TEXT/PLAIN; CHARSET=US-ASCII'."\r\n". - "\r\n". - 'test'."\r\n" - ), - ]; - - $random_subject = 'barbushin/php-imap#448: dot first:'.\bin2hex(\random_bytes(16)); - - yield [ - ['subject' => $random_subject], - [ - [ - 'type' => TYPEAPPLICATION, - 'encoding' => ENCBASE64, - 'subtype' => 'octet-stream', - 'description' => '.gitignore', - 'disposition.type' => 'attachment', - 'disposition' => ['filename' => '.gitignore'], - 'type.parameters' => ['name' => '.gitignore'], - 'contents.data' => \base64_encode( - \file_get_contents(__DIR__.'/../../.gitignore') - ), - ], - ], - ( - 'Subject: '.$random_subject."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: APPLICATION/octet-stream; name=.gitignore'."\r\n". - 'Content-Transfer-Encoding: BASE64'."\r\n". - 'Content-Description: .gitignore'."\r\n". - 'Content-Disposition: attachment; filename=.gitignore'."\r\n". - "\r\n". - \base64_encode( - \file_get_contents(__DIR__.'/../../.gitignore') - )."\r\n" - ), - ]; - - $random_subject = 'barbushin/php-imap#448: dot last: '.\bin2hex(\random_bytes(16)); - - yield [ - ['subject' => $random_subject], - [ - [ - 'type' => TYPEAPPLICATION, - 'encoding' => ENCBASE64, - 'subtype' => 'octet-stream', - 'description' => 'gitignore.', - 'disposition.type' => 'attachment', - 'disposition' => ['filename' => 'gitignore.'], - 'type.parameters' => ['name' => 'gitignore.'], - 'contents.data' => \base64_encode( - \file_get_contents(__DIR__.'/../../.gitignore') - ), - ], - ], - ( - 'Subject: '.$random_subject."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: APPLICATION/octet-stream; name=gitignore.'."\r\n". - 'Content-Transfer-Encoding: BASE64'."\r\n". - 'Content-Description: gitignore.'."\r\n". - 'Content-Disposition: attachment; filename=gitignore.'."\r\n". - "\r\n". - \base64_encode( - \file_get_contents(__DIR__.'/../../.gitignore') - )."\r\n" - ), - ]; - - $random_subject = 'barbushin/php-imap#391: '.\bin2hex(\random_bytes(16)); - - $random_attachment_a = \base64_encode(\random_bytes(16)); - $random_attachment_b = \base64_encode(\random_bytes(16)); - - yield [ - ['subject' => $random_subject], - [ - [ - 'type' => TYPEMULTIPART, - ], - [ - 'type' => TYPETEXT, - 'contents.data' => 'test', - ], - [ - 'type' => TYPEAPPLICATION, - 'encoding' => ENCBASE64, - 'subtype' => 'octet-stream', - 'description' => 'foo.bin', - 'disposition.type' => 'attachment', - 'disposition' => ['filename' => 'foo.bin'], - 'type.parameters' => ['name' => 'foo.bin'], - 'contents.data' => $random_attachment_a, - ], - [ - 'type' => TYPEAPPLICATION, - 'encoding' => ENCBASE64, - 'subtype' => 'octet-stream', - 'description' => 'foo.bin', - 'disposition.type' => 'attachment', - 'disposition' => ['filename' => 'foo.bin'], - 'type.parameters' => ['name' => 'foo.bin'], - 'contents.data' => $random_attachment_b, - ], - ], - ( - 'Subject: '.$random_subject."\r\n". - 'MIME-Version: 1.0'."\r\n". - 'Content-Type: MULTIPART/MIXED; BOUNDARY="{{REPLACE_BOUNDARY_HERE}}"'."\r\n". - "\r\n". - '--{{REPLACE_BOUNDARY_HERE}}'."\r\n". - 'Content-Type: TEXT/PLAIN; CHARSET=US-ASCII'."\r\n". - "\r\n". - 'test'."\r\n". - '--{{REPLACE_BOUNDARY_HERE}}'."\r\n". - 'Content-Type: APPLICATION/octet-stream; name=foo.bin'."\r\n". - 'Content-Transfer-Encoding: BASE64'."\r\n". - 'Content-Description: foo.bin'."\r\n". - 'Content-Disposition: attachment; filename=foo.bin'."\r\n". - "\r\n". - $random_attachment_a."\r\n". - '--{{REPLACE_BOUNDARY_HERE}}'."\r\n". - 'Content-Type: APPLICATION/octet-stream; name=foo.bin'."\r\n". - 'Content-Transfer-Encoding: BASE64'."\r\n". - 'Content-Description: foo.bin'."\r\n". - 'Content-Disposition: attachment; filename=foo.bin'."\r\n". - "\r\n". - $random_attachment_b."\r\n". - '--{{REPLACE_BOUNDARY_HERE}}--'."\r\n" - ), - ]; - } - - /** - * @dataProvider ComposeProvider - * - * @group compose - * - * @psalm-param COMPOSE_ENVELOPE $envelope - * @psalm-param COMPOSE_BODY $body - */ - public function testMailCompose(array $envelope, array $body, string $expected_result): void - { - $actual_result = Imap::mail_compose($envelope, $body); - - $expected_result = $this->ReplaceBoundaryHere( - $expected_result, - $actual_result - ); - - $this->assertSame($expected_result, $actual_result); - } - - /** - * @dataProvider AppendProvider - * - * @group live - * - * @depends testAppend - * - * @psalm-param MAILBOX_ARGS $mailbox_args - * @psalm-param COMPOSE_ENVELOPE $envelope - * @psalm-param COMPOSE_BODY $body - */ - public function testAppendNudgesMailboxCount( - array $mailbox_args, - array $envelope, - array $body, - string $_expected_compose_result, - bool $pre_compose - ): void { - if ($this->MaybeSkipAppendTest($envelope)) { - return; - } - - [$search_criteria] = $this->SubjectSearchCriteriaAndSubject($envelope); - - [$mailbox, $remove_mailbox, $path] = $this->getMailboxFromArgs( - $mailbox_args - ); - - $count = $mailbox->countMails(); - - $message = [$envelope, $body]; - - if ($pre_compose) { - $message = Imap::mail_compose($envelope, $body); - } - - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 0, - $search, - ( - 'If a subject was found,'. - ' then the message is insufficiently unique to assert that'. - ' a newly-appended message was actually created.' - ) - ); - - $mailbox->appendMessageToMailbox($message); - - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 1, - $search, - ( - 'If a subject was not found, '. - ' then Mailbox::appendMessageToMailbox() failed'. - ' despite not throwing an exception.' - ) - ); - - $this->assertSame( - $count + 1, - $mailbox->countMails(), - ( - 'If the message count did not increase'. - ' then either the message was not appended,'. - ' or a mesage was removed while the test was running.' - ) - ); - - $mailbox->deleteMail($search[0]); - - $mailbox->expungeDeletedMails(); - - $mailbox->switchMailbox($path->getString()); - $mailbox->deleteMailbox($remove_mailbox); - - $this->assertCount( - 0, - $mailbox->searchMailbox($search_criteria), - ( - 'If a subject was found,'. - ' then the message is was not expunged as requested.' - ) - ); - } - - /** - * @dataProvider AppendProvider - * - * @group live - * - * @depends testAppend - * - * @psalm-param MAILBOX_ARGS $mailbox_args - * @psalm-param COMPOSE_ENVELOPE $envelope - * @psalm-param COMPOSE_BODY $body - */ - public function testAppendSingleSearchMatchesSort( - array $mailbox_args, - array $envelope, - array $body, - string $_expected_compose_result, - bool $pre_compose - ): void { - if ($this->MaybeSkipAppendTest($envelope)) { - return; - } - - [$search_criteria] = $this->SubjectSearchCriteriaAndSubject($envelope); - - [$mailbox, $remove_mailbox, $path] = $this->getMailboxFromArgs( - $mailbox_args - ); - - $message = [$envelope, $body]; - - if ($pre_compose) { - $message = Imap::mail_compose($envelope, $body); - } - - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 0, - $search, - ( - 'If a subject was found,'. - ' then the message is insufficiently unique to assert that'. - ' a newly-appended message was actually created.' - ) - ); - - $mailbox->appendMessageToMailbox($message); - - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 1, - $search, - ( - 'If a subject was not found, '. - ' then Mailbox::appendMessageToMailbox() failed'. - ' despite not throwing an exception.' - ) - ); - - $this->assertSame( - $search, - $mailbox->sortMails(SORTARRIVAL, true, $search_criteria) - ); - - $this->assertSame( - $search, - $mailbox->sortMails(SORTARRIVAL, false, $search_criteria) - ); - - $this->assertSame( - $search, - $mailbox->sortMails(SORTARRIVAL, false, $search_criteria, 'UTF-8') - ); - - $this->assertTrue(\in_array( - $search[0], - $mailbox->sortMails(SORTARRIVAL, false, null), - true - )); - - $mailbox->deleteMail($search[0]); - - $mailbox->expungeDeletedMails(); - - $mailbox->switchMailbox($path->getString()); - $mailbox->deleteMailbox($remove_mailbox); - - $this->assertCount( - 0, - $mailbox->searchMailbox($search_criteria), - ( - 'If a subject was found,'. - ' then the message is was not expunged as requested.' - ) - ); - } - - /** - * @dataProvider AppendProvider - * - * @group live - * - * @depends testAppend - * - * @psalm-param MAILBOX_ARGS $mailbox_args - * @psalm-param COMPOSE_ENVELOPE $envelope - * @psalm-param COMPOSE_BODY $body - */ - public function testAppendRetrievalMatchesExpected( - array $mailbox_args, - array $envelope, - array $body, - string $expected_compose_result, - bool $pre_compose - ): void { - if ($this->MaybeSkipAppendTest($envelope)) { - return; - } - - [$search_criteria, $search_subject] = $this->SubjectSearchCriteriaAndSubject($envelope); - - [$mailbox, $remove_mailbox, $path] = $this->getMailboxFromArgs( - $mailbox_args - ); - - $message = [$envelope, $body]; - - if ($pre_compose) { - $message = Imap::mail_compose($envelope, $body); - } - - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 0, - $search, - ( - 'If a subject was found,'. - ' then the message is insufficiently unique to assert that'. - ' a newly-appended message was actually created.' - ) - ); - - $mailbox->appendMessageToMailbox($message); - - $search = $mailbox->searchMailbox($search_criteria); - - $this->assertCount( - 1, - $search, - ( - 'If a subject was not found, '. - ' then Mailbox::appendMessageToMailbox() failed'. - ' despite not throwing an exception.' - ) - ); - - $actual_result = $mailbox->getMailMboxFormat($search[0]); - - $this->assertSame( - $this->ReplaceBoundaryHere( - $expected_compose_result, - $actual_result - ), - $actual_result - ); - - $actual_result = $mailbox->getRawMail($search[0]); - - $this->assertSame( - $this->ReplaceBoundaryHere( - $expected_compose_result, - $actual_result - ), - $actual_result - ); - - $mail = $mailbox->getMail($search[0], false); - - $this->assertSame( - $search_subject, - $mail->subject, - ( - 'If a retrieved mail did not have a matching subject'. - ' despite being found via search,'. - ' then something has gone wrong.' - ) - ); - - $info = $mailbox->getMailsInfo($search); - - $this->assertCount(1, $info); - - $this->assertSame( - $search_subject, - $info[0]->subject, - ( - 'If a retrieved mail did not have a matching subject'. - ' despite being found via search,'. - ' then something has gone wrong.' - ) - ); - - if (1 === \preg_match( - '/^barbushin\/php-imap#(448|391):/', - $envelope['subject'] ?? '', - $matches - )) { - $this->assertTrue($mail->hasAttachments()); - - $attachments = $mail->getAttachments(); - - $this->assertCount(self::ISSUE_EXPECTED_ATTACHMENT_COUNT[ - (int) $matches[1]], - $attachments - ); - - if ('448' === $matches[1]) { - $this->assertSame( - \file_get_contents(__DIR__.'/../../.gitignore'), - \current($attachments)->getContents() - ); - } - } - - $mailbox->deleteMail($search[0]); - - $mailbox->expungeDeletedMails(); - - $mailbox->switchMailbox($path->getString()); - $mailbox->deleteMailbox($remove_mailbox); - - $this->assertCount( - 0, - $mailbox->searchMailbox($search_criteria), - ( - 'If a subject was found,'. - ' then the message is was not expunged as requested.' - ) - ); - } - - /** - * @param string $expected_result - * @param string $actual_result - * - * @return string - * - * @psalm-pure - */ - protected function ReplaceBoundaryHere( - $expected_result, - $actual_result - ) { - if ( - 1 === \preg_match('/{{REPLACE_BOUNDARY_HERE}}/', $expected_result) && - 1 === \preg_match( - '/Content-Type: MULTIPART\/MIXED; BOUNDARY="([^"]+)"/', - $actual_result, - $matches - ) - ) { - $expected_result = \str_replace( - '{{REPLACE_BOUNDARY_HERE}}', - $matches[1], - $expected_result - ); - } - - return $expected_result; - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/LiveMailboxTestingTrait.php b/vendor/php-imap/php-imap/tests/unit/LiveMailboxTestingTrait.php deleted file mode 100644 index 3c08434..0000000 --- a/vendor/php-imap/php-imap/tests/unit/LiveMailboxTestingTrait.php +++ /dev/null @@ -1,90 +0,0 @@ -getString(), $login->getString(), $password->getString(), $attachmentsDir, $serverEncoding); - - $random = 'test-box-'.\date('c').\bin2hex(\random_bytes(4)); - - $mailbox->createMailbox($random); - - $mailbox->switchMailbox($random, false); - - return [$mailbox, $random, $imapPath]; - } - - /** - * @psalm-param MAILBOX_ARGS $mailbox_args - * - * @return mixed[] - * - * @psalm-return array{0:Mailbox, 1:string, 2:HiddenString} - */ - protected function getMailboxFromArgs(array $mailbox_args): array - { - [$path, $username, $password, $attachments_dir] = $mailbox_args; - - return $this->getMailbox( - $path, - $username, - $password, - $attachments_dir, - $mailbox_args[4] ?? 'UTF-8' - ); - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/LiveMailboxWithManualSetupTest.php b/vendor/php-imap/php-imap/tests/unit/LiveMailboxWithManualSetupTest.php deleted file mode 100644 index ba3ce9a..0000000 --- a/vendor/php-imap/php-imap/tests/unit/LiveMailboxWithManualSetupTest.php +++ /dev/null @@ -1,70 +0,0 @@ - - */ - public function RelativeToRootPathProvider(): Generator - { - yield [ - '.issue-499.Éléments envoyés', - ]; - } - - /** - * @psalm-return Generator - */ - public function statusProviderAbsolutePath(): Generator - { - foreach ($this->RelativeToRootPathProvider() as $path_args) { - foreach ($this->MailBoxProvider() as $args) { - $args[0] = new HiddenString($args[0]->getString().$path_args[0]); - - yield [$args]; - } - } - } - - /** - * Tests the status of an absolute mailbox path set from the Mailbox constructor. - * - * @dataProvider statusProviderAbsolutePath - * - * @group live - * @group live-manual - * - * @psalm-param MAILBOX_ARGS $mailbox_args - */ - public function testAbsolutePathStatusFromConstruction( - array $mailbox_args - ): void { - [$mailbox] = $this->getMailboxFromArgs($mailbox_args); - - $mailbox->statusMailbox(); - - $this->assertTrue(true); - } -} diff --git a/vendor/php-imap/php-imap/tests/unit/MailboxTest.php b/vendor/php-imap/php-imap/tests/unit/MailboxTest.php deleted file mode 100644 index 507ff59..0000000 --- a/vendor/php-imap/php-imap/tests/unit/MailboxTest.php +++ /dev/null @@ -1,814 +0,0 @@ - - */ -declare(strict_types=1); - -namespace PhpImap; - -use const CL_EXPUNGE; -use DateTime; -use Generator; -use const IMAP_CLOSETIMEOUT; -use const IMAP_OPENTIMEOUT; -use const IMAP_READTIMEOUT; -use const IMAP_WRITETIMEOUT; -use const OP_ANONYMOUS; -use const OP_DEBUG; -use const OP_HALFOPEN; -use const OP_PROTOTYPE; -use const OP_READONLY; -use const OP_SECURE; -use const OP_SHORTCACHE; -use const OP_SILENT; -use PhpImap\Exceptions\InvalidParameterException; -use PHPUnit\Framework\TestCase; -use const SE_FREE; -use const SE_UID; - -final class MailboxTest extends TestCase -{ - public const ANYTHING = 0; - - /** - * Holds the imap path. - * - * @var string - */ - private $imapPath = '{imap.example.com:993/imap/ssl/novalidate-cert}INBOX'; - - /** - * Holds the imap username. - * - * @var string|email - * - * @psalm-var string - */ - private $login = 'php-imap@example.com'; - - /** - * Holds the imap user password. - * - * @var string - */ - private $password = 'v3rY!53cEt&P4sSWöRd$'; - - /** - * Holds the relative name of the directory, where email attachments will be saved. - * - * @var string - */ - private $attachmentsDir = '.'; - - /** - * Holds the server encoding setting. - * - * @var string - */ - private $serverEncoding = 'UTF-8'; - - /** - * Test, that the constructor trims possible variables - * Leading and ending spaces are not even possible in some variables. - */ - public function testConstructorTrimsPossibleVariables(): void - { - $imapPath = ' {imap.example.com:993/imap/ssl}INBOX '; - $login = ' php-imap@example.com'; - $password = ' v3rY!53cEt&P4sSWöRd$'; - // directory names can contain spaces before AND after on Linux/Unix systems. Windows trims these spaces automatically. - $attachmentsDir = '.'; - $serverEncoding = 'UTF-8 '; - - $mailbox = new Fixtures\Mailbox($imapPath, $login, $password, $attachmentsDir, $serverEncoding); - - $this->assertSame('{imap.example.com:993/imap/ssl}INBOX', $mailbox->getImapPath()); - $this->assertSame('php-imap@example.com', $mailbox->getLogin()); - $this->assertSame(' v3rY!53cEt&P4sSWöRd$', $mailbox->getImapPassword()); - $this->assertSame(\realpath('.'), $mailbox->getAttachmentsDir()); - $this->assertSame('UTF-8', $mailbox->getServerEncoding()); - } - - /** - * @psalm-return non-empty-list - * - * @return string[][] - */ - public function SetAndGetServerEncodingProvider(): array - { - $data = [ - ['UTF-8'], - ]; - - $supported = \mb_list_encodings(); - - foreach ( - [ - 'Windows-1251', - 'Windows-1252', - ] as $perhaps - ) { - if ( - \in_array(\trim($perhaps), $supported, true) || - \in_array(\strtoupper(\trim($perhaps)), $supported, true) - ) { - $data[] = [$perhaps]; - } - } - - return $data; - } - - /** - * Test, that the server encoding can be set. - * - * @dataProvider SetAndGetServerEncodingProvider - */ - public function testSetAndGetServerEncoding(string $encoding): void - { - $mailbox = $this->getMailbox(); - - $mailbox->setServerEncoding($encoding); - - $encoding = \strtoupper(\trim($encoding)); - - $this->assertEquals($mailbox->getServerEncoding(), $encoding); - } - - /** - * Test, that server encoding is set to a default value. - */ - public function testServerEncodingHasDefaultSetting(): void - { - // Default character encoding should be set - $mailbox = new Mailbox($this->imapPath, $this->login, $this->password, $this->attachmentsDir); - $this->assertSame('UTF-8', $mailbox->getServerEncoding()); - } - - /** - * Test, that server encoding that all functions uppers the server encoding setting. - */ - public function testServerEncodingUppersSetting(): void - { - // Server encoding should be always upper formatted - $mailbox = new Mailbox($this->imapPath, $this->login, $this->password, $this->attachmentsDir, 'utf-8'); - $this->assertSame('UTF-8', $mailbox->getServerEncoding()); - - $mailbox = new Mailbox($this->imapPath, $this->login, $this->password, $this->attachmentsDir, 'UTF7-IMAP'); - $mailbox->setServerEncoding('uTf-8'); - $this->assertSame('UTF-8', $mailbox->getServerEncoding()); - } - - /** - * Provides test data for testing server encodings. - * - * @return (bool|string)[][] - * - * @psalm-return array{UTF-7: array{0: true, 1: 'UTF-7'}, UTF7-IMAP: array{0: true, 1: 'UTF7-IMAP'}, UTF-8: array{0: true, 1: 'UTF-8'}, ASCII: array{0: true, 1: 'ASCII'}, US-ASCII: array{0: true, 1: 'US-ASCII'}, ISO-8859-1: array{0: true, 1: 'ISO-8859-1'}, UTF7: array{0: false, 1: 'UTF7'}, UTF-7-IMAP: array{0: false, 1: 'UTF-7-IMAP'}, UTF-7IMAP: array{0: false, 1: 'UTF-7IMAP'}, UTF8: array{0: false, 1: 'UTF8'}, USASCII: array{0: false, 1: 'USASCII'}, ASC11: array{0: false, 1: 'ASC11'}, ISO-8859-0: array{0: false, 1: 'ISO-8859-0'}, ISO-8855-1: array{0: false, 1: 'ISO-8855-1'}, ISO-8859: array{0: false, 1: 'ISO-8859'}} - */ - public function serverEncodingProvider(): array - { - return [ - // Supported encodings - 'UTF-7' => [true, 'UTF-7'], - 'UTF7-IMAP' => [true, 'UTF7-IMAP'], - 'UTF-8' => [true, 'UTF-8'], - 'ASCII' => [true, 'ASCII'], - 'US-ASCII' => [true, 'US-ASCII'], - 'ISO-8859-1' => [true, 'ISO-8859-1'], - // NOT supported encodings - 'UTF7' => [false, 'UTF7'], - 'UTF-7-IMAP' => [false, 'UTF-7-IMAP'], - 'UTF-7IMAP' => [false, 'UTF-7IMAP'], - 'UTF8' => [false, 'UTF8'], - 'USASCII' => [false, 'USASCII'], - 'ASC11' => [false, 'ASC11'], - 'ISO-8859-0' => [false, 'ISO-8859-0'], - 'ISO-8855-1' => [false, 'ISO-8855-1'], - 'ISO-8859' => [false, 'ISO-8859'], - ]; - } - - /** - * Test, that server encoding only can use supported character encodings. - * - * @dataProvider serverEncodingProvider - */ - public function testServerEncodingOnlyUseSupportedSettings(bool $bool, string $encoding): void - { - $mailbox = $this->getMailbox(); - - if ($bool) { - $mailbox->setServerEncoding($encoding); - $this->assertEquals($encoding, $mailbox->getServerEncoding()); - } else { - $this->expectException(InvalidParameterException::class); - $mailbox->setServerEncoding($encoding); - $this->assertNotEquals($encoding, $mailbox->getServerEncoding()); - } - } - - /** - * Test, that the IMAP search option has a default value - * 1 => SE_UID - * 2 => SE_FREE. - */ - public function testImapSearchOptionHasADefault(): void - { - $this->assertEquals($this->getMailbox()->getImapSearchOption(), 1); - } - - /** - * Test, that the IMAP search option can be changed - * 1 => SE_UID - * 2 => SE_FREE. - */ - public function testSetAndGetImapSearchOption(): void - { - $mailbox = $this->getMailbox(); - - $mailbox->setImapSearchOption(SE_FREE); - $this->assertEquals($mailbox->getImapSearchOption(), 2); - - $this->expectException(InvalidParameterException::class); - $mailbox->setImapSearchOption(self::ANYTHING); - - $mailbox->setImapSearchOption(SE_UID); - $this->assertEquals($mailbox->getImapSearchOption(), 1); - } - - /** - * Test, that the imap login can be retrieved. - */ - public function testGetLogin(): void - { - $this->assertEquals($this->getMailbox()->getLogin(), 'php-imap@example.com'); - } - - /** - * Test, that the path delimiter has a default value. - */ - public function testPathDelimiterHasADefault(): void - { - $this->assertNotEmpty($this->getMailbox()->getPathDelimiter()); - } - - /** - * Provides test data for testing path delimiter. - * - * @psalm-return array{0: array{0: '0'}, 1: array{0: '1'}, 2: array{0: '2'}, 3: array{0: '3'}, 4: array{0: '4'}, 5: array{0: '5'}, 6: array{0: '6'}, 7: array{0: '7'}, 8: array{0: '8'}, 9: array{0: '9'}, a: array{0: 'a'}, b: array{0: 'b'}, c: array{0: 'c'}, d: array{0: 'd'}, e: array{0: 'e'}, f: array{0: 'f'}, g: array{0: 'g'}, h: array{0: 'h'}, i: array{0: 'i'}, j: array{0: 'j'}, k: array{0: 'k'}, l: array{0: 'l'}, m: array{0: 'm'}, n: array{0: 'n'}, o: array{0: 'o'}, p: array{0: 'p'}, q: array{0: 'q'}, r: array{0: 'r'}, s: array{0: 's'}, t: array{0: 't'}, u: array{0: 'u'}, v: array{0: 'v'}, w: array{0: 'w'}, x: array{0: 'x'}, y: array{0: 'y'}, z: array{0: 'z'}, !: array{0: '!'}, '\\': array{0: '\'}, $: array{0: '$'}, %: array{0: '%'}, §: array{0: '§'}, &: array{0: '&'}, /: array{0: '/'}, (: array{0: '('}, ): array{0: ')'}, =: array{0: '='}, #: array{0: '#'}, ~: array{0: '~'}, *: array{0: '*'}, +: array{0: '+'}, ,: array{0: ','}, ;: array{0: ';'}, '.': array{0: '.'}, ':': array{0: ':'}, <: array{0: '<'}, >: array{0: '>'}, |: array{0: '|'}, _: array{0: '_'}} - * - * @return string[][] - */ - public function pathDelimiterProvider(): array - { - return [ - '0' => ['0'], - '1' => ['1'], - '2' => ['2'], - '3' => ['3'], - '4' => ['4'], - '5' => ['5'], - '6' => ['6'], - '7' => ['7'], - '8' => ['8'], - '9' => ['9'], - 'a' => ['a'], - 'b' => ['b'], - 'c' => ['c'], - 'd' => ['d'], - 'e' => ['e'], - 'f' => ['f'], - 'g' => ['g'], - 'h' => ['h'], - 'i' => ['i'], - 'j' => ['j'], - 'k' => ['k'], - 'l' => ['l'], - 'm' => ['m'], - 'n' => ['n'], - 'o' => ['o'], - 'p' => ['p'], - 'q' => ['q'], - 'r' => ['r'], - 's' => ['s'], - 't' => ['t'], - 'u' => ['u'], - 'v' => ['v'], - 'w' => ['w'], - 'x' => ['x'], - 'y' => ['y'], - 'z' => ['z'], - '!' => ['!'], - '\\' => ['\\'], - '$' => ['$'], - '%' => ['%'], - '§' => ['§'], - '&' => ['&'], - '/' => ['/'], - '(' => ['('], - ')' => [')'], - '=' => ['='], - '#' => ['#'], - '~' => ['~'], - '*' => ['*'], - '+' => ['+'], - ',' => [','], - ';' => [';'], - '.' => ['.'], - ':' => [':'], - '<' => ['<'], - '>' => ['>'], - '|' => ['|'], - '_' => ['_'], - ]; - } - - /** - * Test, that the path delimiter is checked for supported chars. - * - * @dataProvider pathDelimiterProvider - */ - public function testPathDelimiterIsBeingChecked(string $str): void - { - $supported_delimiters = ['.', '/']; - - $mailbox = $this->getMailbox(); - - if (\in_array($str, $supported_delimiters)) { - $this->assertTrue($mailbox->validatePathDelimiter($str)); - } else { - $this->expectException(InvalidParameterException::class); - $mailbox->setPathDelimiter($str); - } - } - - /** - * Test, that the path delimiter can be set. - */ - public function testSetAndGetPathDelimiter(): void - { - $mailbox = $this->getMailbox(); - - $mailbox->setPathDelimiter('.'); - $this->assertEquals($mailbox->getPathDelimiter(), '.'); - - $mailbox->setPathDelimiter('/'); - $this->assertEquals($mailbox->getPathDelimiter(), '/'); - } - - /** - * Test, that the attachments are not ignored by default. - */ - public function testGetAttachmentsAreNotIgnoredByDefault(): void - { - $this->assertEquals($this->getMailbox()->getAttachmentsIgnore(), false); - } - - /** - * Provides test data for testing attachments ignore. - * - * @psalm-return array - */ - public function attachmentsIgnoreProvider(): array - { - /** @psalm-var array */ - return [ - 'true' => [true], - 'false' => [false], - ]; - } - - /** - * Test, that attachments can be ignored and only valid values are accepted. - * - * @dataProvider attachmentsIgnoreProvider - */ - public function testSetAttachmentsIgnore(bool $paramValue): void - { - $mailbox = $this->getMailbox(); - $mailbox->setAttachmentsIgnore($paramValue); - $this->assertEquals($mailbox->getAttachmentsIgnore(), $paramValue); - } - - /** - * Provides test data for testing encoding. - * - * @psalm-return array{Avañe’ẽ: array{0: 'Avañe’ẽ'}, azərbaycanca: array{0: 'azərbaycanca'}, Bokmål: array{0: 'Bokmål'}, chiCheŵa: array{0: 'chiCheŵa'}, Deutsch: array{0: 'Deutsch'}, 'U.S. English': array{0: 'U.S. English'}, français: array{0: 'français'}, 'Éléments envoyés': array{0: 'Éléments envoyés'}, føroyskt: array{0: 'føroyskt'}, Kĩmĩrũ: array{0: 'Kĩmĩrũ'}, Kɨlaangi: array{0: 'Kɨlaangi'}, oʼzbekcha: array{0: 'oʼzbekcha'}, Plattdüütsch: array{0: 'Plattdüütsch'}, română: array{0: 'română'}, Sängö: array{0: 'Sängö'}, 'Tiếng Việt': array{0: 'Tiếng Việt'}, ɔl-Maa: array{0: 'ɔl-Maa'}, Ελληνικά: array{0: 'Ελληνικά'}, Ўзбек: array{0: 'Ўзбек'}, Азәрбајҹан: array{0: 'Азәрбајҹан'}, Српски: array{0: 'Српски'}, русский: array{0: 'русский'}, 'ѩзыкъ словѣньскъ': array{0: 'ѩзыкъ словѣньскъ'}, العربية: array{0: 'العربية'}, नेपाली: array{0: 'नेपाली'}, 日本語: array{0: '日本語'}, 简体中文: array{0: '简体中文'}, 繁體中文: array{0: '繁體中文'}, 한국어: array{0: '한국어'}, ąčęėįšųūžĄČĘĖĮŠŲŪŽ: array{0: 'ąčęėįšųūžĄČĘĖĮŠŲŪŽ'}} - * - * @return string[][] - */ - public function encodingTestStringsProvider(): array - { - return [ - 'Avañe’ẽ' => ['Avañe’ẽ'], // Guaraní - 'azərbaycanca' => ['azərbaycanca'], // Azerbaijani (Latin) - 'Bokmål' => ['Bokmål'], // Norwegian Bokmål - 'chiCheŵa' => ['chiCheŵa'], // Chewa - 'Deutsch' => ['Deutsch'], // German - 'U.S. English' => ['U.S. English'], // U.S. English - 'français' => ['français'], // French - 'Éléments envoyés' => ['Éléments envoyés'], // issue 499 - 'føroyskt' => ['føroyskt'], // Faroese - 'Kĩmĩrũ' => ['Kĩmĩrũ'], // Kimîîru - 'Kɨlaangi' => ['Kɨlaangi'], // Langi - 'oʼzbekcha' => ['oʼzbekcha'], // Uzbek (Latin) - 'Plattdüütsch' => ['Plattdüütsch'], // Low German - 'română' => ['română'], // Romanian - 'Sängö' => ['Sängö'], // Sango - 'Tiếng Việt' => ['Tiếng Việt'], // Vietnamese - 'ɔl-Maa' => ['ɔl-Maa'], // Masai - 'Ελληνικά' => ['Ελληνικά'], // Greek - 'Ўзбек' => ['Ўзбек'], // Uzbek (Cyrillic) - 'Азәрбајҹан' => ['Азәрбајҹан'], // Azerbaijani (Cyrillic) - 'Српски' => ['Српски'], // Serbian (Cyrillic) - 'русский' => ['русский'], // Russian - 'ѩзыкъ словѣньскъ' => ['ѩзыкъ словѣньскъ'], // Church Slavic - 'العربية' => ['العربية'], // Arabic - 'नेपाली' => ['नेपाली'], // Nepali - '日本語' => ['日本語'], // Japanese - '简体中文' => ['简体中文'], // Chinese (Simplified) - '繁體中文' => ['繁體中文'], // Chinese (Traditional) - '한국어' => ['한국어'], // Korean - 'ąčęėįšųūžĄČĘĖĮŠŲŪŽ' => ['ąčęėįšųūžĄČĘĖĮŠŲŪŽ'], // Lithuanian letters - ]; - } - - /** - * Test, that strings encoded to UTF-7 can be decoded back to UTF-8. - * - * @dataProvider encodingTestStringsProvider - */ - public function testEncodingToUtf7DecodeBackToUtf8(string $str): void - { - $mailbox = $this->getMailbox(); - - $utf7_encoded_str = $mailbox->encodeStringToUtf7Imap($str); - $utf8_decoded_str = $mailbox->decodeStringFromUtf7ImapToUtf8($utf7_encoded_str); - - $this->assertEquals($utf8_decoded_str, $str); - } - - /** - * Test, that strings encoded to UTF-7 can be decoded back to UTF-8. - * - * @dataProvider encodingTestStringsProvider - */ - public function testMimeDecodingReturnsCorrectValues(string $str): void - { - $this->assertEquals($this->getMailbox()->decodeMimeStr($str), $str); - } - - /** - * Provides test data for testing parsing datetimes. - * - * @psalm-return array{'Sun, 14 Aug 2005 16:13:03 +0000 (CEST)': array{0: '2005-08-14T16:13:03+00:00', 1: 1124035983}, 'Sun, 14 Aug 2005 16:13:03 +0000': array{0: '2005-08-14T16:13:03+00:00', 1: 1124035983}, 'Sun, 14 Aug 2005 16:13:03 +1000 (CEST)': array{0: '2005-08-14T06:13:03+00:00', 1: 1123999983}, 'Sun, 14 Aug 2005 16:13:03 +1000': array{0: '2005-08-14T06:13:03+00:00', 1: 1123999983}, 'Sun, 14 Aug 2005 16:13:03 -1000': array{0: '2005-08-15T02:13:03+00:00', 1: 1124071983}, 'Sun, 14 Aug 2005 16:13:03 +1100 (CEST)': array{0: '2005-08-14T05:13:03+00:00', 1: 1123996383}, 'Sun, 14 Aug 2005 16:13:03 +1100': array{0: '2005-08-14T05:13:03+00:00', 1: 1123996383}, 'Sun, 14 Aug 2005 16:13:03 -1100': array{0: '2005-08-15T03:13:03+00:00', 1: 1124075583}, '14 Aug 2005 16:13:03 +1000 (CEST)': array{0: '2005-08-14T06:13:03+00:00', 1: 1123999983}, '14 Aug 2005 16:13:03 +1000': array{0: '2005-08-14T06:13:03+00:00', 1: 1123999983}, '14 Aug 2005 16:13:03 -1000': array{0: '2005-08-15T02:13:03+00:00', 1: 1124071983}} - * - * @return (int|string)[][] - */ - public function datetimeProvider(): array - { - return [ - 'Sun, 14 Aug 2005 16:13:03 +0000 (CEST)' => ['2005-08-14T16:13:03+00:00', 1124035983], - 'Sun, 14 Aug 2005 16:13:03 +0000' => ['2005-08-14T16:13:03+00:00', 1124035983], - - 'Sun, 14 Aug 2005 16:13:03 +1000 (CEST)' => ['2005-08-14T06:13:03+00:00', 1123999983], - 'Sun, 14 Aug 2005 16:13:03 +1000' => ['2005-08-14T06:13:03+00:00', 1123999983], - 'Sun, 14 Aug 2005 16:13:03 -1000' => ['2005-08-15T02:13:03+00:00', 1124071983], - - 'Sun, 14 Aug 2005 16:13:03 +1100 (CEST)' => ['2005-08-14T05:13:03+00:00', 1123996383], - 'Sun, 14 Aug 2005 16:13:03 +1100' => ['2005-08-14T05:13:03+00:00', 1123996383], - 'Sun, 14 Aug 2005 16:13:03 -1100' => ['2005-08-15T03:13:03+00:00', 1124075583], - - '14 Aug 2005 16:13:03 +1000 (CEST)' => ['2005-08-14T06:13:03+00:00', 1123999983], - '14 Aug 2005 16:13:03 +1000' => ['2005-08-14T06:13:03+00:00', 1123999983], - '14 Aug 2005 16:13:03 -1000' => ['2005-08-15T02:13:03+00:00', 1124071983], - ]; - } - - /** - * Test, different datetimes conversions using differents timezones. - * - * @dataProvider datetimeProvider - */ - public function testParsedDateDifferentTimeZones(string $dateToParse, int $epochToCompare): void - { - $parsedDt = $this->getMailbox()->parseDateTime($dateToParse); - $parsedDateTime = new DateTime($parsedDt); - $this->assertEquals((int) $parsedDateTime->format('U'), $epochToCompare); - } - - /** - * Provides test data for testing parsing invalid / unparseable datetimes. - * - * @psalm-return array{'Sun, 14 Aug 2005 16:13:03 +9000 (CEST)': array{0: 'Sun, 14 Aug 2005 16:13:03 +9000 (CEST)'}, 'Sun, 14 Aug 2005 16:13:03 +9000': array{0: 'Sun, 14 Aug 2005 16:13:03 +9000'}, 'Sun, 14 Aug 2005 16:13:03 -9000': array{0: 'Sun, 14 Aug 2005 16:13:03 -9000'}} - * - * @return string[][] - */ - public function invalidDatetimeProvider(): array - { - return [ - 'Sun, 14 Aug 2005 16:13:03 +9000 (CEST)' => ['Sun, 14 Aug 2005 16:13:03 +9000 (CEST)'], - 'Sun, 14 Aug 2005 16:13:03 +9000' => ['Sun, 14 Aug 2005 16:13:03 +9000'], - 'Sun, 14 Aug 2005 16:13:03 -9000' => ['Sun, 14 Aug 2005 16:13:03 -9000'], - ]; - } - - /** - * Test, different invalid / unparseable datetimes conversions. - * - * @dataProvider invalidDatetimeProvider - */ - public function testParsedDateWithUnparseableDateTime(string $dateToParse): void - { - $parsedDt = $this->getMailbox()->parseDateTime($dateToParse); - $this->assertEquals($parsedDt, $dateToParse); - } - - /** - * Test, parsed datetime being emtpy the header date. - */ - public function testParsedDateTimeWithEmptyHeaderDate(): void - { - $this->expectException(InvalidParameterException::class); - $this->getMailbox()->parseDateTime(''); - } - - /** - * Provides test data for testing mime encoding. - * - * @return string[][] - * - * @psalm-return array{0: array{0: '=?iso-8859-1?Q?Sebastian_Kr=E4tzig?= ', 1: 'Sebastian Krätzig '}, 1: array{0: '=?iso-8859-1?Q?Sebastian_Kr=E4tzig?=', 1: 'Sebastian Krätzig'}, 2: array{0: 'sebastian.kraetzig', 1: 'sebastian.kraetzig'}, 3: array{0: '=?US-ASCII?Q?Keith_Moore?= ', 1: 'Keith Moore '}, 4: array{0: ' ', 1: ' '}, 5: array{0: '=?ISO-8859-1?Q?Max_J=F8rn_Simsen?= ', 1: 'Max Jørn Simsen '}, 6: array{0: '=?ISO-8859-1?Q?Andr=E9?= Muster ', 1: 'André Muster '}, 7: array{0: '=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=', 1: 'If you can read this you understand the example.'}, 8: array{0: '', 1: ''}} - */ - public function mimeEncodingProvider(): array - { - return [ - ['=?iso-8859-1?Q?Sebastian_Kr=E4tzig?= ', 'Sebastian Krätzig '], - ['=?iso-8859-1?Q?Sebastian_Kr=E4tzig?=', 'Sebastian Krätzig'], - ['sebastian.kraetzig', 'sebastian.kraetzig'], - ['=?US-ASCII?Q?Keith_Moore?= ', 'Keith Moore '], - [' ', ' '], - ['=?ISO-8859-1?Q?Max_J=F8rn_Simsen?= ', 'Max Jørn Simsen '], - ['=?ISO-8859-1?Q?Andr=E9?= Muster ', 'André Muster '], - ['=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=', 'If you can read this you understand the example.'], - ['', ''], // barbushin/php-imap#501 - ]; - } - - /** - * Test, that mime encoding returns correct strings. - * - * @dataProvider mimeEncodingProvider - */ - public function testMimeEncoding(string $str, string $expected): void - { - $mailbox = $this->getMailbox(); - - $this->assertEquals($mailbox->decodeMimeStr($str), $expected); - } - - /** - * Provides test data for testing timeouts. - * - * @psalm-return array}> - */ - public function timeoutsProvider(): array - { - /** @psalm-var array}> */ - return [ - 'array(IMAP_OPENTIMEOUT)' => ['assertNull', 1, [IMAP_OPENTIMEOUT]], - 'array(IMAP_READTIMEOUT)' => ['assertNull', 1, [IMAP_READTIMEOUT]], - 'array(IMAP_WRITETIMEOUT)' => ['assertNull', 1, [IMAP_WRITETIMEOUT]], - 'array(IMAP_CLOSETIMEOUT)' => ['assertNull', 1, [IMAP_CLOSETIMEOUT]], - 'array(IMAP_OPENTIMEOUT, IMAP_READTIMEOUT, IMAP_WRITETIMEOUT, IMAP_CLOSETIMEOUT)' => ['assertNull', 1, [IMAP_OPENTIMEOUT, IMAP_READTIMEOUT, IMAP_WRITETIMEOUT, IMAP_CLOSETIMEOUT]], - ]; - } - - /** - * Test, that only supported timeouts can be set. - * - * @dataProvider timeoutsProvider - * - * @param int[] $types - * - * @psalm-param 'assertNull'|'expectException' $assertMethod - * @psalm-param list<1|2|3|4> $types - */ - public function testSetTimeouts(string $assertMethod, int $timeout, array $types): void - { - $mailbox = $this->getMailbox(); - - if ('expectException' == $assertMethod) { - $this->expectException(InvalidParameterException::class); - $mailbox->setTimeouts($timeout, $types); - } else { - $this->assertNull($mailbox->setTimeouts($timeout, $types)); - } - } - - /** - * Provides test data for testing connection args. - * - * @psalm-return Generator}, mixed, void> - */ - public function connectionArgsProvider(): Generator - { - yield from [ - 'readonly, disable gssapi' => ['assertNull', OP_READONLY, 0, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'anonymous, disable gssapi' => ['assertNull', OP_ANONYMOUS, 0, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'half open, disable gssapi' => ['assertNull', OP_HALFOPEN, 0, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'expunge on close, disable gssapi' => ['assertNull', CL_EXPUNGE, 0, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'debug, disable gssapi' => ['assertNull', OP_DEBUG, 0, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'short cache, disable gssapi' => ['assertNull', OP_SHORTCACHE, 0, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'silent, disable gssapi' => ['assertNull', OP_SILENT, 0, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'return driver prototype, disable gssapi' => ['assertNull', OP_PROTOTYPE, 0, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'don\'t do non-secure authentication, disable gssapi' => ['assertNull', OP_SECURE, 0, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'readonly, disable gssapi, 1 retry' => ['assertNull', OP_READONLY, 1, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'readonly, disable gssapi, 3 retries' => ['assertNull', OP_READONLY, 3, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'readonly, disable gssapi, 12 retries' => ['assertNull', OP_READONLY, 12, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'readonly debug, disable gssapi' => ['assertNull', OP_READONLY | OP_DEBUG, 0, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'readonly, -1 retries' => ['expectException', OP_READONLY, -1, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'readonly, -3 retries' => ['expectException', OP_READONLY, -3, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'readonly, -12 retries' => ['expectException', OP_READONLY, -12, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']], - 'readonly, null options' => ['expectException', OP_READONLY, 0, [null]], - ]; - - /** @psalm-var list */ - $options = [ - [OP_DEBUG, 'debug'], // 1 - [OP_READONLY, 'readonly'], // 2 - [OP_ANONYMOUS, 'anonymous'], // 4 - [OP_SHORTCACHE, 'short cache'], // 8 - [OP_SILENT, 'silent'], // 16 - [OP_PROTOTYPE, 'return driver prototype'], // 32 - [OP_HALFOPEN, 'half-open'], // 64 - [OP_SECURE, 'don\'t do non-secure authnetication'], // 256 - [CL_EXPUNGE, 'expunge on close'], // 32768 - ]; - - foreach ($options as $i => $option) { - $value = $option[0]; - - for ($j = $i + 1; $j < \count($options); ++$j) { - $value |= $options[$j][0]; - - $fields = []; - - foreach ($options as $option) { - if (0 !== ($value & $option[0])) { - $fields[] = $option[1]; - } - } - - $key = \implode(', ', $fields); - - yield $key => ['assertNull', $value, 0, []]; - yield ('INVALID + '.$key) => ['expectException', $value | 128, 0, []]; - } - } - } - - /** - * Test, that only supported and valid connection args can be set. - * - * @dataProvider connectionArgsProvider - * - * @psalm-param array{DISABLE_AUTHENTICATOR?:string}|array $param - */ - public function testSetConnectionArgs(string $assertMethod, int $option, int $retriesNum, array $param = null): void - { - $mailbox = $this->getMailbox(); - - if ('expectException' == $assertMethod) { - $this->expectException(InvalidParameterException::class); - $mailbox->setConnectionArgs($option, $retriesNum, $param); - $this->assertSame($option, $mailbox->getImapOptions()); - } elseif ('assertNull' == $assertMethod) { - $this->assertNull($mailbox->setConnectionArgs($option, $retriesNum, $param)); - } - - $mailbox->disconnect(); - } - - /** - * Provides test data for testing mime string decoding. - * - * @psalm-return array{'': array{0: '', 1: ''}, '': array{0: '', 1: ''}, '': array{0: '', 1: ''}, '': array{0: '', 1: ''}, 'Some subject here 😘': array{0: '=?UTF-8?q?Some_subject_here_?= =?UTF-8?q?=F0=9F=98=98?=', 1: 'Some subject here 😘'}, mountainguan测试: array{0: '=?UTF-8?Q?mountainguan=E6=B5=8B=E8=AF=95?=', 1: 'mountainguan测试'}, 'This is the Euro symbol \'\'.': array{0: 'This is the Euro symbol ''.', 1: 'This is the Euro symbol ''.'}, 'Some subject here 😘 US-ASCII': array{0: '=?UTF-8?q?Some_subject_here_?= =?UTF-8?q?=F0=9F=98=98?=', 1: 'Some subject here 😘', 2: 'US-ASCII'}, 'mountainguan测试 US-ASCII': array{0: '=?UTF-8?Q?mountainguan=E6=B5=8B=E8=AF=95?=', 1: 'mountainguan测试', 2: 'US-ASCII'}, 'مقتطفات من: صن تزو. \"فن الحرب\". كتب أبل. Something': array{0: 'مقتطفات من: صن تزو. "فن الحرب". كتب أبل. Something', 1: 'مقتطفات من: صن تزو. "فن الحرب". كتب أبل. Something'}, '(事件单编号:TESTA-111111)(通报)入口有陌生人': array{0: '=?utf-8?b?KOS6i+S7tuWNlee8luWPtzpURVNUQS0xMTExMTEpKOmAmuaKpSnl?= =?utf-8?b?haXlj6PmnInpmYznlJ/kuro=?=', 1: '(事件单编号:TESTA-111111)(通报)入口有陌生人'}} - * - * @return string[][] - */ - public function mimeStrDecodingProvider(): array - { - return [ - '' => ['', ''], - '' => ['', ''], - '' => ['', ''], - '' => ['', ''], - 'Some subject here 😘' => ['=?UTF-8?q?Some_subject_here_?= =?UTF-8?q?=F0=9F=98=98?=', 'Some subject here 😘'], - 'mountainguan测试' => ['=?UTF-8?Q?mountainguan=E6=B5=8B=E8=AF=95?=', 'mountainguan测试'], - "This is the Euro symbol ''." => ["This is the Euro symbol ''.", "This is the Euro symbol ''."], - 'Some subject here 😘 US-ASCII' => ['=?UTF-8?q?Some_subject_here_?= =?UTF-8?q?=F0=9F=98=98?=', 'Some subject here 😘', 'US-ASCII'], - 'mountainguan测试 US-ASCII' => ['=?UTF-8?Q?mountainguan=E6=B5=8B=E8=AF=95?=', 'mountainguan测试', 'US-ASCII'], - 'مقتطفات من: صن تزو. "فن الحرب". كتب أبل. Something' => ['مقتطفات من: صن تزو. "فن الحرب". كتب أبل. Something', 'مقتطفات من: صن تزو. "فن الحرب". كتب أبل. Something'], - '(事件单编号:TESTA-111111)(通报)入口有陌生人' => ['=?utf-8?b?KOS6i+S7tuWNlee8luWPtzpURVNUQS0xMTExMTEpKOmAmuaKpSnl?= =?utf-8?b?haXlj6PmnInpmYznlJ/kuro=?=', '(事件单编号:TESTA-111111)(通报)入口有陌生人'], - ]; - } - - /** - * Test, that decoding mime strings return unchanged / not broken strings. - * - * @dataProvider mimeStrDecodingProvider - */ - public function testDecodeMimeStr(string $str, string $expectedStr, string $serverEncoding = 'utf-8'): void - { - $mailbox = $this->getMailbox(); - - $mailbox->setServerEncoding($serverEncoding); - $this->assertEquals($mailbox->decodeMimeStr($str), $expectedStr); - } - - /** - * Provides test data for testing base64 string decoding. - * - * @psalm-return array{0: array{0: 'bm8tcmVwbHlAZXhhbXBsZS5jb20=', 1: 'no-reply@example.com'}, 1: array{0: 'TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=', 1: 'Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.'}, 2: array{0: 'SSBjYW4gZWF0IGdsYXNzIGFuZCBpdCBkb2VzIG5vdCBodXJ0IG1lLg==', 1: 'I can eat glass and it does not hurt me.'}, 3: array{0: '77u/4KSV4KS+4KSa4KSCIOCktuCkleCljeCkqOCli+CkruCljeCkr+CkpOCljeCkpOClgeCkruCljSDgpaQg4KSo4KWL4KSq4KS54KS/4KSo4KS44KWN4KSk4KS/IOCkruCkvuCkruCljSDgpaU=', 1: 'काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम् ॥'}, 4: array{0: 'SmUgcGV1eCBtYW5nZXIgZHUgdmVycmUsIMOnYSBuZSBtZSBmYWl0IHBhcyBtYWwu', 1: 'Je peux manger du verre, ça ne me fait pas mal.'}, 5: array{0: 'UG90IHPEgyBtxINuw6JuYyBzdGljbMSDIMiZaSBlYSBudSBtxIMgcsSDbmXImXRlLg==', 1: 'Pot să mănânc sticlă și ea nu mă rănește.'}, 6: array{0: '5oiR6IO95ZCe5LiL546755KD6ICM5LiN5YK36Lqr6auU44CC', 1: '我能吞下玻璃而不傷身體。'}} - * - * @return string[][] - */ - public function Base64DecodeProvider(): array - { - return [ - ['bm8tcmVwbHlAZXhhbXBsZS5jb20=', 'no-reply@example.com'], - ['TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=', 'Man is distinguished, not only by his reason, but by this singular passion from other animals, which is a lust of the mind, that by a perseverance of delight in the continued and indefatigable generation of knowledge, exceeds the short vehemence of any carnal pleasure.'], - ['SSBjYW4gZWF0IGdsYXNzIGFuZCBpdCBkb2VzIG5vdCBodXJ0IG1lLg==', 'I can eat glass and it does not hurt me.'], - ['77u/4KSV4KS+4KSa4KSCIOCktuCkleCljeCkqOCli+CkruCljeCkr+CkpOCljeCkpOClgeCkruCljSDgpaQg4KSo4KWL4KSq4KS54KS/4KSo4KS44KWN4KSk4KS/IOCkruCkvuCkruCljSDgpaU=', 'काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम् ॥'], - ['SmUgcGV1eCBtYW5nZXIgZHUgdmVycmUsIMOnYSBuZSBtZSBmYWl0IHBhcyBtYWwu', 'Je peux manger du verre, ça ne me fait pas mal.'], - ['UG90IHPEgyBtxINuw6JuYyBzdGljbMSDIMiZaSBlYSBudSBtxIMgcsSDbmXImXRlLg==', 'Pot să mănânc sticlă și ea nu mă rănește.'], - ['5oiR6IO95ZCe5LiL546755KD6ICM5LiN5YK36Lqr6auU44CC', '我能吞下玻璃而不傷身體。'], - ]; - } - - /** - * @dataProvider Base64DecodeProvider - */ - public function testBase64Decode(string $input, string $expected): void - { - $this->assertSame($expected, \imap_base64(\preg_replace('~[^a-zA-Z0-9+=/]+~s', '', $input))); - $this->assertSame($expected, \base64_decode($input, false)); - } - - /** - * @psalm-return array{0: array{0: string, 1: '', 2: Exceptions\InvalidParameterException::class, 3: 'setAttachmentsDir() expects a string as first parameter!'}, 1: array{0: string, 1: ' ', 2: Exceptions\InvalidParameterException::class, 3: 'setAttachmentsDir() expects a string as first parameter!'}, 2: array{0: string, 1: string, 2: Exceptions\InvalidParameterException::class, 3: string}} - * - * @return string[][] - */ - public function attachmentDirFailureProvider(): array - { - return [ - [ - __DIR__, - '', - InvalidParameterException::class, - 'setAttachmentsDir() expects a string as first parameter!', - ], - [ - __DIR__, - ' ', - InvalidParameterException::class, - 'setAttachmentsDir() expects a string as first parameter!', - ], - [ - __DIR__, - __FILE__, - InvalidParameterException::class, - 'Directory "'.__FILE__.'" not found', - ], - ]; - } - - /** - * Test that setting the attachments directory fails when expected. - * - * @dataProvider attachmentDirFailureProvider - * - * @psalm-param class-string<\Exception> $expectedException - */ - public function testAttachmentDirFailure(string $initialDir, string $attachmentsDir, string $expectedException, string $expectedExceptionMessage): void - { - $mailbox = new Mailbox('', '', '', $initialDir); - - $this->assertSame(\trim($initialDir), $mailbox->getAttachmentsDir()); - - $this->expectException($expectedException); - $this->expectExceptionMessage($expectedExceptionMessage); - - $mailbox->setAttachmentsDir($attachmentsDir); - } - - protected function getMailbox(): Fixtures\Mailbox - { - return new Fixtures\Mailbox($this->imapPath, $this->login, $this->password, $this->attachmentsDir, $this->serverEncoding); - } -} diff --git a/vendor/phpmailer/phpmailer/README.md b/vendor/phpmailer/phpmailer/README.md index 53e66f1..878274f 100644 --- a/vendor/phpmailer/phpmailer/README.md +++ b/vendor/phpmailer/phpmailer/README.md @@ -47,7 +47,7 @@ This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lg PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: ```json -"phpmailer/phpmailer": "^6.8.0" +"phpmailer/phpmailer": "^6.8.1" ``` or run @@ -150,7 +150,7 @@ PHPMailer defaults to English, but in the [language](https://github.com/PHPMaile $mail->setLanguage('fr', '/optional/path/to/language/directory/'); ``` -We welcome corrections and new languages – if you're looking for corrections, run the [PHPMailerLangTest.php](https://github.com/PHPMailer/PHPMailer/tree/master/test/PHPMailerLangTest.php) script in the tests folder and it will show any missing translations. +We welcome corrections and new languages – if you're looking for corrections, run the [Language/TranslationCompletenessTest.php](https://github.com/PHPMailer/PHPMailer/blob/master/test/Language/TranslationCompletenessTest.php) script in the tests folder and it will show any missing translations. ## Documentation Start reading at the [GitHub wiki](https://github.com/PHPMailer/PHPMailer/wiki). If you're having trouble, head for [the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting) as it's frequently updated. diff --git a/vendor/phpmailer/phpmailer/VERSION b/vendor/phpmailer/phpmailer/VERSION index 8a1c5c7..23863d3 100644 --- a/vendor/phpmailer/phpmailer/VERSION +++ b/vendor/phpmailer/phpmailer/VERSION @@ -1 +1 @@ -6.8.0 \ No newline at end of file +6.8.1 \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php index 243c054..6d1e637 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php @@ -20,7 +20,6 @@ $PHPMAILER_LANG['instantiate'] = 'mail-funktion luonti epäonnistui.'; $PHPMAILER_LANG['mailer_not_supported'] = 'postivälitintyyppiä ei tueta.'; $PHPMAILER_LANG['provide_address'] = 'Aseta vähintään yksi vastaanottajan sähköpostiosoite.'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.'; -$PHPMAILER_LANG['encoding'] = 'Tuntematon koodaustyyppi: '; //$PHPMAILER_LANG['signing'] = 'Signing Error: '; //$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; //$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php index 38a7a8e..0d367fc 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php @@ -35,4 +35,3 @@ $PHPMAILER_LANG['smtp_connect_failed'] = 'La fonction SMTP connect() a échoué $PHPMAILER_LANG['smtp_detail'] = 'Détails : '; $PHPMAILER_LANG['smtp_error'] = 'Erreur du serveur SMTP : '; $PHPMAILER_LANG['variable_set'] = 'Impossible d’initialiser ou de réinitialiser une variable : '; -$PHPMAILER_LANG['extension_missing'] = 'Extension manquante : '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php index 89926bd..03d4911 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php @@ -24,7 +24,6 @@ $PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是 $PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; $PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; $PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; -$PHPMAILER_LANG['signing'] = '登录失败:'; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。'; $PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:'; $PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:'; diff --git a/vendor/phpmailer/phpmailer/src/DSNConfigurator.php b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php index ab707d2..566c961 100644 --- a/vendor/phpmailer/phpmailer/src/DSNConfigurator.php +++ b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php @@ -80,9 +80,7 @@ class DSNConfigurator $config = $this->parseUrl($dsn); if (false === $config || !isset($config['scheme']) || !isset($config['host'])) { - throw new Exception( - sprintf('Malformed DSN: "%s".', $dsn) - ); + throw new Exception('Malformed DSN'); } if (isset($config['query'])) { diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php index 81a2d66..4d8de3d 100644 --- a/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -750,7 +750,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.8.0'; + const VERSION = '6.8.1'; /** * Error severity: message only, continue processing. @@ -1571,6 +1571,10 @@ class PHPMailer //Validate From, Sender, and ConfirmReadingTo addresses foreach (['From', 'Sender', 'ConfirmReadingTo'] as $address_kind) { + if ($this->{$address_kind} === null) { + $this->{$address_kind} = ''; + continue; + } $this->{$address_kind} = trim($this->{$address_kind}); if (empty($this->{$address_kind})) { continue; diff --git a/vendor/phpmailer/phpmailer/src/POP3.php b/vendor/phpmailer/phpmailer/src/POP3.php index d025689..b92a1f2 100644 --- a/vendor/phpmailer/phpmailer/src/POP3.php +++ b/vendor/phpmailer/phpmailer/src/POP3.php @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.8.0'; + const VERSION = '6.8.1'; /** * Default POP3 port number. diff --git a/vendor/phpmailer/phpmailer/src/SMTP.php b/vendor/phpmailer/phpmailer/src/SMTP.php index fc4b781..2b63840 100644 --- a/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/vendor/phpmailer/phpmailer/src/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.8.0'; + const VERSION = '6.8.1'; /** * SMTP line break constant. @@ -704,7 +704,7 @@ class SMTP * Send an SMTP DATA command. * Issues a data command and sends the msg_data to the server, * finalizing the mail transaction. $msg_data is the message - * that is to be send with the headers. Each header needs to be + * that is to be sent with the headers. Each header needs to be * on a single line followed by a with the message headers * and the message body being separated by an additional . * Implements RFC 821: DATA . @@ -732,7 +732,7 @@ class SMTP $lines = explode("\n", str_replace(["\r\n", "\r"], "\n", $msg_data)); /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field - * of the first line (':' separated) does not contain a space then it _should_ be a header and we will + * of the first line (':' separated) does not contain a space then it _should_ be a header, and we will * process all lines before a blank line as headers. */ diff --git a/vendor/tinymce/tinymce/CHANGELOG.md b/vendor/tinymce/tinymce/CHANGELOG.md index 73b855d..73e5189 100644 --- a/vendor/tinymce/tinymce/CHANGELOG.md +++ b/vendor/tinymce/tinymce/CHANGELOG.md @@ -6,19 +6,202 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## 6.7.0 - 2023-08-30 + +### Added +- New `help_accessibility` option displays the keyboard shortcut to open the in-application help in the status bar. #TINY-9379 +- Added a new `InsertNewBlockBefore` command which inserts an empty block before the block containing the current selection. #TINY-10022 +- Added a new `InsertNewBlockAfter` command which inserts an empty block after the block containing the current selection. #TINY-10022 + +### Improved +- Adding a newline after a table would, in some specific cases, not work. #TINY-9863 +- Menus now have a slight margin at the top and bottom to more clearly separate them from the frame edge. #TINY-9978 +- Updated **More** toolbar button tooltip text from *More...* to *Reveal or hide additional toolbar items*. #TINY-9629 +- Where multiple case sensitive variants of a translation key are provided, they will now all be preserved in the translation object instead of just the lowercase variant. #TINY-10115 +- Improved screen reader announcements of the column and row selection in the grid presented by the **Table** menu and toolbar item. #TINY-10140 +- Improved the keyboard focus visibility for links inside dialogs. #TINY-10124 + +### Changed +- Change `UndoLevelType` from `enum` to union type so that it is easier to use. #TINY-9764 +- The pattern replacement removed spaces if they were contained within a tag that only contained a space and the text to replace. #TINY-9744 +- If loading content CSS takes more than 500ms, the editor will be set to an *in progress* state until the CSS is ready. #TINY-10008 + +### Fixed +- Applying an ordered or unordered list to a selected checklist incorrectly turned the list into paragraphs. #TINY-9975 +- Returning an empty string in a custom context menu update function resulted in a small white line appearing on right-click and the browser-native context menu would not present. #TINY-9842 +- For sufficiently long URLs and sufficiently wide windows, URL autocompletion hid middle portions of the URL from view. #TINY-10017 +- Numeric input in toolbar items did not disable when a switching from edit to read-only mode. #TINY-10129 +- The Quick Toolbars plugin showed text alignment buttons on pagebreaks. #TINY-10054 +- Creating lists in empty blocks sometimes, and incorrectly, converted adjacent block elements into list items. #TINY-10136 +- Creating a list from multiple `
    ` elements only created a partial list. #TINY-9872 +- Tab navigation incorrectly stopped around `iframe` dialog components. #TINY-9815 +- It was possible to delete the sole empty block immediately before a `
    ` element if it was nested within another `
    ` element. #TINY-9965 +- Deleting `
  • ` elements that only contained `
    ` tags sometimes caused a crash. #TINY-6888 +- It was possible to remove the `` element from a `
    ` element by dragging and dropping. #TINY-9960 +- It was possible to break `` elements if content containing block elements was dragged-and-dropped inside them. #TINY-9960 +- Contents were not removed from the drag start source if dragging and dropping internally into a transparent block element. #TINY-9960 +- Using the Media plugin unexpectedly changed `'; - }; const dataToHtml = (editor, dataIn) => { var _a; const data = global$5.extend({}, dataIn); @@ -572,8 +579,6 @@ return getFlashHtml(data); } else if (data.sourcemime.indexOf('audio') !== -1) { return getAudioHtml(data, audioTemplateCallback); - } else if (data.type === 'script') { - return getScriptHtml(data); } else { return getVideoHtml(data, videoTemplateCallback); } @@ -590,12 +595,6 @@ } } }); - editor.on('ObjectSelected', e => { - const objectType = e.target.getAttribute('data-mce-object'); - if (objectType === 'script') { - e.preventDefault(); - } - }); editor.on('ObjectResized', e => { const target = e.target; if (target.getAttribute('data-mce-object')) { @@ -702,9 +701,23 @@ const getEditorData = editor => { const element = editor.selection.getNode(); const snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : ''; + const data = htmlToData(snippet, editor.schema); + const getDimensionsOfElement = () => { + if (isEmbedIframe(data.source, data.type)) { + const rect = editor.dom.getRect(element); + return { + width: rect.w.toString().replace(/px$/, ''), + height: rect.h.toString().replace(/px$/, '') + }; + } else { + return {}; + } + }; + const dimensions = getDimensionsOfElement(); return { embed: snippet, - ...htmlToData(snippet, editor.schema) + ...data, + ...dimensions }; }; const addEmbedHtml = (api, editor) => response => { @@ -736,9 +749,17 @@ selectPlaceholder(editor, beforeObjects); editor.nodeChanged(); }; + const isEmbedIframe = (url, mediaDataType) => isNonNullable(mediaDataType) && mediaDataType === 'ephox-embed-iri' && isNonNullable(matchPattern(url)); + const shouldInsertAsNewIframe = (prevData, newData) => { + const hasDimensionsChanged = (prevData, newData) => prevData.width !== newData.width || prevData.height !== newData.height; + return hasDimensionsChanged(prevData, newData) && isEmbedIframe(newData.source, prevData.type); + }; const submitForm = (prevData, newData, editor) => { var _a; - newData.embed = updateHtml((_a = newData.embed) !== null && _a !== void 0 ? _a : '', newData, false, editor.schema); + newData.embed = shouldInsertAsNewIframe(prevData, newData) && hasDimensions(editor) ? dataToHtml(editor, { + ...newData, + embed: '' + }) : updateHtml((_a = newData.embed) !== null && _a !== void 0 ? _a : '', newData, false, editor.schema); if (newData.embed && (prevData.source === newData.source || isCached(newData.source))) { handleInsert(editor, newData.embed); } else { @@ -767,8 +788,12 @@ const dataFromEmbed = htmlToData((_a = data.embed) !== null && _a !== void 0 ? _a : '', editor.schema); api.setData(wrap(dataFromEmbed)); }; - const handleUpdate = (api, sourceInput) => { - const data = unwrap(api.getData(), sourceInput); + const handleUpdate = (api, sourceInput, prevData) => { + const dialogData = unwrap(api.getData(), sourceInput); + const data = shouldInsertAsNewIframe(prevData, dialogData) && hasDimensions(editor) ? { + ...dialogData, + embed: '' + } : dialogData; const embed = dataToHtml(editor, data); api.setData(wrap({ ...data, @@ -870,7 +895,7 @@ case 'dimensions': case 'altsource': case 'poster': - handleUpdate(api, detail.name); + handleUpdate(api, detail.name, currentData.get()); break; } currentData.set(unwrap(api.getData())); @@ -1076,7 +1101,7 @@ }); } }); - parser.addNodeFilter('iframe,video,audio,object,embed,script', placeHolderConverter(editor)); + parser.addNodeFilter('iframe,video,audio,object,embed', placeHolderConverter(editor)); serializer.addAttributeFilter('data-mce-object', (nodes, name) => { var _a; let i = nodes.length; @@ -1087,7 +1112,7 @@ } const realElmName = node.attr(name); const realElm = new global$2(realElmName, 1); - if (realElmName !== 'audio' && realElmName !== 'script') { + if (realElmName !== 'audio') { const className = node.attr('class'); if (className && className.indexOf('mce-preview-object') !== -1 && node.firstChild) { realElm.attr({ @@ -1110,9 +1135,6 @@ realElm.attr(attrName.substr(11), attribs[ai].value); } } - if (realElmName === 'script') { - realElm.attr('type', 'text/javascript'); - } const innerHtml = node.attr('data-mce-html'); if (innerHtml) { const fragment = parseAndSanitize(editor, realElmName, unescape(innerHtml)); @@ -1141,6 +1163,16 @@ }); }; + const onSetupEditable = editor => api => { + const nodeChanged = () => { + api.setEnabled(editor.selection.isEditable()); + }; + editor.on('NodeChange', nodeChanged); + nodeChanged(); + return () => { + editor.off('NodeChange', nodeChanged); + }; + }; const register = editor => { const onAction = () => editor.execCommand('mceMedia'); editor.ui.registry.addToggleButton('media', { @@ -1150,13 +1182,19 @@ onSetup: buttonApi => { const selection = editor.selection; buttonApi.setActive(isMediaElement(selection.getNode())); - return selection.selectorChangedWithUnbind('img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]', buttonApi.setActive).unbind; + const unbindSelectorChanged = selection.selectorChangedWithUnbind('img[data-mce-object],span[data-mce-object],div[data-ephox-embed-iri]', buttonApi.setActive).unbind; + const unbindEditable = onSetupEditable(editor)(buttonApi); + return () => { + unbindSelectorChanged(); + unbindEditable(); + }; } }); editor.ui.registry.addMenuItem('media', { icon: 'embed', text: 'Media...', - onAction + onAction, + onSetup: onSetupEditable(editor) }); }; diff --git a/vendor/tinymce/tinymce/plugins/media/plugin.min.js b/vendor/tinymce/tinymce/plugins/media/plugin.min.js index 340c0a3..9287e0b 100644 --- a/vendor/tinymce/tinymce/plugins/media/plugin.min.js +++ b/vendor/tinymce/tinymce/plugins/media/plugin.min.js @@ -1,4 +1,4 @@ /** - * TinyMCE version 6.4.2 (2023-04-26) + * TinyMCE version 6.7.0 (2023-08-30) */ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(r=a=e,(o=String).prototype.isPrototypeOf(r)||(null===(s=a.constructor)||void 0===s?void 0:s.name)===o.name)?"string":t;var r,a,o,s})(t)===e,r=t("string"),a=t("object"),o=t("array"),s=e=>!(e=>null==e)(e);class i{constructor(e,t){this.tag=e,this.value=t}static some(e){return new i(!0,e)}static none(){return i.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?i.some(e(this.value)):i.none()}bind(e){return this.tag?e(this.value):i.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:i.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return s(e)?i.some(e):i.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}i.singletonNone=new i(!1);const n=Array.prototype.push,c=(e,t)=>{for(let r=0,a=e.length;r{const t=[];for(let r=0,a=e.length;rh(e,t)?i.from(e[t]):i.none(),h=(e,t)=>u.call(e,t),p=e=>t=>t.options.get(e),g=p("audio_template_callback"),b=p("video_template_callback"),w=p("iframe_template_callback"),v=p("media_live_embeds"),f=p("media_filter_html"),y=p("media_url_resolver"),x=p("media_alt_source"),_=p("media_poster"),j=p("media_dimensions");var k=tinymce.util.Tools.resolve("tinymce.util.Tools"),O=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),A=tinymce.util.Tools.resolve("tinymce.html.DomParser");const S=O.DOM,C=e=>e.replace(/px$/,""),D=e=>{const t=e.attr("style"),r=t?S.parseStyle(t):{};return{type:"ephox-embed-iri",source:e.attr("data-ephox-embed-iri"),altsource:"",poster:"",width:d(r,"max-width").map(C).getOr(""),height:d(r,"max-height").map(C).getOr("")}},T=(e,t)=>{let r={};for(let a=A({validate:!1,forced_root_block:!1},t).parse(e);a;a=a.walk())if(1===a.type){const e=a.name;if(a.attr("data-ephox-embed-iri")){r=D(a);break}r.source||"param"!==e||(r.source=a.attr("movie")),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(r.type||(r.type=e),r=k.extend(a.attributes.map,r)),"script"===e&&(r={type:"script",source:a.attr("src")}),"source"===e&&(r.source?r.altsource||(r.altsource=a.attr("src")):r.source=a.attr("src")),"img"!==e||r.poster||(r.poster=a.attr("src"))}return r.source=r.source||r.src||"",r.altsource=r.altsource||"",r.poster=r.poster||"",r},z=e=>{var t;const r=null!==(t=e.toLowerCase().split(".").pop())&&void 0!==t?t:"";return d({mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"},r).getOr("")};var $=tinymce.util.Tools.resolve("tinymce.html.Node"),M=tinymce.util.Tools.resolve("tinymce.html.Serializer");const F=(e,t={})=>A({forced_root_block:!1,validate:!1,allow_conditional_comments:!0,...t},e),N=O.DOM,R=e=>/^[0-9.]+$/.test(e)?e+"px":e,U=(e,t)=>{const r=t.attr("style"),a=r?N.parseStyle(r):{};s(e.width)&&(a["max-width"]=R(e.width)),s(e.height)&&(a["max-height"]=R(e.height)),t.attr("style",N.serializeStyle(a))},P=["source","altsource"],E=(e,t,r,a)=>{let o=0,s=0;const i=F(a);i.addNodeFilter("source",(e=>o=e.length));const n=i.parse(e);for(let e=n;e;e=e.walk())if(1===e.type){const a=e.name;if(e.attr("data-ephox-embed-iri")){U(t,e);break}switch(a){case"video":case"object":case"embed":case"img":case"iframe":void 0!==t.height&&void 0!==t.width&&(e.attr("width",t.width),e.attr("height",t.height))}if(r)switch(a){case"video":e.attr("poster",t.poster),e.attr("src",null);for(let r=o;r<2;r++)if(t[P[r]]){const a=new $("source",1);a.attr("src",t[P[r]]),a.attr("type",t[P[r]+"mime"]||null),e.append(a)}break;case"iframe":e.attr("src",t.source);break;case"object":const r=e.getAll("img").length>0;if(t.poster&&!r){e.attr("src",t.poster);const r=new $("img",1);r.attr("src",t.poster),r.attr("width",t.width),r.attr("height",t.height),e.append(r)}break;case"source":if(s<2&&(e.attr("src",t[P[s]]),e.attr("type",t[P[s]+"mime"]||null),!t[P[s]])){e.remove();continue}s++;break;case"img":t.poster||e.remove()}}return M({},a).serialize(n)},L=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],I=(e,t)=>{const r=(e=>{const t=e.match(/^(https?:\/\/|www\.)(.+)$/i);return t&&t.length>1?"www."===t[1]?"https://":t[1]:"https://"})(t),a=e.regex.exec(t);let o=r+e.url;if(s(a))for(let e=0;ea[e]?a[e]:""));return o.replace(/\?$/,"")},B=(e,t)=>{var r;const a=k.extend({},t);if(!a.source&&(k.extend(a,T(null!==(r=a.embed)&&void 0!==r?r:"",e.schema)),!a.source))return"";a.altsource||(a.altsource=""),a.poster||(a.poster=""),a.source=e.convertURL(a.source,"source"),a.altsource=e.convertURL(a.altsource,"source"),a.sourcemime=z(a.source),a.altsourcemime=z(a.altsource),a.poster=e.convertURL(a.poster,"poster");const o=(e=>{const t=L.filter((t=>t.regex.test(e)));return t.length>0?k.extend({},t[0],{url:I(t[0],e)}):null})(a.source);if(o&&(a.source=o.url,a.type=o.type,a.allowfullscreen=o.allowFullscreen,a.width=a.width||String(o.w),a.height=a.height||String(o.h)),a.embed)return E(a.embed,a,!0,e.schema);{const t=g(e),r=b(e),o=w(e);return a.width=a.width||"300",a.height=a.height||"150",k.each(a,((t,r)=>{a[r]=e.dom.encode(""+t)})),"iframe"===a.type?((e,t)=>{if(t)return t(e);{const t=e.allowfullscreen?' allowFullscreen="1"':"";return'"}})(a,o):"application/x-shockwave-flash"===a.sourcemime?(e=>{let t='';return e.poster&&(t+=''),t+="",t})(a):-1!==a.sourcemime.indexOf("audio")?((e,t)=>t?t(e):'")(a,t):"script"===a.type?(e=>' '; const directionality = editor.getBody().dir; const dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : ''; - html = '' + '' + '' + '' + contentCssEntries + preventClicksOnLinksScript + '' + '' + parseAndSerialize(editor, html) + '' + ''; + previewHtml = '' + '' + '' + '' + contentCssEntries + preventClicksOnLinksScript + '' + '' + previewHtml + '' + ''; } - return replaceTemplateValues(html, getPreviewReplaceValues(editor)); + return replaceTemplateValues(previewHtml, getPreviewReplaceValues(editor)); }; const open = (editor, templateList) => { const createTemplates = () => { @@ -460,7 +461,7 @@ const content = getPreviewContent(editor, previewHtml); const bodyItems = [ { - type: 'selectbox', + type: 'listbox', name: 'template', label: 'Templates', items: selectBoxItems @@ -526,16 +527,28 @@ }); }; + const onSetupEditable = editor => api => { + const nodeChanged = () => { + api.setEnabled(editor.selection.isEditable()); + }; + editor.on('NodeChange', nodeChanged); + nodeChanged(); + return () => { + editor.off('NodeChange', nodeChanged); + }; + }; const register = editor => { const onAction = () => editor.execCommand('mceTemplate'); editor.ui.registry.addButton('template', { icon: 'template', tooltip: 'Insert template', + onSetup: onSetupEditable(editor), onAction }); editor.ui.registry.addMenuItem('template', { icon: 'template', text: 'Insert template...', + onSetup: onSetupEditable(editor), onAction }); }; diff --git a/vendor/tinymce/tinymce/plugins/template/plugin.min.js b/vendor/tinymce/tinymce/plugins/template/plugin.min.js index 343aa7f..95692e4 100644 --- a/vendor/tinymce/tinymce/plugins/template/plugin.min.js +++ b/vendor/tinymce/tinymce/plugins/template/plugin.min.js @@ -1,4 +1,4 @@ /** - * TinyMCE version 6.4.2 (2023-04-26) + * TinyMCE version 6.7.0 (2023-08-30) */ -!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(a=n=e,(r=String).prototype.isPrototypeOf(a)||(null===(s=n.constructor)||void 0===s?void 0:s.name)===r.name)?"string":t;var a,n,r,s})(t)===e,a=t("string"),n=t("object"),r=t("array"),s=("function",e=>"function"==typeof e);const l=(!1,()=>false);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");const c=e=>t=>t.options.get(e),i=c("template_cdate_classes"),u=c("template_mdate_classes"),m=c("template_selected_content_classes"),p=c("template_preview_replace_values"),d=c("template_replace_values"),h=c("templates"),g=c("template_cdate_format"),v=c("template_mdate_format"),y=c("content_style"),f=c("content_css_cors"),_=c("body_class"),b=(e,t)=>{if((e=""+e).length{const n="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),r="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),s="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),l="January February March April May June July August September October November December".split(" ");return(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+a.getFullYear())).replace("%y",""+a.getYear())).replace("%m",b(a.getMonth()+1,2))).replace("%d",b(a.getDate(),2))).replace("%H",""+b(a.getHours(),2))).replace("%M",""+b(a.getMinutes(),2))).replace("%S",""+b(a.getSeconds(),2))).replace("%I",""+((a.getHours()+11)%12+1))).replace("%p",a.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(l[a.getMonth()]))).replace("%b",""+e.translate(s[a.getMonth()]))).replace("%A",""+e.translate(r[a.getDay()]))).replace("%a",""+e.translate(n[a.getDay()]))).replace("%%","%")};class T{constructor(e,t){this.tag=e,this.value=t}static some(e){return new T(!0,e)}static none(){return T.singletonNone}fold(e,t){return this.tag?t(this.value):e()}isSome(){return this.tag}isNone(){return!this.tag}map(e){return this.tag?T.some(e(this.value)):T.none()}bind(e){return this.tag?e(this.value):T.none()}exists(e){return this.tag&&e(this.value)}forall(e){return!this.tag||e(this.value)}filter(e){return!this.tag||e(this.value)?this:T.none()}getOr(e){return this.tag?this.value:e}or(e){return this.tag?this:e}getOrThunk(e){return this.tag?this.value:e()}orThunk(e){return this.tag?this:e()}getOrDie(e){if(this.tag)return this.value;throw new Error(null!=e?e:"Called getOrDie on None")}static from(e){return null==e?T.none():T.some(e)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(e){this.tag&&e(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}T.singletonNone=new T(!1);const x=Object.hasOwnProperty;var S=tinymce.util.Tools.resolve("tinymce.html.Serializer");const w={'"':""","<":"<",">":">","&":"&","'":"'"},C=e=>e.replace(/["'<>&]/g,(e=>{return(t=w,a=e,((e,t)=>x.call(e,t))(t,a)?T.from(t[a]):T.none()).getOr(e);var t,a})),O=(e,t,a)=>((a,n)=>{for(let n=0,s=a.length;nS({validate:!0},e.schema).serialize(e.parser.parse(t,{insert:!0})),D=(e,t)=>(o.each(t,((t,a)=>{s(t)&&(t=t(a)),e=e.replace(new RegExp("\\{\\$"+a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\}","g"),t)})),e),I=(e,t)=>{const a=e.dom,n=d(e);o.each(a.select("*",t),(e=>{o.each(n,((t,n)=>{a.hasClass(e,n)&&s(t)&&t(e)}))}))},N=(e,t,a)=>{const n=e.dom,r=e.selection.getContent();a=D(a,d(e));let s=n.create("div",{},A(e,a));const l=n.select(".mceTmpl",s);l&&l.length>0&&(s=n.create("div"),s.appendChild(l[0].cloneNode(!0))),o.each(n.select("*",s),(t=>{O(n,t,i(e))&&(t.innerHTML=M(e,g(e))),O(n,t,u(e))&&(t.innerHTML=M(e,v(e))),O(n,t,m(e))&&(t.innerHTML=r)})),I(e,s),e.execCommand("mceInsertContent",!1,s.innerHTML),e.addVisual()};var k=tinymce.util.Tools.resolve("tinymce.Env");const P=(e,t)=>{const a=(e,t)=>((e,t,a)=>{for(let n=0,r=e.length;ne.text===t),l),n=t=>{e.windowManager.alert("Could not load the specified template.",(()=>t.focus("template")))},r=e=>e.value.url.fold((()=>Promise.resolve(e.value.content.getOr(""))),(e=>fetch(e).then((e=>e.ok?e.text():Promise.reject())))),s=(e,t)=>(s,l)=>{if("template"===l.name){const l=s.getData().template;a(e,l).each((e=>{s.block("Loading..."),r(e).then((a=>{t(s,e,a)})).catch((()=>{t(s,e,""),s.setEnabled("save",!1),n(s)}))}))}},c=t=>s=>{const l=s.getData();a(t,l.template).each((t=>{r(t).then((t=>{e.execCommand("mceInsertTemplate",!1,t),s.close()})).catch((()=>{s.setEnabled("save",!1),n(s)}))}))};(()=>{if(!t||0===t.length){const t=e.translate("No templates defined.");return e.notificationManager.open({text:t,type:"info"}),T.none()}return T.from(o.map(t,((e,t)=>{const a=e=>void 0!==e.url;return{selected:0===t,text:e.title,value:{url:a(e)?T.from(e.url):T.none(),content:a(e)?T.none():T.from(e.content),description:e.description}}})))})().each((t=>{const a=(e=>((e,t)=>{const a=e.length,n=new Array(a);for(let t=0;t({title:"Insert Template",size:"large",body:{type:"panel",items:e},initialData:a,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:c(t),onChange:s(t,i)}),i=(t,n,r)=>{const s=((e,t)=>{var a;if(-1===t.indexOf("")){let n="";const r=null!==(a=y(e))&&void 0!==a?a:"",s=f(e)?' crossorigin="anonymous"':"";o.each(e.contentCSS,(t=>{n+='"})),r&&(n+='");const l=_(e),c=e.dom.encode,i='