diff --git a/classes/Alerts.php b/classes/Alerts.php
index 04f2af4..2ba56bb 100644
--- a/classes/Alerts.php
+++ b/classes/Alerts.php
@@ -289,7 +289,7 @@ class Alerts extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC);
- $count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0;
+ $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination
diff --git a/classes/Base.php b/classes/Base.php
index d957d28..9df77ae 100644
--- a/classes/Base.php
+++ b/classes/Base.php
@@ -583,7 +583,7 @@ class Base {
public function getZipcode($zip_code = 0) {
$zip_code = filter_input(INPUT_POST, "zip_code", FILTER_SANITIZE_NUMBER_INT) ?: 0;
- $zip_code = (integer) substr((string) $zip_code, 0, 5);
+ $zip_code = (int) substr((string) $zip_code, 0, 5);
$zipCodeDetail = null;
diff --git a/classes/Dropdowns.php b/classes/Dropdowns.php
index d44a646..2c0cb5f 100644
--- a/classes/Dropdowns.php
+++ b/classes/Dropdowns.php
@@ -341,7 +341,7 @@ class Dropdowns extends Base {
public function dropdowntypeActive() {
- $dropdowntype_serial = (integer) filter_input(INPUT_POST, "dropdowntype_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
+ $dropdowntype_serial = (int) filter_input(INPUT_POST, "dropdowntype_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$SQL = "select dropdown_serial
from view_dropdowns
@@ -587,7 +587,7 @@ class Dropdowns extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC);
- $count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0;
+ $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination
diff --git a/classes/Journal.php b/classes/Journal.php
index 8ec1b93..2d58341 100644
--- a/classes/Journal.php
+++ b/classes/Journal.php
@@ -100,7 +100,7 @@ class Journal extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC);
- $count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0;
+ $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination
diff --git a/classes/Popovers.php b/classes/Popovers.php
index a37d247..ef1ed82 100644
--- a/classes/Popovers.php
+++ b/classes/Popovers.php
@@ -253,7 +253,7 @@ class Popovers extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC);
- $count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0;
+ $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination
diff --git a/classes/Reports.php b/classes/Reports.php
index a9900a5..bd0195f 100644
--- a/classes/Reports.php
+++ b/classes/Reports.php
@@ -215,7 +215,7 @@ class Reports extends Base {
$reports = $this->getTable("reports", $SQL);
- return (integer) ($reports->record->report_serial ?? 0);
+ return (int) ($reports->record->report_serial ?? 0);
}
// =======================
@@ -268,7 +268,7 @@ class Reports extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC);
- $count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0;
+ $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination
@@ -357,7 +357,7 @@ class Reports extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC);
- $count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0;
+ $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination
diff --git a/classes/SignIn.php b/classes/SignIn.php
index cc1254d..ccaa198 100644
--- a/classes/SignIn.php
+++ b/classes/SignIn.php
@@ -63,7 +63,7 @@ class SignIn extends Base {
die();
}
- if ((integer) $user->record->user_active === 0) {
+ if ((int) $user->record->user_active === 0) {
echo $this->applyXSL("", $this->getXSL("signIn"), $XSLParms);
die();
}
@@ -79,7 +79,7 @@ class SignIn extends Base {
session_regenerate_id(true);
$_SESSION[self::USER_AUTHENTICATED] = true;
- $_SESSION[self::USER_SERIAL] = (integer) $user->record->user_serial;
+ $_SESSION[self::USER_SERIAL] = (int) $user->record->user_serial;
$_SESSION[self::USER_ID] = (string) $user->record->user_id;
$_SESSION[self::USER_NAME] = (string) $user->record->user_name;
$_SESSION[self::USER_EMAIL] = (string) $user->record->user_email;
diff --git a/classes/Statuses.php b/classes/Statuses.php
index f555b8c..ab4c499 100644
--- a/classes/Statuses.php
+++ b/classes/Statuses.php
@@ -310,7 +310,7 @@ class Statuses extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC);
- $count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0;
+ $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination
diff --git a/classes/Users.php b/classes/Users.php
index 98cd707..9f2b7d3 100644
--- a/classes/Users.php
+++ b/classes/Users.php
@@ -111,8 +111,8 @@ class Users extends Base {
$user_random_password = $this->generateRandomPassword();
$user_temp_password = password_hash($user_random_password, PASSWORD_DEFAULT);
- $user_change_password = (boolean) true;
- $user_active = (boolean) true;
+ $user_change_password = (int) true;
+ $user_active = (int) true;
// Add the User
@@ -202,7 +202,7 @@ class Users extends Base {
case "prompt":
- $user_serial = (integer) filter_input(INPUT_POST, "user_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
+ $user_serial = (int) filter_input(INPUT_POST, "user_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$user = $this->getUser($user_serial);
@@ -305,7 +305,7 @@ class Users extends Base {
$users = $this->getUserByUserId($user_id);
- return ($users->count() === 0) ? 0 : (integer) $users->record->user_serial;
+ return ($users->count() === 0) ? 0 : (int) $users->record->user_serial;
}
// =====================
@@ -354,7 +354,7 @@ class Users extends Base {
$recordset = $statement->fetch(PDO::FETCH_ASSOC);
- $count = (count($recordset) > 0) ? (integer) $recordset["count"] : (integer) 0;
+ $count = (count($recordset) > 0) ? (int) $recordset["count"] : (int) 0;
// Pagination
@@ -469,7 +469,7 @@ class Users extends Base {
public function userActive() {
- $user_serial = (integer) filter_input(INPUT_POST, "user_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
+ $user_serial = (int) filter_input(INPUT_POST, "user_serial", FILTER_SANITIZE_NUMBER_INT) ?: 0;
$SQL = "select request_serial
from requests
diff --git a/images/baseproject-logo.png b/images/baseproject-logo.png
new file mode 100644
index 0000000..d8f65f3
Binary files /dev/null and b/images/baseproject-logo.png differ
diff --git a/nbproject/private/config.properties b/nbproject/private/config.properties
new file mode 100644
index 0000000..e69de29
diff --git a/tables/_createSystemTable.php b/tables/_createSystemTable.php
index 9aecc9e..9b37373 100644
--- a/tables/_createSystemTable.php
+++ b/tables/_createSystemTable.php
@@ -1,229 +1,227 @@
-
-
- Create System Tables
+
+
+ Create System Tables
-
-
-
+ .error {
+ color: #ff9999;
+ }
+
+
+
-DatabaseServer;
-$database = (string) $applicationSettings->DatabaseName;
-$user = (string) $applicationSettings->DatabaseUser;
-$password = (string) $applicationSettings->DatabasePassword;
+ $host = (string) $applicationSettings->DatabaseServer;
+ $database = (string) $applicationSettings->DatabaseName;
+ $user = (string) $applicationSettings->DatabaseUser;
+ $password = (string) $applicationSettings->DatabasePassword;
-try {
- $connection = new PDO(
- "mysql:host={$host};dbname={$database};charset=utf8mb4",
- $user,
- $password,
- [
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
- PDO::ATTR_EMULATE_PREPARES => false,
- PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
- ]
- );
+ try {
+ $connection = new PDO(
+ "mysql:host={$host};dbname={$database};charset=utf8mb4",
+ $user,
+ $password,
+ [
+ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
+ PDO::ATTR_EMULATE_PREPARES => false,
+ PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
+ ]
+ );
- $connection->exec("SET FOREIGN_KEY_CHECKS = 0");
-
-} catch (PDOException | Exception $e) {
- echoLog("Unable to connect to the database.", "error");
- exit();
-}
+ $connection->exec("SET FOREIGN_KEY_CHECKS = 0");
+ } catch (PDOException | Exception $e) {
+ echoLog("Unable to connect to the database.", "error");
+ exit();
+ }
// ----------------------------
// Get Table Definition Files
// ----------------------------
-$tableFiles = glob("*.php");
+ $tableFiles = glob("*.php");
-$excludedFiles = [
- "_createSystemTable.php",
- "_createTable.php",
- basename(__FILE__),
-];
+ $excludedFiles = [
+ "_createSystemTable.php",
+ "_createTable.php",
+ basename(__FILE__),
+ ];
-$tableFiles = array_values(array_filter($tableFiles, function ($file) use ($excludedFiles) {
- return !in_array($file, $excludedFiles, true);
-}));
+ $tableFiles = array_values(array_filter($tableFiles, function ($file) use ($excludedFiles) {
+ return !in_array($file, $excludedFiles, true);
+ }));
-sort($tableFiles);
+ sort($tableFiles);
// ----------------------------
// Process Table Files
// ----------------------------
-foreach ($tableFiles as $tableFile) {
+ foreach ($tableFiles as $tableFile) {
- $tableName = basename($tableFile, ".php");
+ $tableName = basename($tableFile, ".php");
- echoLog("Processing {$tableName}...", "warning");
+ echoLog("Processing {$tableName}...", "warning");
- try {
- $connection->exec("DROP VIEW IF EXISTS `view_{$tableName}`");
- echoLog("Dropped view_{$tableName}, if it existed.", "success");
- } catch (PDOException $e) {
- echoLog("Could not drop view_{$tableName}.", "error");
- continue;
- }
+ try {
+ $connection->exec("DROP VIEW IF EXISTS `view_{$tableName}`");
+ echoLog("Dropped view_{$tableName}, if it existed.", "success");
+ } catch (PDOException $e) {
+ echoLog("Could not drop view_{$tableName}.", "error");
+ continue;
+ }
- try {
- $connection->exec("DROP TABLE IF EXISTS `{$tableName}`");
- echoLog("Dropped {$tableName}, if it existed.", "success");
- } catch (PDOException $e) {
- echoLog("Could not drop table {$tableName}.", "error");
- continue;
- }
+ try {
+ $connection->exec("DROP TABLE IF EXISTS `{$tableName}`");
+ echoLog("Dropped {$tableName}, if it existed.", "success");
+ } catch (PDOException $e) {
+ echoLog("Could not drop table {$tableName}.", "error");
+ continue;
+ }
- $SQL = null;
+ $SQL = null;
- if (!include $tableFile) {
- echoLog("Failed to include {$tableFile}. Skipping.", "error");
- continue;
- }
+ if (!include $tableFile) {
+ echoLog("Failed to include {$tableFile}. Skipping.", "error");
+ continue;
+ }
- if (empty($SQL)) {
- echoLog("No SQL found in {$tableFile}. Skipping.", "error");
- continue;
- }
+ if (empty($SQL)) {
+ echoLog("No SQL found in {$tableFile}. Skipping.", "error");
+ continue;
+ }
- runSQL($SQL, $connection, "create {$tableName}");
+ runSQL($SQL, $connection, "create {$tableName}");
- switch ($tableFile) {
+ switch ($tableFile) {
- case "popovers.php":
- seedPopovers($connection);
- break;
+ case "popovers.php":
+ seedPopovers($connection);
+ break;
- case "users.php":
- seedInitialAdminUser($connection);
- break;
- }
-}
+ case "users.php":
+ seedInitialAdminUser($connection);
+ break;
+ }
+ }
-try {
- $connection->exec("SET FOREIGN_KEY_CHECKS = 1");
-} catch (PDOException $e) {
- echoLog("Warning: Could not re-enable foreign key checks.", "warning");
-}
+ try {
+ $connection->exec("SET FOREIGN_KEY_CHECKS = 1");
+ } catch (PDOException $e) {
+ echoLog("Warning: Could not re-enable foreign key checks.", "warning");
+ }
-echoLog("System tables created successfully.", "success");
+ echoLog("System tables created successfully.", "success");
// -------------------------
// Helper Functions
// -------------------------
-function runSQL($SQL, PDO $connection, $context = "query") {
- try {
- $connection->exec($SQL);
- echoLog("Completed {$context}.", "success");
- } catch (PDOException $e) {
- echoLog("Error running {$context}.", "error");
- exit();
- }
-}
+ function runSQL($SQL, PDO $connection, $context = "query") {
+ try {
+ $connection->exec($SQL);
+ echoLog("Completed {$context}.", "success");
+ } catch (PDOException $e) {
+ echoLog("Error running {$context}.", "error");
+ exit();
+ }
+ }
-function seedPopovers(PDO $connection) {
+ function seedPopovers(PDO $connection) {
- $popovers = [
- [
- "find_user",
- "Find User",
- "Find User...",
- "Find by Name, Email, or Role
"
- ],
- [
- "find_report",
- "Find Report",
- "Find Report...",
- "Find by Name or Description
"
- ],
- [
- "select_report",
- "Select Report",
- "Find Report...",
- "Find by Name, Email, or Role
"
- ],
- [
- "find_popover",
- "Find Popover",
- "Find Popover...",
- "Find by Name, Title or Placeholder
"
- ],
- [
- "find_journal",
- "Find Journal",
- "Find Journal...",
- "Find by Name, Email, or Role
"
- ],
- [
- "find_status",
- "Find Status",
- "Find Status...",
- "Find by Name
"
- ],
- [
- "find_dropdowntype",
- "Find Dropdown Types",
- "Find Dropdown Types...",
- "Search for dropdown types
"
- ],
- ];
+ $popovers = [
+ [
+ "find_user",
+ "Find User",
+ "Find User...",
+ "Find by Name, Email, or Role
"
+ ],
+ [
+ "find_report",
+ "Find Report",
+ "Find Report...",
+ "Find by Name or Description
"
+ ],
+ [
+ "select_report",
+ "Select Report",
+ "Find Report...",
+ "Find by Name, Email, or Role
"
+ ],
+ [
+ "find_popover",
+ "Find Popover",
+ "Find Popover...",
+ "Find by Name, Title or Placeholder
"
+ ],
+ [
+ "find_journal",
+ "Find Journal",
+ "Find Journal...",
+ "Find by Name, Email, or Role
"
+ ],
+ [
+ "find_status",
+ "Find Status",
+ "Find Status...",
+ "Find by Name
"
+ ],
+ [
+ "find_dropdowntype",
+ "Find Dropdown Types",
+ "Find Dropdown Types...",
+ "Search for dropdown types
"
+ ],
+ ];
- $SQL = "
+ $SQL = "
INSERT INTO popovers (
popover_name,
popover_title,
@@ -241,26 +239,26 @@ function seedPopovers(PDO $connection) {
)
";
- $statement = $connection->prepare($SQL);
+ $statement = $connection->prepare($SQL);
- foreach ($popovers as $popover) {
- $statement->execute([
- ":popover_name" => $popover[0],
- ":popover_title" => $popover[1],
- ":popover_placeholder" => $popover[2],
- ":popover_text" => $popover[3],
- ":popover_creator" => INIT_SCRIPT_USER,
- ]);
- }
+ foreach ($popovers as $popover) {
+ $statement->execute([
+ ":popover_name" => $popover[0],
+ ":popover_title" => $popover[1],
+ ":popover_placeholder" => $popover[2],
+ ":popover_text" => $popover[3],
+ ":popover_creator" => INIT_SCRIPT_USER,
+ ]);
+ }
- echoLog("Seeded popovers.", "success");
-}
+ echoLog("Seeded popovers.", "success");
+ }
-function seedInitialAdminUser(PDO $connection) {
+ function seedInitialAdminUser(PDO $connection) {
- $password = password_hash("349Jamot@", PASSWORD_DEFAULT);
+ $password = password_hash("349Jamot@", PASSWORD_DEFAULT);
- $SQL = "
+ $SQL = "
INSERT INTO users (
user_id,
user_name,
@@ -284,28 +282,27 @@ function seedInitialAdminUser(PDO $connection) {
)
";
- $statement = $connection->prepare($SQL);
+ $statement = $connection->prepare($SQL);
- $statement->execute([
- ":user_id" => "DSYSADMIN",
- ":user_name" => "James Richie",
- ":user_email" => "james.richie@onesourceits.com",
- ":user_password" => $password,
- ":user_role" => "Administrator",
- ":user_change_password" => 1,
- ":user_active" => 1,
- ":user_creator" => INIT_SCRIPT_USER,
- ]);
+ $statement->execute([
+ ":user_id" => "DSYSADMIN",
+ ":user_name" => "James Richie",
+ ":user_email" => "james.richie@onesourceits.com",
+ ":user_password" => $password,
+ ":user_role" => "Administrator",
+ ":user_change_password" => 1,
+ ":user_active" => 1,
+ ":user_creator" => INIT_SCRIPT_USER,
+ ]);
- echoLog("Seeded initial administrator user.", "success");
-}
+ echoLog("Seeded initial administrator user.", "success");
+ }
-function echoLog($message, $type = "") {
- $class = trim("log {$type}");
- echo "" . htmlspecialchars($message, ENT_QUOTES, "UTF-8") . "
";
-}
+ function echoLog($message, $type = "") {
+ $class = trim("log {$type}");
+ echo "" . htmlspecialchars($message, ENT_QUOTES, "UTF-8") . "
";
+ }
+ ?>
-?>
-
-
+
\ No newline at end of file
diff --git a/vendor/autoload.php b/vendor/autoload.php
new file mode 100644
index 0000000..34b956d
--- /dev/null
+++ b/vendor/autoload.php
@@ -0,0 +1,22 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ * $loader = new \Composer\Autoload\ClassLoader();
+ *
+ * // register classes with namespaces
+ * $loader->add('Symfony\Component', __DIR__.'/component');
+ * $loader->add('Symfony', __DIR__.'/framework');
+ *
+ * // activate the autoloader
+ * $loader->register();
+ *
+ * // to enable searching the include path (eg. for PEAR packages)
+ * $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier
+ * @author Jordi Boggiano
+ * @see https://www.php-fig.org/psr/psr-0/
+ * @see https://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+ /** @var \Closure(string):void */
+ private static $includeFile;
+
+ /** @var string|null */
+ private $vendorDir;
+
+ // PSR-4
+ /**
+ * @var array>
+ */
+ private $prefixLengthsPsr4 = array();
+ /**
+ * @var array>
+ */
+ private $prefixDirsPsr4 = array();
+ /**
+ * @var list
+ */
+ private $fallbackDirsPsr4 = array();
+
+ // PSR-0
+ /**
+ * 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 list
+ */
+ private $fallbackDirsPsr0 = array();
+
+ /** @var bool */
+ private $useIncludePath = false;
+
+ /**
+ * @var array
+ */
+ private $classMap = array();
+
+ /** @var bool */
+ private $classMapAuthoritative = false;
+
+ /**
+ * @var array
+ */
+ private $missingClasses = array();
+
+ /** @var string|null */
+ private $apcuPrefix;
+
+ /**
+ * @var array
+ */
+ private static $registeredLoaders = array();
+
+ /**
+ * @param string|null $vendorDir
+ */
+ public function __construct($vendorDir = null)
+ {
+ $this->vendorDir = $vendorDir;
+ self::initializeIncludeClosure();
+ }
+
+ /**
+ * @return array>
+ */
+ public function getPrefixes()
+ {
+ if (!empty($this->prefixesPsr0)) {
+ return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
+ }
+
+ return array();
+ }
+
+ /**
+ * @return array>
+ */
+ public function getPrefixesPsr4()
+ {
+ return $this->prefixDirsPsr4;
+ }
+
+ /**
+ * @return list
+ */
+ public function getFallbackDirs()
+ {
+ return $this->fallbackDirsPsr0;
+ }
+
+ /**
+ * @return list
+ */
+ public function getFallbackDirsPsr4()
+ {
+ return $this->fallbackDirsPsr4;
+ }
+
+ /**
+ * @return array Array of classname => path
+ */
+ public function getClassMap()
+ {
+ return $this->classMap;
+ }
+
+ /**
+ * @param array $classMap Class to filename map
+ *
+ * @return void
+ */
+ public function addClassMap(array $classMap)
+ {
+ if ($this->classMap) {
+ $this->classMap = array_merge($this->classMap, $classMap);
+ } else {
+ $this->classMap = $classMap;
+ }
+ }
+
+ /**
+ * 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 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(
+ $paths,
+ $this->fallbackDirsPsr0
+ );
+ } else {
+ $this->fallbackDirsPsr0 = array_merge(
+ $this->fallbackDirsPsr0,
+ $paths
+ );
+ }
+
+ return;
+ }
+
+ $first = $prefix[0];
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
+ $this->prefixesPsr0[$first][$prefix] = $paths;
+
+ return;
+ }
+ if ($prepend) {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ $paths,
+ $this->prefixesPsr0[$first][$prefix]
+ );
+ } else {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ $this->prefixesPsr0[$first][$prefix],
+ $paths
+ );
+ }
+ }
+
+ /**
+ * 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 list|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @throws \InvalidArgumentException
+ *
+ * @return void
+ */
+ public function addPsr4($prefix, $paths, $prepend = false)
+ {
+ $paths = (array) $paths;
+ if (!$prefix) {
+ // Register directories for the root namespace.
+ if ($prepend) {
+ $this->fallbackDirsPsr4 = array_merge(
+ $paths,
+ $this->fallbackDirsPsr4
+ );
+ } else {
+ $this->fallbackDirsPsr4 = array_merge(
+ $this->fallbackDirsPsr4,
+ $paths
+ );
+ }
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+ // Register directories for a new namespace.
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = $paths;
+ } elseif ($prepend) {
+ // Prepend directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ $paths,
+ $this->prefixDirsPsr4[$prefix]
+ );
+ } else {
+ // Append directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ $this->prefixDirsPsr4[$prefix],
+ $paths
+ );
+ }
+ }
+
+ /**
+ * 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 list|string $paths The PSR-0 base directories
+ *
+ * @return void
+ */
+ public function set($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr0 = (array) $paths;
+ } else {
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * 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 list|string $paths The PSR-4 base directories
+ *
+ * @throws \InvalidArgumentException
+ *
+ * @return void
+ */
+ public function setPsr4($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr4 = (array) $paths;
+ } else {
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ 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;
+ }
+ }
+
+ /**
+ * Turns on searching the include path for class files.
+ *
+ * @param bool $useIncludePath
+ *
+ * @return void
+ */
+ public function setUseIncludePath($useIncludePath)
+ {
+ $this->useIncludePath = $useIncludePath;
+ }
+
+ /**
+ * Can be used to check if the autoloader uses the include path to check
+ * for classes.
+ *
+ * @return bool
+ */
+ public function getUseIncludePath()
+ {
+ return $this->useIncludePath;
+ }
+
+ /**
+ * Turns off searching the prefix and fallback directories for classes
+ * that have not been registered with the class map.
+ *
+ * @param bool $classMapAuthoritative
+ *
+ * @return void
+ */
+ public function setClassMapAuthoritative($classMapAuthoritative)
+ {
+ $this->classMapAuthoritative = $classMapAuthoritative;
+ }
+
+ /**
+ * Should class lookup fail if not found in the current class map?
+ *
+ * @return bool
+ */
+ public function isClassMapAuthoritative()
+ {
+ return $this->classMapAuthoritative;
+ }
+
+ /**
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+ *
+ * @param string|null $apcuPrefix
+ *
+ * @return void
+ */
+ public function setApcuPrefix($apcuPrefix)
+ {
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
+ }
+
+ /**
+ * The APCu prefix in use, or null if APCu caching is not enabled.
+ *
+ * @return string|null
+ */
+ public function getApcuPrefix()
+ {
+ return $this->apcuPrefix;
+ }
+
+ /**
+ * Registers this instance as an autoloader.
+ *
+ * @param bool $prepend Whether to prepend the autoloader or not
+ *
+ * @return void
+ */
+ public function register($prepend = false)
+ {
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+
+ if (null === $this->vendorDir) {
+ return;
+ }
+
+ if ($prepend) {
+ self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
+ } else {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ self::$registeredLoaders[$this->vendorDir] = $this;
+ }
+ }
+
+ /**
+ * Unregisters this instance as an autoloader.
+ *
+ * @return void
+ */
+ public function unregister()
+ {
+ spl_autoload_unregister(array($this, 'loadClass'));
+
+ if (null !== $this->vendorDir) {
+ unset(self::$registeredLoaders[$this->vendorDir]);
+ }
+ }
+
+ /**
+ * Loads the given class or interface.
+ *
+ * @param string $class The name of the class
+ * @return true|null True if loaded, null otherwise
+ */
+ public function loadClass($class)
+ {
+ if ($file = $this->findFile($class)) {
+ $includeFile = self::$includeFile;
+ $includeFile($file);
+
+ return true;
+ }
+
+ return null;
+ }
+
+ /**
+ * Finds the path to the file where the class is defined.
+ *
+ * @param string $class The name of the class
+ *
+ * @return string|false The path if found, false otherwise
+ */
+ public function findFile($class)
+ {
+ // class map lookup
+ if (isset($this->classMap[$class])) {
+ return $this->classMap[$class];
+ }
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+ return false;
+ }
+ if (null !== $this->apcuPrefix) {
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+ if ($hit) {
+ return $file;
+ }
+ }
+
+ $file = $this->findFileWithExtension($class, '.php');
+
+ // Search for Hack files if we are running on HHVM
+ if (false === $file && defined('HHVM_VERSION')) {
+ $file = $this->findFileWithExtension($class, '.hh');
+ }
+
+ if (null !== $this->apcuPrefix) {
+ apcu_add($this->apcuPrefix.$class, $file);
+ }
+
+ if (false === $file) {
+ // Remember that this class does not exist.
+ $this->missingClasses[$class] = true;
+ }
+
+ return $file;
+ }
+
+ /**
+ * Returns the currently registered loaders keyed by their corresponding vendor directories.
+ *
+ * @return array
+ */
+ public static function getRegisteredLoaders()
+ {
+ return self::$registeredLoaders;
+ }
+
+ /**
+ * @param string $class
+ * @param string $ext
+ * @return string|false
+ */
+ private function findFileWithExtension($class, $ext)
+ {
+ // PSR-4 lookup
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+ $first = $class[0];
+ if (isset($this->prefixLengthsPsr4[$first])) {
+ $subPath = $class;
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
+ $subPath = substr($subPath, 0, $lastPos);
+ $search = $subPath . '\\';
+ if (isset($this->prefixDirsPsr4[$search])) {
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
+ if (file_exists($file = $dir . $pathEnd)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-4 fallback dirs
+ foreach ($this->fallbackDirsPsr4 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 lookup
+ if (false !== $pos = strrpos($class, '\\')) {
+ // namespaced class name
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+ } else {
+ // PEAR-like class name
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+ }
+
+ if (isset($this->prefixesPsr0[$first])) {
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+ if (0 === strpos($class, $prefix)) {
+ foreach ($dirs as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-0 fallback dirs
+ foreach ($this->fallbackDirsPsr0 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 include paths.
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+ return $file;
+ }
+
+ return false;
+ }
+
+ /**
+ * @return void
+ */
+ private static function initializeIncludeClosure()
+ {
+ if (self::$includeFile !== null) {
+ return;
+ }
+
+ /**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ *
+ * @param string $file
+ * @return void
+ */
+ self::$includeFile = \Closure::bind(static function($file) {
+ include $file;
+ }, null, null);
+ }
+}
diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php
new file mode 100644
index 0000000..8d3f8ac
--- /dev/null
+++ b/vendor/composer/InstalledVersions.php
@@ -0,0 +1,396 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer;
+
+use Composer\Autoload\ClassLoader;
+use Composer\Semver\VersionParser;
+
+/**
+ * This class is copied in every Composer installed project and available to all
+ *
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
+ *
+ * To require its presence, you can require `composer-runtime-api ^2.0`
+ *
+ * @final
+ */
+class InstalledVersions
+{
+ /**
+ * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
+ * @internal
+ */
+ private static $selfDir = null;
+
+ /**
+ * @var mixed[]|null
+ * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null
+ */
+ private static $installed;
+
+ /**
+ * @var bool
+ */
+ private static $installedIsLocalDir;
+
+ /**
+ * @var bool|null
+ */
+ private static $canGetVendors;
+
+ /**
+ * @var array[]
+ * @psalm-var array}>
+ */
+ private static $installedByVendor = array();
+
+ /**
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
+ *
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackages()
+ {
+ $packages = array();
+ foreach (self::getInstalled() as $installed) {
+ $packages[] = array_keys($installed['versions']);
+ }
+
+ if (1 === \count($packages)) {
+ return $packages[0];
+ }
+
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
+ }
+
+ /**
+ * Returns a list of all package names with a specific type e.g. 'library'
+ *
+ * @param string $type
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackagesByType($type)
+ {
+ $packagesByType = array();
+
+ foreach (self::getInstalled() as $installed) {
+ foreach ($installed['versions'] as $name => $package) {
+ if (isset($package['type']) && $package['type'] === $type) {
+ $packagesByType[] = $name;
+ }
+ }
+ }
+
+ return $packagesByType;
+ }
+
+ /**
+ * Checks whether the given package is installed
+ *
+ * This also returns true if the package name is provided or replaced by another package
+ *
+ * @param string $packageName
+ * @param bool $includeDevRequirements
+ * @return bool
+ */
+ public static function isInstalled($packageName, $includeDevRequirements = true)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (isset($installed['versions'][$packageName])) {
+ return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks whether the given package satisfies a version constraint
+ *
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
+ *
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
+ *
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
+ * @param string $packageName
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
+ * @return bool
+ */
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
+ {
+ $constraint = $parser->parseConstraints((string) $constraint);
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
+
+ return $provided->matches($constraint);
+ }
+
+ /**
+ * Returns a version constraint representing all the range(s) which are installed for a given package
+ *
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
+ * whether a given version of a package is installed, and not just whether it exists
+ *
+ * @param string $packageName
+ * @return string Version constraint usable with composer/semver
+ */
+ public static function getVersionRanges($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ $ranges = array();
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
+ }
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
+ }
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
+ }
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
+ }
+
+ return implode(' || ', $ranges);
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getVersion($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['version'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getPrettyVersion($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['pretty_version'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
+ */
+ public static function getReference($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if (!isset($installed['versions'][$packageName]['reference'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['reference'];
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
+ */
+ public static function getInstallPath($packageName)
+ {
+ foreach (self::getInstalled() as $installed) {
+ if (!isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
+ }
+
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @return array
+ * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
+ */
+ public static function getRootPackage()
+ {
+ $installed = self::getInstalled();
+
+ return $installed[0]['root'];
+ }
+
+ /**
+ * Returns the raw installed.php data for custom implementations
+ *
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
+ * @return array[]
+ * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}
+ */
+ public static function getRawData()
+ {
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C' && is_file(__DIR__ . '/installed.php')) {
+ self::$installed = include __DIR__ . '/installed.php';
+ } else {
+ self::$installed = array();
+ }
+ }
+
+ return self::$installed;
+ }
+
+ /**
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
+ *
+ * @return array[]
+ * @psalm-return list}>
+ */
+ public static function getAllRawData()
+ {
+ return self::getInstalled();
+ }
+
+ /**
+ * Lets you reload the static array from another file
+ *
+ * This is only useful for complex integrations in which a project needs to use
+ * this class but then also needs to execute another project's autoloader in process,
+ * and wants to ensure both projects have access to their version of installed.php.
+ *
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
+ * the data it needs from this class, then call reload() with
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
+ * the project in which it runs can then also use this class safely, without
+ * interference between PHPUnit's dependencies and the project's dependencies.
+ *
+ * @param array[] $data A vendor/composer/installed.php data set
+ * @return void
+ *
+ * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data
+ */
+ public static function reload($data)
+ {
+ self::$installed = $data;
+ self::$installedByVendor = array();
+
+ // when using reload, we disable the duplicate protection to ensure that self::$installed data is
+ // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
+ // so we have to assume it does not, and that may result in duplicate data being returned when listing
+ // all installed packages for example
+ self::$installedIsLocalDir = false;
+ }
+
+ /**
+ * @return string
+ */
+ private static function getSelfDir()
+ {
+ if (self::$selfDir === null) {
+ self::$selfDir = strtr(__DIR__, '\\', '/');
+ }
+
+ return self::$selfDir;
+ }
+
+ /**
+ * @return array[]
+ * @psalm-return list}>
+ */
+ private static function getInstalled()
+ {
+ if (null === self::$canGetVendors) {
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
+ }
+
+ $installed = array();
+ $copiedLocalDir = false;
+
+ if (self::$canGetVendors) {
+ $selfDir = self::getSelfDir();
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+ $vendorDir = strtr($vendorDir, '\\', '/');
+ if (isset(self::$installedByVendor[$vendorDir])) {
+ $installed[] = self::$installedByVendor[$vendorDir];
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
+ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
+ $required = require $vendorDir.'/composer/installed.php';
+ self::$installedByVendor[$vendorDir] = $required;
+ $installed[] = $required;
+ if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
+ self::$installed = $required;
+ self::$installedIsLocalDir = true;
+ }
+ }
+ if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
+ $copiedLocalDir = true;
+ }
+ }
+ }
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C' && is_file(__DIR__ . '/installed.php')) {
+ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
+ $required = require __DIR__ . '/installed.php';
+ self::$installed = $required;
+ } else {
+ self::$installed = array();
+ }
+ }
+
+ if (self::$installed !== array() && !$copiedLocalDir) {
+ $installed[] = self::$installed;
+ }
+
+ return $installed;
+ }
+}
diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE
new file mode 100644
index 0000000..62ecfd8
--- /dev/null
+++ b/vendor/composer/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) Nils Adermann, Jordi Boggiano
+
+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.
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
new file mode 100644
index 0000000..3cdd6f2
--- /dev/null
+++ b/vendor/composer/autoload_classmap.php
@@ -0,0 +1,22 @@
+ $vendorDir . '/composer/InstalledVersions.php',
+ 'Datamatrix' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/datamatrix.php',
+ 'PDF417' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/pdf417.php',
+ 'QRcode' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/qrcode.php',
+ 'TCPDF' => $vendorDir . '/tecnickcom/tcpdf/tcpdf.php',
+ 'TCPDF2DBarcode' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_barcodes_2d.php',
+ 'TCPDFBarcode' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_barcodes_1d.php',
+ 'TCPDF_COLORS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_colors.php',
+ 'TCPDF_FILTERS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_filters.php',
+ 'TCPDF_FONTS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_fonts.php',
+ 'TCPDF_FONT_DATA' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_font_data.php',
+ 'TCPDF_IMAGES' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_images.php',
+ 'TCPDF_STATIC' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_static.php',
+);
diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php
new file mode 100644
index 0000000..15a2ff3
--- /dev/null
+++ b/vendor/composer/autoload_namespaces.php
@@ -0,0 +1,9 @@
+ array($vendorDir . '/maennchen/zipstream-php/src'),
+ 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
+ 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
+ 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'),
+ 'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'),
+ 'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'),
+ 'Matrix\\' => array($vendorDir . '/markbaker/matrix/classes/src'),
+ 'Composer\\Pcre\\' => array($vendorDir . '/composer/pcre/src'),
+ 'Complex\\' => array($vendorDir . '/markbaker/complex/classes/src'),
+ 'Com\\Tecnick\\Unicode\\Data\\' => array($vendorDir . '/tecnickcom/tc-lib-unicode-data/src'),
+ 'Com\\Tecnick\\Unicode\\' => array($vendorDir . '/tecnickcom/tc-lib-unicode/src'),
+ 'Com\\Tecnick\\Pdf\\Sign\\' => array($vendorDir . '/tecnickcom/tc-lib-pdf-sign/src'),
+ 'Com\\Tecnick\\Pdf\\Parser\\' => array($vendorDir . '/tecnickcom/tc-lib-pdf-parser/src'),
+ 'Com\\Tecnick\\Pdf\\Page\\' => array($vendorDir . '/tecnickcom/tc-lib-pdf-page/src'),
+ 'Com\\Tecnick\\Pdf\\Image\\' => array($vendorDir . '/tecnickcom/tc-lib-pdf-image/src'),
+ 'Com\\Tecnick\\Pdf\\Graph\\' => array($vendorDir . '/tecnickcom/tc-lib-pdf-graph/src'),
+ 'Com\\Tecnick\\Pdf\\Font\\' => array($vendorDir . '/tecnickcom/tc-lib-pdf-font/src'),
+ 'Com\\Tecnick\\Pdf\\Filter\\' => array($vendorDir . '/tecnickcom/tc-lib-pdf-filter/src'),
+ 'Com\\Tecnick\\Pdf\\Encrypt\\' => array($vendorDir . '/tecnickcom/tc-lib-pdf-encrypt/src'),
+ 'Com\\Tecnick\\Pdf\\' => array($vendorDir . '/tecnickcom/tc-lib-pdf/src'),
+ 'Com\\Tecnick\\File\\' => array($vendorDir . '/tecnickcom/tc-lib-file/src'),
+ 'Com\\Tecnick\\Color\\' => array($vendorDir . '/tecnickcom/tc-lib-color/src'),
+ 'Com\\Tecnick\\Barcode\\' => array($vendorDir . '/tecnickcom/tc-lib-barcode/src'),
+);
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
new file mode 100644
index 0000000..5d08f72
--- /dev/null
+++ b/vendor/composer/autoload_real.php
@@ -0,0 +1,38 @@
+register(true);
+
+ return $loader;
+ }
+}
diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php
new file mode 100644
index 0000000..6078577
--- /dev/null
+++ b/vendor/composer/autoload_static.php
@@ -0,0 +1,168 @@
+
+ array (
+ 'ZipStream\\' => 10,
+ ),
+ 'P' =>
+ array (
+ 'Psr\\SimpleCache\\' => 16,
+ 'Psr\\Http\\Message\\' => 17,
+ 'Psr\\Http\\Client\\' => 16,
+ 'PhpOffice\\PhpSpreadsheet\\' => 25,
+ 'PHPMailer\\PHPMailer\\' => 20,
+ ),
+ 'M' =>
+ array (
+ 'Matrix\\' => 7,
+ ),
+ 'C' =>
+ array (
+ 'Composer\\Pcre\\' => 14,
+ 'Complex\\' => 8,
+ 'Com\\Tecnick\\Unicode\\Data\\' => 25,
+ 'Com\\Tecnick\\Unicode\\' => 20,
+ 'Com\\Tecnick\\Pdf\\Sign\\' => 21,
+ 'Com\\Tecnick\\Pdf\\Parser\\' => 23,
+ 'Com\\Tecnick\\Pdf\\Page\\' => 21,
+ 'Com\\Tecnick\\Pdf\\Image\\' => 22,
+ 'Com\\Tecnick\\Pdf\\Graph\\' => 22,
+ 'Com\\Tecnick\\Pdf\\Font\\' => 21,
+ 'Com\\Tecnick\\Pdf\\Filter\\' => 23,
+ 'Com\\Tecnick\\Pdf\\Encrypt\\' => 24,
+ 'Com\\Tecnick\\Pdf\\' => 16,
+ 'Com\\Tecnick\\File\\' => 17,
+ 'Com\\Tecnick\\Color\\' => 18,
+ 'Com\\Tecnick\\Barcode\\' => 20,
+ ),
+ );
+
+ public static $prefixDirsPsr4 = array (
+ 'ZipStream\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/maennchen/zipstream-php/src',
+ ),
+ 'Psr\\SimpleCache\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/simple-cache/src',
+ ),
+ 'Psr\\Http\\Message\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/http-factory/src',
+ 1 => __DIR__ . '/..' . '/psr/http-message/src',
+ ),
+ 'Psr\\Http\\Client\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/http-client/src',
+ ),
+ 'PhpOffice\\PhpSpreadsheet\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet',
+ ),
+ 'PHPMailer\\PHPMailer\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src',
+ ),
+ 'Matrix\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/markbaker/matrix/classes/src',
+ ),
+ 'Composer\\Pcre\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/composer/pcre/src',
+ ),
+ 'Complex\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/markbaker/complex/classes/src',
+ ),
+ 'Com\\Tecnick\\Unicode\\Data\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-unicode-data/src',
+ ),
+ 'Com\\Tecnick\\Unicode\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-unicode/src',
+ ),
+ 'Com\\Tecnick\\Pdf\\Sign\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-pdf-sign/src',
+ ),
+ 'Com\\Tecnick\\Pdf\\Parser\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-pdf-parser/src',
+ ),
+ 'Com\\Tecnick\\Pdf\\Page\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-pdf-page/src',
+ ),
+ 'Com\\Tecnick\\Pdf\\Image\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-pdf-image/src',
+ ),
+ 'Com\\Tecnick\\Pdf\\Graph\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-pdf-graph/src',
+ ),
+ 'Com\\Tecnick\\Pdf\\Font\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-pdf-font/src',
+ ),
+ 'Com\\Tecnick\\Pdf\\Filter\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-pdf-filter/src',
+ ),
+ 'Com\\Tecnick\\Pdf\\Encrypt\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-pdf-encrypt/src',
+ ),
+ 'Com\\Tecnick\\Pdf\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-pdf/src',
+ ),
+ 'Com\\Tecnick\\File\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-file/src',
+ ),
+ 'Com\\Tecnick\\Color\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-color/src',
+ ),
+ 'Com\\Tecnick\\Barcode\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/tecnickcom/tc-lib-barcode/src',
+ ),
+ );
+
+ public static $classMap = array (
+ 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
+ 'Datamatrix' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/datamatrix.php',
+ 'PDF417' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/pdf417.php',
+ 'QRcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/qrcode.php',
+ 'TCPDF' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf.php',
+ 'TCPDF2DBarcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_barcodes_2d.php',
+ 'TCPDFBarcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_barcodes_1d.php',
+ 'TCPDF_COLORS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_colors.php',
+ 'TCPDF_FILTERS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_filters.php',
+ 'TCPDF_FONTS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_fonts.php',
+ 'TCPDF_FONT_DATA' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_font_data.php',
+ 'TCPDF_IMAGES' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_images.php',
+ 'TCPDF_STATIC' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_static.php',
+ );
+
+ public static function getInitializer(ClassLoader $loader)
+ {
+ return \Closure::bind(function () use ($loader) {
+ $loader->prefixLengthsPsr4 = ComposerStaticInit6621356a0da1644f04f6f40bd0e0b948::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInit6621356a0da1644f04f6f40bd0e0b948::$prefixDirsPsr4;
+ $loader->classMap = ComposerStaticInit6621356a0da1644f04f6f40bd0e0b948::$classMap;
+
+ }, null, ClassLoader::class);
+ }
+}
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
new file mode 100644
index 0000000..6f09eef
--- /dev/null
+++ b/vendor/composer/installed.json
@@ -0,0 +1,1772 @@
+{
+ "packages": [
+ {
+ "name": "composer/pcre",
+ "version": "3.3.2",
+ "version_normalized": "3.3.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/pcre.git",
+ "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
+ "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.4 || ^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan": "<1.11.10"
+ },
+ "require-dev": {
+ "phpstan/phpstan": "^1.12 || ^2",
+ "phpstan/phpstan-strict-rules": "^1 || ^2",
+ "phpunit/phpunit": "^8 || ^9"
+ },
+ "time": "2024-11-12T16:29:46+00:00",
+ "type": "library",
+ "extra": {
+ "phpstan": {
+ "includes": [
+ "extension.neon"
+ ]
+ },
+ "branch-alias": {
+ "dev-main": "3.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Composer\\Pcre\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "description": "PCRE wrapping library that offers type-safe preg_* replacements.",
+ "keywords": [
+ "PCRE",
+ "preg",
+ "regex",
+ "regular expression"
+ ],
+ "support": {
+ "issues": "https://github.com/composer/pcre/issues",
+ "source": "https://github.com/composer/pcre/tree/3.3.2"
+ },
+ "funding": [
+ {
+ "url": "https://packagist.com",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/composer",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/composer/composer",
+ "type": "tidelift"
+ }
+ ],
+ "install-path": "./pcre"
+ },
+ {
+ "name": "maennchen/zipstream-php",
+ "version": "3.2.0",
+ "version_normalized": "3.2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/maennchen/ZipStream-PHP.git",
+ "reference": "9712d8fa4cdf9240380b01eb4be55ad8dcf71416"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/9712d8fa4cdf9240380b01eb4be55ad8dcf71416",
+ "reference": "9712d8fa4cdf9240380b01eb4be55ad8dcf71416",
+ "shasum": ""
+ },
+ "require": {
+ "ext-mbstring": "*",
+ "ext-zlib": "*",
+ "php-64bit": "^8.3"
+ },
+ "require-dev": {
+ "brianium/paratest": "^7.7",
+ "ext-zip": "*",
+ "friendsofphp/php-cs-fixer": "^3.16",
+ "guzzlehttp/guzzle": "^7.5",
+ "mikey179/vfsstream": "^1.6",
+ "php-coveralls/php-coveralls": "^2.5",
+ "phpunit/phpunit": "^12.0",
+ "vimeo/psalm": "^6.0"
+ },
+ "suggest": {
+ "guzzlehttp/psr7": "^2.4",
+ "psr/http-message": "^2.0"
+ },
+ "time": "2025-07-17T11:15:13+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "ZipStream\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Paul Duncan",
+ "email": "pabs@pablotron.org"
+ },
+ {
+ "name": "Jonatan Männchen",
+ "email": "jonatan@maennchen.ch"
+ },
+ {
+ "name": "Jesse Donat",
+ "email": "donatj@gmail.com"
+ },
+ {
+ "name": "András Kolesár",
+ "email": "kolesar@kolesar.hu"
+ }
+ ],
+ "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
+ "keywords": [
+ "stream",
+ "zip"
+ ],
+ "support": {
+ "issues": "https://github.com/maennchen/ZipStream-PHP/issues",
+ "source": "https://github.com/maennchen/ZipStream-PHP/tree/3.2.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/maennchen",
+ "type": "github"
+ }
+ ],
+ "install-path": "../maennchen/zipstream-php"
+ },
+ {
+ "name": "markbaker/complex",
+ "version": "3.0.2",
+ "version_normalized": "3.0.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/MarkBaker/PHPComplex.git",
+ "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
+ "reference": "95c56caa1cf5c766ad6d65b6344b807c1e8405b9",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-master",
+ "phpcompatibility/php-compatibility": "^9.3",
+ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
+ "squizlabs/php_codesniffer": "^3.7"
+ },
+ "time": "2022-12-06T16:21:08+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Complex\\": "classes/src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@lange.demon.co.uk"
+ }
+ ],
+ "description": "PHP Class for working with complex numbers",
+ "homepage": "https://github.com/MarkBaker/PHPComplex",
+ "keywords": [
+ "complex",
+ "mathematics"
+ ],
+ "support": {
+ "issues": "https://github.com/MarkBaker/PHPComplex/issues",
+ "source": "https://github.com/MarkBaker/PHPComplex/tree/3.0.2"
+ },
+ "install-path": "../markbaker/complex"
+ },
+ {
+ "name": "markbaker/matrix",
+ "version": "3.0.1",
+ "version_normalized": "3.0.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/MarkBaker/PHPMatrix.git",
+ "reference": "728434227fe21be27ff6d86621a1b13107a2562c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/728434227fe21be27ff6d86621a1b13107a2562c",
+ "reference": "728434227fe21be27ff6d86621a1b13107a2562c",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-master",
+ "phpcompatibility/php-compatibility": "^9.3",
+ "phpdocumentor/phpdocumentor": "2.*",
+ "phploc/phploc": "^4.0",
+ "phpmd/phpmd": "2.*",
+ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
+ "sebastian/phpcpd": "^4.0",
+ "squizlabs/php_codesniffer": "^3.7"
+ },
+ "time": "2022-12-02T22:17:43+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Matrix\\": "classes/src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@demon-angel.eu"
+ }
+ ],
+ "description": "PHP Class for working with matrices",
+ "homepage": "https://github.com/MarkBaker/PHPMatrix",
+ "keywords": [
+ "mathematics",
+ "matrix",
+ "vector"
+ ],
+ "support": {
+ "issues": "https://github.com/MarkBaker/PHPMatrix/issues",
+ "source": "https://github.com/MarkBaker/PHPMatrix/tree/3.0.1"
+ },
+ "install-path": "../markbaker/matrix"
+ },
+ {
+ "name": "phpmailer/phpmailer",
+ "version": "v7.0.0",
+ "version_normalized": "7.0.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPMailer/PHPMailer.git",
+ "reference": "c7111310c6116ba508a6a170a89eaaed2129bd42"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c7111310c6116ba508a6a170a89eaaed2129bd42",
+ "reference": "c7111310c6116ba508a6a170a89eaaed2129bd42",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-filter": "*",
+ "ext-hash": "*",
+ "php": ">=5.5.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^1.0",
+ "doctrine/annotations": "^1.2.6 || ^1.13.3",
+ "php-parallel-lint/php-console-highlighter": "^1.0.0",
+ "php-parallel-lint/php-parallel-lint": "^1.3.2",
+ "phpcompatibility/php-compatibility": "^9.3.5",
+ "roave/security-advisories": "dev-latest",
+ "squizlabs/php_codesniffer": "^3.7.2",
+ "yoast/phpunit-polyfills": "^1.0.4"
+ },
+ "suggest": {
+ "decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
+ "ext-imap": "Needed to support advanced email address parsing according to RFC822",
+ "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
+ "ext-openssl": "Needed for secure SMTP sending and DKIM signing",
+ "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
+ "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
+ "league/oauth2-google": "Needed for Google XOAUTH2 authentication",
+ "psr/log": "For optional PSR-3 debug logging",
+ "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": "2025-10-15T16:40:02+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "PHPMailer\\PHPMailer\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-2.1-only"
+ ],
+ "authors": [
+ {
+ "name": "Marcus Bointon",
+ "email": "phpmailer@synchromedia.co.uk"
+ },
+ {
+ "name": "Jim Jagielski",
+ "email": "jimjag@gmail.com"
+ },
+ {
+ "name": "Andy Prevost",
+ "email": "codeworxtech@users.sourceforge.net"
+ },
+ {
+ "name": "Brent R. Matzelle"
+ }
+ ],
+ "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
+ "support": {
+ "issues": "https://github.com/PHPMailer/PHPMailer/issues",
+ "source": "https://github.com/PHPMailer/PHPMailer/tree/v7.0.0"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/Synchro",
+ "type": "github"
+ }
+ ],
+ "install-path": "../phpmailer/phpmailer"
+ },
+ {
+ "name": "phpoffice/phpspreadsheet",
+ "version": "5.2.0",
+ "version_normalized": "5.2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
+ "reference": "3b8994b3aac4b61018bc04fc8c441f4fd68c18eb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/3b8994b3aac4b61018bc04fc8c441f4fd68c18eb",
+ "reference": "3b8994b3aac4b61018bc04fc8c441f4fd68c18eb",
+ "shasum": ""
+ },
+ "require": {
+ "composer/pcre": "^1||^2||^3",
+ "ext-ctype": "*",
+ "ext-dom": "*",
+ "ext-fileinfo": "*",
+ "ext-gd": "*",
+ "ext-iconv": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-simplexml": "*",
+ "ext-xml": "*",
+ "ext-xmlreader": "*",
+ "ext-xmlwriter": "*",
+ "ext-zip": "*",
+ "ext-zlib": "*",
+ "maennchen/zipstream-php": "^2.1 || ^3.0",
+ "markbaker/complex": "^3.0",
+ "markbaker/matrix": "^3.0",
+ "php": "^8.1",
+ "psr/http-client": "^1.0",
+ "psr/http-factory": "^1.0",
+ "psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-main",
+ "dompdf/dompdf": "^2.0 || ^3.0",
+ "friendsofphp/php-cs-fixer": "^3.2",
+ "mitoteam/jpgraph": "^10.5",
+ "mpdf/mpdf": "^8.1.1",
+ "phpcompatibility/php-compatibility": "^9.3",
+ "phpstan/phpstan": "^1.1 || ^2.0",
+ "phpstan/phpstan-deprecation-rules": "^1.0 || ^2.0",
+ "phpstan/phpstan-phpunit": "^1.0 || ^2.0",
+ "phpunit/phpunit": "^10.5",
+ "squizlabs/php_codesniffer": "^3.7",
+ "tecnickcom/tcpdf": "^6.5"
+ },
+ "suggest": {
+ "dompdf/dompdf": "Option for rendering PDF with PDF Writer",
+ "ext-intl": "PHP Internationalization Functions, regquired for NumberFormat Wizard",
+ "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
+ "mpdf/mpdf": "Option for rendering PDF with PDF Writer",
+ "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
+ },
+ "time": "2025-10-26T15:54:22+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Maarten Balliauw",
+ "homepage": "https://blog.maartenballiauw.be"
+ },
+ {
+ "name": "Mark Baker",
+ "homepage": "https://markbakeruk.net"
+ },
+ {
+ "name": "Franck Lefevre",
+ "homepage": "https://rootslabs.net"
+ },
+ {
+ "name": "Erik Tilt"
+ },
+ {
+ "name": "Adrien Crivelli"
+ }
+ ],
+ "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
+ "homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
+ "keywords": [
+ "OpenXML",
+ "excel",
+ "gnumeric",
+ "ods",
+ "php",
+ "spreadsheet",
+ "xls",
+ "xlsx"
+ ],
+ "support": {
+ "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
+ "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/5.2.0"
+ },
+ "install-path": "../phpoffice/phpspreadsheet"
+ },
+ {
+ "name": "psr/http-client",
+ "version": "1.0.3",
+ "version_normalized": "1.0.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-client.git",
+ "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90",
+ "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.0 || ^8.0",
+ "psr/http-message": "^1.0 || ^2.0"
+ },
+ "time": "2023-09-23T14:17:50+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Client\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for HTTP clients",
+ "homepage": "https://github.com/php-fig/http-client",
+ "keywords": [
+ "http",
+ "http-client",
+ "psr",
+ "psr-18"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-client"
+ },
+ "install-path": "../psr/http-client"
+ },
+ {
+ "name": "psr/http-factory",
+ "version": "1.1.0",
+ "version_normalized": "1.1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-factory.git",
+ "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
+ "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.1",
+ "psr/http-message": "^1.0 || ^2.0"
+ },
+ "time": "2024-04-15T12:06:14+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories",
+ "keywords": [
+ "factory",
+ "http",
+ "message",
+ "psr",
+ "psr-17",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-factory"
+ },
+ "install-path": "../psr/http-factory"
+ },
+ {
+ "name": "psr/http-message",
+ "version": "2.0",
+ "version_normalized": "2.0.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/http-message.git",
+ "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71",
+ "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "time": "2023-04-04T09:54:51+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Http\\Message\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "https://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for HTTP messages",
+ "homepage": "https://github.com/php-fig/http-message",
+ "keywords": [
+ "http",
+ "http-message",
+ "psr",
+ "psr-7",
+ "request",
+ "response"
+ ],
+ "support": {
+ "source": "https://github.com/php-fig/http-message/tree/2.0"
+ },
+ "install-path": "../psr/http-message"
+ },
+ {
+ "name": "psr/simple-cache",
+ "version": "3.0.0",
+ "version_normalized": "3.0.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/simple-cache.git",
+ "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865",
+ "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.0.0"
+ },
+ "time": "2021-10-29T13:26:27+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.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": "https://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/3.0.0"
+ },
+ "install-path": "../psr/simple-cache"
+ },
+ {
+ "name": "tecnickcom/tc-lib-barcode",
+ "version": "2.13.2",
+ "version_normalized": "2.13.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-barcode.git",
+ "reference": "c7f3ddbc3df10259c59ddc3016ec421267e25e5d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-barcode/zipball/c7f3ddbc3df10259c59ddc3016ec421267e25e5d",
+ "reference": "c7f3ddbc3df10259c59ddc3016ec421267e25e5d",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-gd": "*",
+ "ext-pcre": "*",
+ "php": ">=8.2",
+ "tecnickcom/tc-lib-color": "^2.13"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "suggest": {
+ "ext-bcmath": "Speeds up the arbitrary precision arithmetic used by the IMB and PDF417 barcode types (a pure-PHP implementation is used when missing)",
+ "ext-imagick": "Alternative PNG renderer used by getPngData() when the extension is loaded"
+ },
+ "time": "2026-08-07T08:07:20+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Barcode\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library to generate linear and bidimensional barcodes",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "3 of 9",
+ "ANSI MH10.8M-1983",
+ "CBC",
+ "CODABAR",
+ "CODE 11",
+ "CODE 128 A B C",
+ "CODE 39",
+ "CODE 93",
+ "EAN 13",
+ "EAN 8",
+ "ECC200",
+ "ISO IEC 15438 2006",
+ "ISO IEC 16022",
+ "ISO IEC 24778 2008",
+ "Intelligent Mail Barcode",
+ "Interleaved 2 of 5",
+ "KIX",
+ "Klant",
+ "MSI",
+ "Onecode",
+ "PHARMACODE",
+ "PHARMACODE TWO-TRACKS",
+ "POSTNET",
+ "RMS4CC",
+ "Standard 2 of 5",
+ "UPC-A",
+ "UPC-E",
+ "USD-3",
+ "USPS-B-3200",
+ "USS-93",
+ "aztec",
+ "barcode",
+ "datamatrix",
+ "pdf417",
+ "planet",
+ "qr-code",
+ "royal mail",
+ "tc-lib-barcode",
+ "upc"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-barcode/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-barcode"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-barcode"
+ },
+ {
+ "name": "tecnickcom/tc-lib-color",
+ "version": "2.13.3",
+ "version_normalized": "2.13.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-color.git",
+ "reference": "36b0cb2215c446fed65842151d494f2b3081533c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-color/zipball/36b0cb2215c446fed65842151d494f2b3081533c",
+ "reference": "36b0cb2215c446fed65842151d494f2b3081533c",
+ "shasum": ""
+ },
+ "require": {
+ "ext-pcre": "*",
+ "php": ">=8.2"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "time": "2026-08-07T08:05:09+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Color\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library to manipulate various color representations",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "cmyk",
+ "color",
+ "colors",
+ "colour",
+ "colours",
+ "hsl",
+ "hsla",
+ "javascript",
+ "rgb",
+ "rgba",
+ "tc-lib-color",
+ "web"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-color/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-color"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-color"
+ },
+ {
+ "name": "tecnickcom/tc-lib-file",
+ "version": "3.7.3",
+ "version_normalized": "3.7.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-file.git",
+ "reference": "c582b6d493c26703e95809f6d3e938c79f88885f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-file/zipball/c582b6d493c26703e95809f6d3e938c79f88885f",
+ "reference": "c582b6d493c26703e95809f6d3e938c79f88885f",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "ext-pcre": "*",
+ "php": ">=8.2"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^13.2 || ^12.5 || ^11.5"
+ },
+ "suggest": {
+ "ext-intl": "Enables Unicode NFC normalization when matching paths against the allowlist"
+ },
+ "time": "2026-08-07T08:05:39+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\File\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library to read byte-level data from files",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "Double",
+ "bit",
+ "byte",
+ "file",
+ "long",
+ "read",
+ "short",
+ "tc-lib-file"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-file/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-file"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-file"
+ },
+ {
+ "name": "tecnickcom/tc-lib-pdf",
+ "version": "8.68.3",
+ "version_normalized": "8.68.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-pdf.git",
+ "reference": "6b056239c0d9781319a4d009e8ca33d48e94e0ea"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf/zipball/6b056239c0d9781319a4d009e8ca33d48e94e0ea",
+ "reference": "6b056239c0d9781319a4d009e8ca33d48e94e0ea",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-filter": "*",
+ "ext-hash": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "ext-openssl": "*",
+ "ext-pcre": "*",
+ "ext-xml": "*",
+ "ext-zlib": "*",
+ "php": ">=8.2",
+ "tecnickcom/tc-lib-barcode": "^2.13",
+ "tecnickcom/tc-lib-color": "^2.13",
+ "tecnickcom/tc-lib-file": "^3.7",
+ "tecnickcom/tc-lib-pdf-encrypt": "^2.9",
+ "tecnickcom/tc-lib-pdf-font": "^3.13",
+ "tecnickcom/tc-lib-pdf-graph": "^2.15",
+ "tecnickcom/tc-lib-pdf-image": "^3.12",
+ "tecnickcom/tc-lib-pdf-page": "^4.14",
+ "tecnickcom/tc-lib-pdf-parser": "^3.14",
+ "tecnickcom/tc-lib-pdf-sign": "^1.1",
+ "tecnickcom/tc-lib-unicode": "^3.0",
+ "tecnickcom/tc-lib-unicode-data": "^3.0"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "suggest": {
+ "ext-curl": "Required to contact a Timestamp Authority (RFC 3161) when timestamping signatures",
+ "ext-intl": "Enables Unicode NFC normalization of the PDF file name"
+ },
+ "time": "2026-08-07T08:11:00+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Pdf\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP PDF Library",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "PDFD32000-2008",
+ "TCPDF",
+ "document",
+ "pdf",
+ "tc-lib-pdf"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-pdf/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-pdf"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-pdf"
+ },
+ {
+ "name": "tecnickcom/tc-lib-pdf-encrypt",
+ "version": "2.9.3",
+ "version_normalized": "2.9.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-pdf-encrypt.git",
+ "reference": "9d188937a673af8adc6da1f104c44cf434f7b198"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-encrypt/zipball/9d188937a673af8adc6da1f104c44cf434f7b198",
+ "reference": "9d188937a673af8adc6da1f104c44cf434f7b198",
+ "shasum": ""
+ },
+ "require": {
+ "ext-hash": "*",
+ "ext-openssl": "*",
+ "ext-pcre": "*",
+ "php": ">=8.2"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "suggest": {
+ "ext-posix": "Adds the process id to the random seed material"
+ },
+ "time": "2026-08-07T08:05:51+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Pdf\\Encrypt\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library to encrypt data for PDF",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "aes",
+ "encrypt",
+ "encryption",
+ "pdf",
+ "rc4",
+ "tc-lib-pdf-encrypt"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-pdf-encrypt/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-pdf-encrypt"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-pdf-encrypt"
+ },
+ {
+ "name": "tecnickcom/tc-lib-pdf-filter",
+ "version": "2.10.3",
+ "version_normalized": "2.10.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-pdf-filter.git",
+ "reference": "48270d50db69852ef58a22b5b034b8a08e5c8464"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-filter/zipball/48270d50db69852ef58a22b5b034b8a08e5c8464",
+ "reference": "48270d50db69852ef58a22b5b034b8a08e5c8464",
+ "shasum": ""
+ },
+ "require": {
+ "ext-pcre": "*",
+ "ext-zlib": "*",
+ "php": ">=8.2"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "suggest": {
+ "ext-imagick": "Required for the JPXDecode (JPEG 2000) and CCITTFaxDecode filters"
+ },
+ "time": "2026-08-07T08:06:03+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Pdf\\Filter\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library to decode PDF compression and encryption filters",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "compression",
+ "encryption",
+ "filter",
+ "pdf",
+ "tc-lib-pdf-filter"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-pdf-filter/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-pdf-filter"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-pdf-filter"
+ },
+ {
+ "name": "tecnickcom/tc-lib-pdf-font",
+ "version": "3.13.2",
+ "version_normalized": "3.13.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-pdf-font.git",
+ "reference": "314dfbe240057e1119d4830f35827455f8a76eba"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-font/zipball/314dfbe240057e1119d4830f35827455f8a76eba",
+ "reference": "314dfbe240057e1119d4830f35827455f8a76eba",
+ "shasum": ""
+ },
+ "require": {
+ "ext-hash": "*",
+ "ext-json": "*",
+ "ext-pcre": "*",
+ "ext-zlib": "*",
+ "php": ">=8.2",
+ "tecnickcom/tc-lib-file": "^3.7",
+ "tecnickcom/tc-lib-pdf-encrypt": "^2.9",
+ "tecnickcom/tc-lib-unicode-data": "^3.0"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "suggest": {
+ "ext-iconv": "Decodes legacy Macintosh (MacRoman) TrueType name strings",
+ "ext-mbstring": "Decodes UTF-16BE and Windows-1252 TrueType name strings"
+ },
+ "time": "2026-08-07T08:09:37+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Pdf\\Font\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library containing PDF page formats and definitions",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "PFB",
+ "afm",
+ "font",
+ "import",
+ "pdf",
+ "tc-lib-pdf-font",
+ "ttf"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-pdf-font/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-pdf-font"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-pdf-font"
+ },
+ {
+ "name": "tecnickcom/tc-lib-pdf-graph",
+ "version": "2.15.2",
+ "version_normalized": "2.15.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-pdf-graph.git",
+ "reference": "4a3408690c65e14b9c86abe97a12c3079eb8a0cd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-graph/zipball/4a3408690c65e14b9c86abe97a12c3079eb8a0cd",
+ "reference": "4a3408690c65e14b9c86abe97a12c3079eb8a0cd",
+ "shasum": ""
+ },
+ "require": {
+ "ext-zlib": "*",
+ "php": ">=8.2",
+ "tecnickcom/tc-lib-color": "^2.13",
+ "tecnickcom/tc-lib-pdf-encrypt": "^2.9"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "time": "2026-08-07T08:08:50+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Pdf\\Graph\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library containing PDF graphic and geometric methods",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "geometry",
+ "graphic",
+ "pdf",
+ "tc-lib-pdf-graph",
+ "transformation"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-pdf-graph/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-pdf-graph"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-pdf-graph"
+ },
+ {
+ "name": "tecnickcom/tc-lib-pdf-image",
+ "version": "3.12.2",
+ "version_normalized": "3.12.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-pdf-image.git",
+ "reference": "d7052a7e9216e842bd77395f1dfb443e9bfbcef8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-image/zipball/d7052a7e9216e842bd77395f1dfb443e9bfbcef8",
+ "reference": "d7052a7e9216e842bd77395f1dfb443e9bfbcef8",
+ "shasum": ""
+ },
+ "require": {
+ "ext-gd": "*",
+ "ext-zlib": "*",
+ "php": ">=8.2",
+ "tecnickcom/tc-lib-color": "^2.13",
+ "tecnickcom/tc-lib-file": "^3.7",
+ "tecnickcom/tc-lib-pdf-encrypt": "^2.9"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "time": "2026-08-07T08:09:04+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Pdf\\Image\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library containing PDF Image methods",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "image",
+ "jpeg",
+ "jpg",
+ "pdf",
+ "png",
+ "tc-lib-pdf-image"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-pdf-image/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-pdf-image"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-pdf-image"
+ },
+ {
+ "name": "tecnickcom/tc-lib-pdf-page",
+ "version": "4.14.2",
+ "version_normalized": "4.14.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-pdf-page.git",
+ "reference": "ac9adaddf8624b5008da335914a42a318cd7d310"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-page/zipball/ac9adaddf8624b5008da335914a42a318cd7d310",
+ "reference": "ac9adaddf8624b5008da335914a42a318cd7d310",
+ "shasum": ""
+ },
+ "require": {
+ "ext-zlib": "*",
+ "php": ">=8.2",
+ "tecnickcom/tc-lib-color": "^2.13",
+ "tecnickcom/tc-lib-pdf-encrypt": "^2.9"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "time": "2026-08-07T08:08:37+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Pdf\\Page\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library containing PDF page formats and definitions",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "format",
+ "page",
+ "pdf",
+ "tc-lib-pdf-page"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-pdf-page/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-pdf-page"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-pdf-page"
+ },
+ {
+ "name": "tecnickcom/tc-lib-pdf-parser",
+ "version": "3.14.2",
+ "version_normalized": "3.14.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-pdf-parser.git",
+ "reference": "db9c32046a3e8d57c8626e8d3ffc94caa10a0675"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-parser/zipball/db9c32046a3e8d57c8626e8d3ffc94caa10a0675",
+ "reference": "db9c32046a3e8d57c8626e8d3ffc94caa10a0675",
+ "shasum": ""
+ },
+ "require": {
+ "ext-pcre": "*",
+ "php": ">=8.2",
+ "tecnickcom/tc-lib-pdf-filter": "^2.10"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "time": "2026-08-07T08:08:23+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Pdf\\Parser\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library to parse PDF documents",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "document",
+ "parser",
+ "pdf",
+ "tc-lib-pdf-parser"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-pdf-parser/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-pdf-parser"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-pdf-parser"
+ },
+ {
+ "name": "tecnickcom/tc-lib-pdf-sign",
+ "version": "1.1.3",
+ "version_normalized": "1.1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-pdf-sign.git",
+ "reference": "4132f1fc4b9c103b1a9ec879e2d7b7f9598918f7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-pdf-sign/zipball/4132f1fc4b9c103b1a9ec879e2d7b7f9598918f7",
+ "reference": "4132f1fc4b9c103b1a9ec879e2d7b7f9598918f7",
+ "shasum": ""
+ },
+ "require": {
+ "ext-hash": "*",
+ "ext-openssl": "*",
+ "ext-pcre": "*",
+ "php": ">=8.2"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "time": "2026-08-07T08:06:17+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Pdf\\Sign\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library to create and embed digital signatures (PKCS#7 / CAdES / PAdES) in PDF documents",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "cades",
+ "digital-signature",
+ "pades",
+ "pdf",
+ "pkcs7",
+ "sign",
+ "signature",
+ "tc-lib-pdf-sign",
+ "timestamp"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-pdf-sign/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-pdf-sign"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-pdf-sign"
+ },
+ {
+ "name": "tecnickcom/tc-lib-unicode",
+ "version": "3.0.2",
+ "version_normalized": "3.0.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-unicode.git",
+ "reference": "e0549f1e0bee657a7a5c361d823409655a4ea2c3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-unicode/zipball/e0549f1e0bee657a7a5c361d823409655a4ea2c3",
+ "reference": "e0549f1e0bee657a7a5c361d823409655a4ea2c3",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-mbstring": "*",
+ "ext-pcre": "*",
+ "php": ">=8.2",
+ "tecnickcom/tc-lib-unicode-data": "^3.0"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "time": "2026-08-07T08:08:11+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Unicode\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library containing Unicode methods",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "font",
+ "pdf",
+ "tc-lib-unicode",
+ "unicode",
+ "utf-8"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-unicode/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-unicode"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-unicode"
+ },
+ {
+ "name": "tecnickcom/tc-lib-unicode-data",
+ "version": "3.0.2",
+ "version_normalized": "3.0.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/tc-lib-unicode-data.git",
+ "reference": "6b090f51613087c2ed6e576e9543c1feddf2ba51"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/tc-lib-unicode-data/zipball/6b090f51613087c2ed6e576e9543c1feddf2ba51",
+ "reference": "6b090f51613087c2ed6e576e9543c1feddf2ba51",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=8.2"
+ },
+ "require-dev": {
+ "pdepend/pdepend": "^2.16",
+ "phpunit/phpunit": "^11.5 || ^12.5 || ^13.2"
+ },
+ "time": "2026-08-07T08:06:30+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Com\\Tecnick\\Unicode\\Data\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP library containing Unicode definitions",
+ "homepage": "https://tcpdf.org",
+ "keywords": [
+ "font",
+ "pdf",
+ "tc-lib-unicode-data",
+ "unicode",
+ "utf-8"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/tc-lib-unicode-data/issues",
+ "source": "https://github.com/tecnickcom/tc-lib-unicode-data"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sponsors/tecnickcom",
+ "type": "github"
+ }
+ ],
+ "install-path": "../tecnickcom/tc-lib-unicode-data"
+ },
+ {
+ "name": "tecnickcom/tcpdf",
+ "version": "6.10.0",
+ "version_normalized": "6.10.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/TCPDF.git",
+ "reference": "ca5b6de294512145db96bcbc94e61696599c391d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/ca5b6de294512145db96bcbc94e61696599c391d",
+ "reference": "ca5b6de294512145db96bcbc94e61696599c391d",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "php": ">=7.1.0"
+ },
+ "time": "2025-05-27T18:02:28+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "classmap": [
+ "config",
+ "include",
+ "tcpdf.php",
+ "tcpdf_barcodes_1d.php",
+ "tcpdf_barcodes_2d.php",
+ "include/tcpdf_colors.php",
+ "include/tcpdf_filters.php",
+ "include/tcpdf_font_data.php",
+ "include/tcpdf_fonts.php",
+ "include/tcpdf_images.php",
+ "include/tcpdf_static.php",
+ "include/barcodes/datamatrix.php",
+ "include/barcodes/pdf417.php",
+ "include/barcodes/qrcode.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
+ "homepage": "http://www.tcpdf.org/",
+ "keywords": [
+ "PDFD32000-2008",
+ "TCPDF",
+ "barcodes",
+ "datamatrix",
+ "pdf",
+ "pdf417",
+ "qrcode"
+ ],
+ "support": {
+ "issues": "https://github.com/tecnickcom/TCPDF/issues",
+ "source": "https://github.com/tecnickcom/TCPDF/tree/6.10.0"
+ },
+ "funding": [
+ {
+ "url": "https://www.paypal.com/donate/?hosted_button_id=NZUEC5XS8MFBJ",
+ "type": "custom"
+ }
+ ],
+ "install-path": "../tecnickcom/tcpdf"
+ }
+ ],
+ "dev": true,
+ "dev-package-names": []
+}
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
new file mode 100644
index 0000000..7bb6e9a
--- /dev/null
+++ b/vendor/composer/installed.php
@@ -0,0 +1,248 @@
+ array(
+ 'name' => '__root__',
+ 'pretty_version' => '1.0.0+no-version-set',
+ 'version' => '1.0.0.0',
+ 'reference' => null,
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'dev' => true,
+ ),
+ 'versions' => array(
+ '__root__' => array(
+ 'pretty_version' => '1.0.0+no-version-set',
+ 'version' => '1.0.0.0',
+ 'reference' => null,
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'composer/pcre' => array(
+ 'pretty_version' => '3.3.2',
+ 'version' => '3.3.2.0',
+ 'reference' => 'b2bed4734f0cc156ee1fe9c0da2550420d99a21e',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/./pcre',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'maennchen/zipstream-php' => array(
+ 'pretty_version' => '3.2.0',
+ 'version' => '3.2.0.0',
+ 'reference' => '9712d8fa4cdf9240380b01eb4be55ad8dcf71416',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../maennchen/zipstream-php',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'markbaker/complex' => array(
+ 'pretty_version' => '3.0.2',
+ 'version' => '3.0.2.0',
+ 'reference' => '95c56caa1cf5c766ad6d65b6344b807c1e8405b9',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../markbaker/complex',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'markbaker/matrix' => array(
+ 'pretty_version' => '3.0.1',
+ 'version' => '3.0.1.0',
+ 'reference' => '728434227fe21be27ff6d86621a1b13107a2562c',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../markbaker/matrix',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'phpmailer/phpmailer' => array(
+ 'pretty_version' => 'v7.0.0',
+ 'version' => '7.0.0.0',
+ 'reference' => 'c7111310c6116ba508a6a170a89eaaed2129bd42',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../phpmailer/phpmailer',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'phpoffice/phpspreadsheet' => array(
+ 'pretty_version' => '5.2.0',
+ 'version' => '5.2.0.0',
+ 'reference' => '3b8994b3aac4b61018bc04fc8c441f4fd68c18eb',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../phpoffice/phpspreadsheet',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'psr/http-client' => array(
+ 'pretty_version' => '1.0.3',
+ 'version' => '1.0.3.0',
+ 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/http-client',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'psr/http-factory' => array(
+ 'pretty_version' => '1.1.0',
+ 'version' => '1.1.0.0',
+ 'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/http-factory',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'psr/http-message' => array(
+ 'pretty_version' => '2.0',
+ 'version' => '2.0.0.0',
+ 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/http-message',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'psr/simple-cache' => array(
+ 'pretty_version' => '3.0.0',
+ 'version' => '3.0.0.0',
+ 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../psr/simple-cache',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-barcode' => array(
+ 'pretty_version' => '2.13.2',
+ 'version' => '2.13.2.0',
+ 'reference' => 'c7f3ddbc3df10259c59ddc3016ec421267e25e5d',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-barcode',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-color' => array(
+ 'pretty_version' => '2.13.3',
+ 'version' => '2.13.3.0',
+ 'reference' => '36b0cb2215c446fed65842151d494f2b3081533c',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-color',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-file' => array(
+ 'pretty_version' => '3.7.3',
+ 'version' => '3.7.3.0',
+ 'reference' => 'c582b6d493c26703e95809f6d3e938c79f88885f',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-file',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-pdf' => array(
+ 'pretty_version' => '8.68.3',
+ 'version' => '8.68.3.0',
+ 'reference' => '6b056239c0d9781319a4d009e8ca33d48e94e0ea',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-pdf',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-pdf-encrypt' => array(
+ 'pretty_version' => '2.9.3',
+ 'version' => '2.9.3.0',
+ 'reference' => '9d188937a673af8adc6da1f104c44cf434f7b198',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-pdf-encrypt',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-pdf-filter' => array(
+ 'pretty_version' => '2.10.3',
+ 'version' => '2.10.3.0',
+ 'reference' => '48270d50db69852ef58a22b5b034b8a08e5c8464',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-pdf-filter',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-pdf-font' => array(
+ 'pretty_version' => '3.13.2',
+ 'version' => '3.13.2.0',
+ 'reference' => '314dfbe240057e1119d4830f35827455f8a76eba',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-pdf-font',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-pdf-graph' => array(
+ 'pretty_version' => '2.15.2',
+ 'version' => '2.15.2.0',
+ 'reference' => '4a3408690c65e14b9c86abe97a12c3079eb8a0cd',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-pdf-graph',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-pdf-image' => array(
+ 'pretty_version' => '3.12.2',
+ 'version' => '3.12.2.0',
+ 'reference' => 'd7052a7e9216e842bd77395f1dfb443e9bfbcef8',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-pdf-image',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-pdf-page' => array(
+ 'pretty_version' => '4.14.2',
+ 'version' => '4.14.2.0',
+ 'reference' => 'ac9adaddf8624b5008da335914a42a318cd7d310',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-pdf-page',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-pdf-parser' => array(
+ 'pretty_version' => '3.14.2',
+ 'version' => '3.14.2.0',
+ 'reference' => 'db9c32046a3e8d57c8626e8d3ffc94caa10a0675',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-pdf-parser',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-pdf-sign' => array(
+ 'pretty_version' => '1.1.3',
+ 'version' => '1.1.3.0',
+ 'reference' => '4132f1fc4b9c103b1a9ec879e2d7b7f9598918f7',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-pdf-sign',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-unicode' => array(
+ 'pretty_version' => '3.0.2',
+ 'version' => '3.0.2.0',
+ 'reference' => 'e0549f1e0bee657a7a5c361d823409655a4ea2c3',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-unicode',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tc-lib-unicode-data' => array(
+ 'pretty_version' => '3.0.2',
+ 'version' => '3.0.2.0',
+ 'reference' => '6b090f51613087c2ed6e576e9543c1feddf2ba51',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tc-lib-unicode-data',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ 'tecnickcom/tcpdf' => array(
+ 'pretty_version' => '6.10.0',
+ 'version' => '6.10.0.0',
+ 'reference' => 'ca5b6de294512145db96bcbc94e61696599c391d',
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../tecnickcom/tcpdf',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ ),
+);
diff --git a/vendor/composer/pcre/LICENSE b/vendor/composer/pcre/LICENSE
new file mode 100644
index 0000000..c5a282f
--- /dev/null
+++ b/vendor/composer/pcre/LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2021 Composer
+
+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.
diff --git a/vendor/composer/pcre/README.md b/vendor/composer/pcre/README.md
new file mode 100644
index 0000000..4906514
--- /dev/null
+++ b/vendor/composer/pcre/README.md
@@ -0,0 +1,189 @@
+composer/pcre
+=============
+
+PCRE wrapping library that offers type-safe `preg_*` replacements.
+
+This library gives you a way to ensure `preg_*` functions do not fail silently, returning
+unexpected `null`s that may not be handled.
+
+As of 3.0 this library enforces [`PREG_UNMATCHED_AS_NULL`](#preg_unmatched_as_null) usage
+for all matching and replaceCallback functions, [read more below](#preg_unmatched_as_null)
+to understand the implications.
+
+It thus makes it easier to work with static analysis tools like PHPStan or Psalm as it
+simplifies and reduces the possible return values from all the `preg_*` functions which
+are quite packed with edge cases. As of v2.2.0 / v3.2.0 the library also comes with a
+[PHPStan extension](#phpstan-extension) for parsing regular expressions and giving you even better output types.
+
+This library is a thin wrapper around `preg_*` functions with [some limitations](#restrictions--limitations).
+If you are looking for a richer API to handle regular expressions have a look at
+[rawr/t-regx](https://packagist.org/packages/rawr/t-regx) instead.
+
+[](https://github.com/composer/pcre/actions)
+
+
+Installation
+------------
+
+Install the latest version with:
+
+```bash
+$ composer require composer/pcre
+```
+
+
+Requirements
+------------
+
+* PHP 7.4.0 is required for 3.x versions
+* PHP 7.2.0 is required for 2.x versions
+* PHP 5.3.2 is required for 1.x versions
+
+
+Basic usage
+-----------
+
+Instead of:
+
+```php
+if (preg_match('{fo+}', $string, $matches)) { ... }
+if (preg_match('{fo+}', $string, $matches, PREG_OFFSET_CAPTURE)) { ... }
+if (preg_match_all('{fo+}', $string, $matches)) { ... }
+$newString = preg_replace('{fo+}', 'bar', $string);
+$newString = preg_replace_callback('{fo+}', function ($match) { return strtoupper($match[0]); }, $string);
+$newString = preg_replace_callback_array(['{fo+}' => fn ($match) => strtoupper($match[0])], $string);
+$filtered = preg_grep('{[a-z]}', $elements);
+$array = preg_split('{[a-z]+}', $string);
+```
+
+You can now call these on the `Preg` class:
+
+```php
+use Composer\Pcre\Preg;
+
+if (Preg::match('{fo+}', $string, $matches)) { ... }
+if (Preg::matchWithOffsets('{fo+}', $string, $matches)) { ... }
+if (Preg::matchAll('{fo+}', $string, $matches)) { ... }
+$newString = Preg::replace('{fo+}', 'bar', $string);
+$newString = Preg::replaceCallback('{fo+}', function ($match) { return strtoupper($match[0]); }, $string);
+$newString = Preg::replaceCallbackArray(['{fo+}' => fn ($match) => strtoupper($match[0])], $string);
+$filtered = Preg::grep('{[a-z]}', $elements);
+$array = Preg::split('{[a-z]+}', $string);
+```
+
+The main difference is if anything fails to match/replace/.., it will throw a `Composer\Pcre\PcreException`
+instead of returning `null` (or false in some cases), so you can now use the return values safely relying on
+the fact that they can only be strings (for replace), ints (for match) or arrays (for grep/split).
+
+Additionally the `Preg` class provides match methods that return `bool` rather than `int`, for stricter type safety
+when the number of pattern matches is not useful:
+
+```php
+use Composer\Pcre\Preg;
+
+if (Preg::isMatch('{fo+}', $string, $matches)) // bool
+if (Preg::isMatchAll('{fo+}', $string, $matches)) // bool
+```
+
+Finally the `Preg` class provides a few `*StrictGroups` method variants that ensure match groups
+are always present and thus non-nullable, making it easier to write type-safe code:
+
+```php
+use Composer\Pcre\Preg;
+
+// $matches is guaranteed to be an array of strings, if a subpattern does not match and produces a null it will throw
+if (Preg::matchStrictGroups('{fo+}', $string, $matches))
+if (Preg::matchAllStrictGroups('{fo+}', $string, $matches))
+```
+
+**Note:** This is generally safe to use as long as you do not have optional subpatterns (i.e. `(something)?`
+or `(something)*` or branches with a `|` that result in some groups not being matched at all).
+A subpattern that can match an empty string like `(.*)` is **not** optional, it will be present as an
+empty string in the matches. A non-matching subpattern, even if optional like `(?:foo)?` will anyway not be present in
+matches so it is also not a problem to use these with `*StrictGroups` methods.
+
+If you would prefer a slightly more verbose usage, replacing by-ref arguments by result objects, you can use the `Regex` class:
+
+```php
+use Composer\Pcre\Regex;
+
+// this is useful when you are just interested in knowing if something matched
+// as it returns a bool instead of int(1/0) for match
+$bool = Regex::isMatch('{fo+}', $string);
+
+$result = Regex::match('{fo+}', $string);
+if ($result->matched) { something($result->matches); }
+
+$result = Regex::matchWithOffsets('{fo+}', $string);
+if ($result->matched) { something($result->matches); }
+
+$result = Regex::matchAll('{fo+}', $string);
+if ($result->matched && $result->count > 3) { something($result->matches); }
+
+$newString = Regex::replace('{fo+}', 'bar', $string)->result;
+$newString = Regex::replaceCallback('{fo+}', function ($match) { return strtoupper($match[0]); }, $string)->result;
+$newString = Regex::replaceCallbackArray(['{fo+}' => fn ($match) => strtoupper($match[0])], $string)->result;
+```
+
+Note that `preg_grep` and `preg_split` are only callable via the `Preg` class as they do not have
+complex return types warranting a specific result object.
+
+See the [MatchResult](src/MatchResult.php), [MatchWithOffsetsResult](src/MatchWithOffsetsResult.php), [MatchAllResult](src/MatchAllResult.php),
+[MatchAllWithOffsetsResult](src/MatchAllWithOffsetsResult.php), and [ReplaceResult](src/ReplaceResult.php) class sources for more details.
+
+Restrictions / Limitations
+--------------------------
+
+Due to type safety requirements a few restrictions are in place.
+
+- matching using `PREG_OFFSET_CAPTURE` is made available via `matchWithOffsets` and `matchAllWithOffsets`.
+ You cannot pass the flag to `match`/`matchAll`.
+- `Preg::split` will also reject `PREG_SPLIT_OFFSET_CAPTURE` and you should use `splitWithOffsets`
+ instead.
+- `matchAll` rejects `PREG_SET_ORDER` as it also changes the shape of the returned matches. There
+ is no alternative provided as you can fairly easily code around it.
+- `preg_filter` is not supported as it has a rather crazy API, most likely you should rather
+ use `Preg::grep` in combination with some loop and `Preg::replace`.
+- `replace`, `replaceCallback` and `replaceCallbackArray` do not support an array `$subject`,
+ only simple strings.
+- As of 2.0, the library always uses `PREG_UNMATCHED_AS_NULL` for matching, which offers [much
+ saner/more predictable results](#preg_unmatched_as_null). As of 3.0 the flag is also set for
+ `replaceCallback` and `replaceCallbackArray`.
+
+#### PREG_UNMATCHED_AS_NULL
+
+As of 2.0, this library always uses PREG_UNMATCHED_AS_NULL for all `match*` and `isMatch*`
+functions. As of 3.0 it is also done for `replaceCallback` and `replaceCallbackArray`.
+
+This means your matches will always contain all matching groups, either as null if unmatched
+or as string if it matched.
+
+The advantages in clarity and predictability are clearer if you compare the two outputs of
+running this with and without PREG_UNMATCHED_AS_NULL in $flags:
+
+```php
+preg_match('/(a)(b)*(c)(d)*/', 'ac', $matches, $flags);
+```
+
+| no flag | PREG_UNMATCHED_AS_NULL |
+| --- | --- |
+| array (size=4) | array (size=5) |
+| 0 => string 'ac' (length=2) | 0 => string 'ac' (length=2) |
+| 1 => string 'a' (length=1) | 1 => string 'a' (length=1) |
+| 2 => string '' (length=0) | 2 => null |
+| 3 => string 'c' (length=1) | 3 => string 'c' (length=1) |
+| | 4 => null |
+| group 2 (any unmatched group preceding one that matched) is set to `''`. You cannot tell if it matched an empty string or did not match at all | group 2 is `null` when unmatched and a string if it matched, easy to check for |
+| group 4 (any optional group without a matching one following) is missing altogether. So you have to check with `isset()`, but really you want `isset($m[4]) && $m[4] !== ''` for safety unless you are very careful to check that a non-optional group follows it | group 4 is always set, and null in this case as there was no match, easy to check for with `$m[4] !== null` |
+
+PHPStan Extension
+-----------------
+
+To use the PHPStan extension if you do not use `phpstan/extension-installer` you can include `vendor/composer/pcre/extension.neon` in your PHPStan config.
+
+The extension provides much better type information for $matches as well as regex validation where possible.
+
+License
+-------
+
+composer/pcre is licensed under the MIT License, see the LICENSE file for details.
diff --git a/vendor/composer/pcre/composer.json b/vendor/composer/pcre/composer.json
new file mode 100644
index 0000000..d3a7e67
--- /dev/null
+++ b/vendor/composer/pcre/composer.json
@@ -0,0 +1,54 @@
+{
+ "name": "composer/pcre",
+ "description": "PCRE wrapping library that offers type-safe preg_* replacements.",
+ "type": "library",
+ "license": "MIT",
+ "keywords": [
+ "pcre",
+ "regex",
+ "preg",
+ "regular expression"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ }
+ ],
+ "require": {
+ "php": "^7.4 || ^8.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^8 || ^9",
+ "phpstan/phpstan": "^1.12 || ^2",
+ "phpstan/phpstan-strict-rules": "^1 || ^2"
+ },
+ "conflict": {
+ "phpstan/phpstan": "<1.11.10"
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\Pcre\\": "src"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Composer\\Pcre\\": "tests"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-main": "3.x-dev"
+ },
+ "phpstan": {
+ "includes": [
+ "extension.neon"
+ ]
+ }
+ },
+ "scripts": {
+ "test": "@php vendor/bin/phpunit",
+ "phpstan": "@php phpstan analyse"
+ }
+}
diff --git a/vendor/composer/pcre/extension.neon b/vendor/composer/pcre/extension.neon
new file mode 100644
index 0000000..b9cea11
--- /dev/null
+++ b/vendor/composer/pcre/extension.neon
@@ -0,0 +1,22 @@
+# composer/pcre PHPStan extensions
+#
+# These can be reused by third party packages by including 'vendor/composer/pcre/extension.neon'
+# in your phpstan config
+
+services:
+ -
+ class: Composer\Pcre\PHPStan\PregMatchParameterOutTypeExtension
+ tags:
+ - phpstan.staticMethodParameterOutTypeExtension
+ -
+ class: Composer\Pcre\PHPStan\PregMatchTypeSpecifyingExtension
+ tags:
+ - phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension
+ -
+ class: Composer\Pcre\PHPStan\PregReplaceCallbackClosureTypeExtension
+ tags:
+ - phpstan.staticMethodParameterClosureTypeExtension
+
+rules:
+ - Composer\Pcre\PHPStan\UnsafeStrictGroupsCallRule
+ - Composer\Pcre\PHPStan\InvalidRegexPatternRule
diff --git a/vendor/composer/pcre/src/MatchAllResult.php b/vendor/composer/pcre/src/MatchAllResult.php
new file mode 100644
index 0000000..b22b52d
--- /dev/null
+++ b/vendor/composer/pcre/src/MatchAllResult.php
@@ -0,0 +1,46 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Pcre;
+
+final class MatchAllResult
+{
+ /**
+ * An array of match group => list of matched strings
+ *
+ * @readonly
+ * @var array>
+ */
+ public $matches;
+
+ /**
+ * @readonly
+ * @var 0|positive-int
+ */
+ public $count;
+
+ /**
+ * @readonly
+ * @var bool
+ */
+ public $matched;
+
+ /**
+ * @param 0|positive-int $count
+ * @param array> $matches
+ */
+ public function __construct(int $count, array $matches)
+ {
+ $this->matches = $matches;
+ $this->matched = (bool) $count;
+ $this->count = $count;
+ }
+}
diff --git a/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php b/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php
new file mode 100644
index 0000000..b7ec397
--- /dev/null
+++ b/vendor/composer/pcre/src/MatchAllStrictGroupsResult.php
@@ -0,0 +1,46 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Pcre;
+
+final class MatchAllStrictGroupsResult
+{
+ /**
+ * An array of match group => list of matched strings
+ *
+ * @readonly
+ * @var array>
+ */
+ public $matches;
+
+ /**
+ * @readonly
+ * @var 0|positive-int
+ */
+ public $count;
+
+ /**
+ * @readonly
+ * @var bool
+ */
+ public $matched;
+
+ /**
+ * @param 0|positive-int $count
+ * @param array> $matches
+ */
+ public function __construct(int $count, array $matches)
+ {
+ $this->matches = $matches;
+ $this->matched = (bool) $count;
+ $this->count = $count;
+ }
+}
diff --git a/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php b/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php
new file mode 100644
index 0000000..032a02c
--- /dev/null
+++ b/vendor/composer/pcre/src/MatchAllWithOffsetsResult.php
@@ -0,0 +1,48 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Pcre;
+
+final class MatchAllWithOffsetsResult
+{
+ /**
+ * An array of match group => list of matches, every match being a pair of string matched + offset in bytes (or -1 if no match)
+ *
+ * @readonly
+ * @var array>
+ * @phpstan-var array}>>
+ */
+ public $matches;
+
+ /**
+ * @readonly
+ * @var 0|positive-int
+ */
+ public $count;
+
+ /**
+ * @readonly
+ * @var bool
+ */
+ public $matched;
+
+ /**
+ * @param 0|positive-int $count
+ * @param array> $matches
+ * @phpstan-param array}>> $matches
+ */
+ public function __construct(int $count, array $matches)
+ {
+ $this->matches = $matches;
+ $this->matched = (bool) $count;
+ $this->count = $count;
+ }
+}
diff --git a/vendor/composer/pcre/src/MatchResult.php b/vendor/composer/pcre/src/MatchResult.php
new file mode 100644
index 0000000..e951a5e
--- /dev/null
+++ b/vendor/composer/pcre/src/MatchResult.php
@@ -0,0 +1,39 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Pcre;
+
+final class MatchResult
+{
+ /**
+ * An array of match group => string matched
+ *
+ * @readonly
+ * @var array
+ */
+ public $matches;
+
+ /**
+ * @readonly
+ * @var bool
+ */
+ public $matched;
+
+ /**
+ * @param 0|positive-int $count
+ * @param array $matches
+ */
+ public function __construct(int $count, array $matches)
+ {
+ $this->matches = $matches;
+ $this->matched = (bool) $count;
+ }
+}
diff --git a/vendor/composer/pcre/src/MatchStrictGroupsResult.php b/vendor/composer/pcre/src/MatchStrictGroupsResult.php
new file mode 100644
index 0000000..126ee62
--- /dev/null
+++ b/vendor/composer/pcre/src/MatchStrictGroupsResult.php
@@ -0,0 +1,39 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Pcre;
+
+final class MatchStrictGroupsResult
+{
+ /**
+ * An array of match group => string matched
+ *
+ * @readonly
+ * @var array
+ */
+ public $matches;
+
+ /**
+ * @readonly
+ * @var bool
+ */
+ public $matched;
+
+ /**
+ * @param 0|positive-int $count
+ * @param array $matches
+ */
+ public function __construct(int $count, array $matches)
+ {
+ $this->matches = $matches;
+ $this->matched = (bool) $count;
+ }
+}
diff --git a/vendor/composer/pcre/src/MatchWithOffsetsResult.php b/vendor/composer/pcre/src/MatchWithOffsetsResult.php
new file mode 100644
index 0000000..ba4d4bc
--- /dev/null
+++ b/vendor/composer/pcre/src/MatchWithOffsetsResult.php
@@ -0,0 +1,41 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Pcre;
+
+final class MatchWithOffsetsResult
+{
+ /**
+ * An array of match group => pair of string matched + offset in bytes (or -1 if no match)
+ *
+ * @readonly
+ * @var array
+ * @phpstan-var array}>
+ */
+ public $matches;
+
+ /**
+ * @readonly
+ * @var bool
+ */
+ public $matched;
+
+ /**
+ * @param 0|positive-int $count
+ * @param array $matches
+ * @phpstan-param array}> $matches
+ */
+ public function __construct(int $count, array $matches)
+ {
+ $this->matches = $matches;
+ $this->matched = (bool) $count;
+ }
+}
diff --git a/vendor/composer/pcre/src/PHPStan/InvalidRegexPatternRule.php b/vendor/composer/pcre/src/PHPStan/InvalidRegexPatternRule.php
new file mode 100644
index 0000000..8a05fb2
--- /dev/null
+++ b/vendor/composer/pcre/src/PHPStan/InvalidRegexPatternRule.php
@@ -0,0 +1,142 @@
+
+ */
+class InvalidRegexPatternRule implements Rule
+{
+ public function getNodeType(): string
+ {
+ return StaticCall::class;
+ }
+
+ public function processNode(Node $node, Scope $scope): array
+ {
+ $patterns = $this->extractPatterns($node, $scope);
+
+ $errors = [];
+ foreach ($patterns as $pattern) {
+ $errorMessage = $this->validatePattern($pattern);
+ if ($errorMessage === null) {
+ continue;
+ }
+
+ $errors[] = RuleErrorBuilder::message(sprintf('Regex pattern is invalid: %s', $errorMessage))->identifier('regexp.pattern')->build();
+ }
+
+ return $errors;
+ }
+
+ /**
+ * @return string[]
+ */
+ private function extractPatterns(StaticCall $node, Scope $scope): array
+ {
+ if (!$node->class instanceof FullyQualified) {
+ return [];
+ }
+ $isRegex = $node->class->toString() === Regex::class;
+ $isPreg = $node->class->toString() === Preg::class;
+ if (!$isRegex && !$isPreg) {
+ return [];
+ }
+ if (!$node->name instanceof Node\Identifier || !Preg::isMatch('{^(match|isMatch|grep|replace|split)}', $node->name->name)) {
+ return [];
+ }
+
+ $functionName = $node->name->name;
+ if (!isset($node->getArgs()[0])) {
+ return [];
+ }
+
+ $patternNode = $node->getArgs()[0]->value;
+ $patternType = $scope->getType($patternNode);
+
+ $patternStrings = [];
+
+ foreach ($patternType->getConstantStrings() as $constantStringType) {
+ if ($functionName === 'replaceCallbackArray') {
+ continue;
+ }
+
+ $patternStrings[] = $constantStringType->getValue();
+ }
+
+ foreach ($patternType->getConstantArrays() as $constantArrayType) {
+ if (
+ in_array($functionName, [
+ 'replace',
+ 'replaceCallback',
+ ], true)
+ ) {
+ foreach ($constantArrayType->getValueTypes() as $arrayKeyType) {
+ foreach ($arrayKeyType->getConstantStrings() as $constantString) {
+ $patternStrings[] = $constantString->getValue();
+ }
+ }
+ }
+
+ if ($functionName !== 'replaceCallbackArray') {
+ continue;
+ }
+
+ foreach ($constantArrayType->getKeyTypes() as $arrayKeyType) {
+ foreach ($arrayKeyType->getConstantStrings() as $constantString) {
+ $patternStrings[] = $constantString->getValue();
+ }
+ }
+ }
+
+ return $patternStrings;
+ }
+
+ private function validatePattern(string $pattern): ?string
+ {
+ try {
+ $msg = null;
+ $prev = set_error_handler(function (int $severity, string $message, string $file) use (&$msg): bool {
+ $msg = preg_replace("#^preg_match(_all)?\\(.*?\\): #", '', $message);
+
+ return true;
+ });
+
+ if ($pattern === '') {
+ return 'Empty string is not a valid regular expression';
+ }
+
+ Preg::match($pattern, '');
+ if ($msg !== null) {
+ return $msg;
+ }
+ } catch (PcreException $e) {
+ if ($e->getCode() === PREG_INTERNAL_ERROR && $msg !== null) {
+ return $msg;
+ }
+
+ return preg_replace('{.*? failed executing ".*": }', '', $e->getMessage());
+ } finally {
+ restore_error_handler();
+ }
+
+ return null;
+ }
+
+}
diff --git a/vendor/composer/pcre/src/PHPStan/PregMatchFlags.php b/vendor/composer/pcre/src/PHPStan/PregMatchFlags.php
new file mode 100644
index 0000000..aa30ab3
--- /dev/null
+++ b/vendor/composer/pcre/src/PHPStan/PregMatchFlags.php
@@ -0,0 +1,70 @@
+getType($flagsArg->value);
+
+ $constantScalars = $flagsType->getConstantScalarValues();
+ if ($constantScalars === []) {
+ return null;
+ }
+
+ $internalFlagsTypes = [];
+ foreach ($flagsType->getConstantScalarValues() as $constantScalarValue) {
+ if (!is_int($constantScalarValue)) {
+ return null;
+ }
+
+ $internalFlagsTypes[] = new ConstantIntegerType($constantScalarValue | PREG_UNMATCHED_AS_NULL);
+ }
+ return TypeCombinator::union(...$internalFlagsTypes);
+ }
+
+ static public function removeNullFromMatches(Type $matchesType): Type
+ {
+ return TypeTraverser::map($matchesType, static function (Type $type, callable $traverse): Type {
+ if ($type instanceof UnionType || $type instanceof IntersectionType) {
+ return $traverse($type);
+ }
+
+ if ($type instanceof ConstantArrayType) {
+ return new ConstantArrayType(
+ $type->getKeyTypes(),
+ array_map(static function (Type $valueType) use ($traverse): Type {
+ return $traverse($valueType);
+ }, $type->getValueTypes()),
+ $type->getNextAutoIndexes(),
+ [],
+ $type->isList()
+ );
+ }
+
+ if ($type instanceof ArrayType) {
+ return new ArrayType($type->getKeyType(), $traverse($type->getItemType()));
+ }
+
+ return TypeCombinator::removeNull($type);
+ });
+ }
+
+}
diff --git a/vendor/composer/pcre/src/PHPStan/PregMatchParameterOutTypeExtension.php b/vendor/composer/pcre/src/PHPStan/PregMatchParameterOutTypeExtension.php
new file mode 100644
index 0000000..e0d6020
--- /dev/null
+++ b/vendor/composer/pcre/src/PHPStan/PregMatchParameterOutTypeExtension.php
@@ -0,0 +1,65 @@
+regexShapeMatcher = $regexShapeMatcher;
+ }
+
+ public function isStaticMethodSupported(MethodReflection $methodReflection, ParameterReflection $parameter): bool
+ {
+ return
+ $methodReflection->getDeclaringClass()->getName() === Preg::class
+ && in_array($methodReflection->getName(), [
+ 'match', 'isMatch', 'matchStrictGroups', 'isMatchStrictGroups',
+ 'matchAll', 'isMatchAll', 'matchAllStrictGroups', 'isMatchAllStrictGroups'
+ ], true)
+ && $parameter->getName() === 'matches';
+ }
+
+ public function getParameterOutTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, ParameterReflection $parameter, Scope $scope): ?Type
+ {
+ $args = $methodCall->getArgs();
+ $patternArg = $args[0] ?? null;
+ $matchesArg = $args[2] ?? null;
+ $flagsArg = $args[3] ?? null;
+
+ if (
+ $patternArg === null || $matchesArg === null
+ ) {
+ return null;
+ }
+
+ $flagsType = PregMatchFlags::getType($flagsArg, $scope);
+ if ($flagsType === null) {
+ return null;
+ }
+
+ if (stripos($methodReflection->getName(), 'matchAll') !== false) {
+ return $this->regexShapeMatcher->matchAllExpr($patternArg->value, $flagsType, TrinaryLogic::createMaybe(), $scope);
+ }
+
+ return $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createMaybe(), $scope);
+ }
+
+}
diff --git a/vendor/composer/pcre/src/PHPStan/PregMatchTypeSpecifyingExtension.php b/vendor/composer/pcre/src/PHPStan/PregMatchTypeSpecifyingExtension.php
new file mode 100644
index 0000000..3db0ce0
--- /dev/null
+++ b/vendor/composer/pcre/src/PHPStan/PregMatchTypeSpecifyingExtension.php
@@ -0,0 +1,119 @@
+regexShapeMatcher = $regexShapeMatcher;
+ }
+
+ public function setTypeSpecifier(TypeSpecifier $typeSpecifier): void
+ {
+ $this->typeSpecifier = $typeSpecifier;
+ }
+
+ public function getClass(): string
+ {
+ return Preg::class;
+ }
+
+ public function isStaticMethodSupported(MethodReflection $methodReflection, StaticCall $node, TypeSpecifierContext $context): bool
+ {
+ return in_array($methodReflection->getName(), [
+ 'match', 'isMatch', 'matchStrictGroups', 'isMatchStrictGroups',
+ 'matchAll', 'isMatchAll', 'matchAllStrictGroups', 'isMatchAllStrictGroups'
+ ], true)
+ && !$context->null();
+ }
+
+ public function specifyTypes(MethodReflection $methodReflection, StaticCall $node, Scope $scope, TypeSpecifierContext $context): SpecifiedTypes
+ {
+ $args = $node->getArgs();
+ $patternArg = $args[0] ?? null;
+ $matchesArg = $args[2] ?? null;
+ $flagsArg = $args[3] ?? null;
+
+ if (
+ $patternArg === null || $matchesArg === null
+ ) {
+ return new SpecifiedTypes();
+ }
+
+ $flagsType = PregMatchFlags::getType($flagsArg, $scope);
+ if ($flagsType === null) {
+ return new SpecifiedTypes();
+ }
+
+ if (stripos($methodReflection->getName(), 'matchAll') !== false) {
+ $matchedType = $this->regexShapeMatcher->matchAllExpr($patternArg->value, $flagsType, TrinaryLogic::createFromBoolean($context->true()), $scope);
+ } else {
+ $matchedType = $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createFromBoolean($context->true()), $scope);
+ }
+
+ if ($matchedType === null) {
+ return new SpecifiedTypes();
+ }
+
+ if (
+ in_array($methodReflection->getName(), ['matchStrictGroups', 'isMatchStrictGroups', 'matchAllStrictGroups', 'isMatchAllStrictGroups'], true)
+ ) {
+ $matchedType = PregMatchFlags::removeNullFromMatches($matchedType);
+ }
+
+ $overwrite = false;
+ if ($context->false()) {
+ $overwrite = true;
+ $context = $context->negate();
+ }
+
+ // @phpstan-ignore function.alreadyNarrowedType
+ if (method_exists('PHPStan\Analyser\SpecifiedTypes', 'setRootExpr')) {
+ $typeSpecifier = $this->typeSpecifier->create(
+ $matchesArg->value,
+ $matchedType,
+ $context,
+ $scope
+ )->setRootExpr($node);
+
+ return $overwrite ? $typeSpecifier->setAlwaysOverwriteTypes() : $typeSpecifier;
+ }
+
+ // @phpstan-ignore arguments.count
+ return $this->typeSpecifier->create(
+ $matchesArg->value,
+ $matchedType,
+ $context,
+ // @phpstan-ignore argument.type
+ $overwrite,
+ $scope,
+ $node
+ );
+ }
+}
diff --git a/vendor/composer/pcre/src/PHPStan/PregReplaceCallbackClosureTypeExtension.php b/vendor/composer/pcre/src/PHPStan/PregReplaceCallbackClosureTypeExtension.php
new file mode 100644
index 0000000..7b95367
--- /dev/null
+++ b/vendor/composer/pcre/src/PHPStan/PregReplaceCallbackClosureTypeExtension.php
@@ -0,0 +1,91 @@
+regexShapeMatcher = $regexShapeMatcher;
+ }
+
+ public function isStaticMethodSupported(MethodReflection $methodReflection, ParameterReflection $parameter): bool
+ {
+ return in_array($methodReflection->getDeclaringClass()->getName(), [Preg::class, Regex::class], true)
+ && in_array($methodReflection->getName(), ['replaceCallback', 'replaceCallbackStrictGroups'], true)
+ && $parameter->getName() === 'replacement';
+ }
+
+ public function getTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, ParameterReflection $parameter, Scope $scope): ?Type
+ {
+ $args = $methodCall->getArgs();
+ $patternArg = $args[0] ?? null;
+ $flagsArg = $args[5] ?? null;
+
+ if (
+ $patternArg === null
+ ) {
+ return null;
+ }
+
+ $flagsType = PregMatchFlags::getType($flagsArg, $scope);
+
+ $matchesType = $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createYes(), $scope);
+ if ($matchesType === null) {
+ return null;
+ }
+
+ if ($methodReflection->getName() === 'replaceCallbackStrictGroups' && count($matchesType->getConstantArrays()) === 1) {
+ $matchesType = $matchesType->getConstantArrays()[0];
+ $matchesType = new ConstantArrayType(
+ $matchesType->getKeyTypes(),
+ array_map(static function (Type $valueType): Type {
+ if (count($valueType->getConstantArrays()) === 1) {
+ $valueTypeArray = $valueType->getConstantArrays()[0];
+ return new ConstantArrayType(
+ $valueTypeArray->getKeyTypes(),
+ array_map(static function (Type $valueType): Type {
+ return TypeCombinator::removeNull($valueType);
+ }, $valueTypeArray->getValueTypes()),
+ $valueTypeArray->getNextAutoIndexes(),
+ [],
+ $valueTypeArray->isList()
+ );
+ }
+ return TypeCombinator::removeNull($valueType);
+ }, $matchesType->getValueTypes()),
+ $matchesType->getNextAutoIndexes(),
+ [],
+ $matchesType->isList()
+ );
+ }
+
+ return new ClosureType(
+ [
+ new NativeParameterReflection($parameter->getName(), $parameter->isOptional(), $matchesType, $parameter->passedByReference(), $parameter->isVariadic(), $parameter->getDefaultValue()),
+ ],
+ new StringType()
+ );
+ }
+}
diff --git a/vendor/composer/pcre/src/PHPStan/UnsafeStrictGroupsCallRule.php b/vendor/composer/pcre/src/PHPStan/UnsafeStrictGroupsCallRule.php
new file mode 100644
index 0000000..5bced50
--- /dev/null
+++ b/vendor/composer/pcre/src/PHPStan/UnsafeStrictGroupsCallRule.php
@@ -0,0 +1,112 @@
+
+ */
+final class UnsafeStrictGroupsCallRule implements Rule
+{
+ /**
+ * @var RegexArrayShapeMatcher
+ */
+ private $regexShapeMatcher;
+
+ public function __construct(RegexArrayShapeMatcher $regexShapeMatcher)
+ {
+ $this->regexShapeMatcher = $regexShapeMatcher;
+ }
+
+ public function getNodeType(): string
+ {
+ return StaticCall::class;
+ }
+
+ public function processNode(Node $node, Scope $scope): array
+ {
+ if (!$node->class instanceof FullyQualified) {
+ return [];
+ }
+ $isRegex = $node->class->toString() === Regex::class;
+ $isPreg = $node->class->toString() === Preg::class;
+ if (!$isRegex && !$isPreg) {
+ return [];
+ }
+ if (!$node->name instanceof Node\Identifier || !in_array($node->name->name, ['matchStrictGroups', 'isMatchStrictGroups', 'matchAllStrictGroups', 'isMatchAllStrictGroups'], true)) {
+ return [];
+ }
+
+ $args = $node->getArgs();
+ if (!isset($args[0])) {
+ return [];
+ }
+
+ $patternArg = $args[0] ?? null;
+ if ($isPreg) {
+ if (!isset($args[2])) { // no matches set, skip as the matches won't be used anyway
+ return [];
+ }
+ $flagsArg = $args[3] ?? null;
+ } else {
+ $flagsArg = $args[2] ?? null;
+ }
+
+ if ($patternArg === null) {
+ return [];
+ }
+
+ $flagsType = PregMatchFlags::getType($flagsArg, $scope);
+ if ($flagsType === null) {
+ return [];
+ }
+
+ $matchedType = $this->regexShapeMatcher->matchExpr($patternArg->value, $flagsType, TrinaryLogic::createYes(), $scope);
+ if ($matchedType === null) {
+ return [
+ RuleErrorBuilder::message(sprintf('The %s call is potentially unsafe as $matches\' type could not be inferred.', $node->name->name))
+ ->identifier('composerPcre.maybeUnsafeStrictGroups')
+ ->build(),
+ ];
+ }
+
+ if (count($matchedType->getConstantArrays()) === 1) {
+ $matchedType = $matchedType->getConstantArrays()[0];
+ $nullableGroups = [];
+ foreach ($matchedType->getValueTypes() as $index => $type) {
+ if (TypeCombinator::containsNull($type)) {
+ $nullableGroups[] = $matchedType->getKeyTypes()[$index]->getValue();
+ }
+ }
+
+ if (\count($nullableGroups) > 0) {
+ return [
+ RuleErrorBuilder::message(sprintf(
+ 'The %s call is unsafe as match group%s "%s" %s optional and may be null.',
+ $node->name->name,
+ \count($nullableGroups) > 1 ? 's' : '',
+ implode('", "', $nullableGroups),
+ \count($nullableGroups) > 1 ? 'are' : 'is'
+ ))->identifier('composerPcre.unsafeStrictGroups')->build(),
+ ];
+ }
+ }
+
+ return [];
+ }
+}
diff --git a/vendor/composer/pcre/src/PcreException.php b/vendor/composer/pcre/src/PcreException.php
new file mode 100644
index 0000000..23d9327
--- /dev/null
+++ b/vendor/composer/pcre/src/PcreException.php
@@ -0,0 +1,55 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Pcre;
+
+class PcreException extends \RuntimeException
+{
+ /**
+ * @param string $function
+ * @param string|string[] $pattern
+ * @return self
+ */
+ public static function fromFunction($function, $pattern)
+ {
+ $code = preg_last_error();
+
+ if (is_array($pattern)) {
+ $pattern = implode(', ', $pattern);
+ }
+
+ return new PcreException($function.'(): failed executing "'.$pattern.'": '.self::pcreLastErrorMessage($code), $code);
+ }
+
+ /**
+ * @param int $code
+ * @return string
+ */
+ private static function pcreLastErrorMessage($code)
+ {
+ if (function_exists('preg_last_error_msg')) {
+ return preg_last_error_msg();
+ }
+
+ $constants = get_defined_constants(true);
+ if (!isset($constants['pcre']) || !is_array($constants['pcre'])) {
+ return 'UNDEFINED_ERROR';
+ }
+
+ foreach ($constants['pcre'] as $const => $val) {
+ if ($val === $code && substr($const, -6) === '_ERROR') {
+ return $const;
+ }
+ }
+
+ return 'UNDEFINED_ERROR';
+ }
+}
diff --git a/vendor/composer/pcre/src/Preg.php b/vendor/composer/pcre/src/Preg.php
new file mode 100644
index 0000000..400abbf
--- /dev/null
+++ b/vendor/composer/pcre/src/Preg.php
@@ -0,0 +1,430 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Pcre;
+
+class Preg
+{
+ /** @internal */
+ public const ARRAY_MSG = '$subject as an array is not supported. You can use \'foreach\' instead.';
+ /** @internal */
+ public const INVALID_TYPE_MSG = '$subject must be a string, %s given.';
+
+ /**
+ * @param non-empty-string $pattern
+ * @param array $matches Set by method
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ * @return 0|1
+ *
+ * @param-out array $matches
+ */
+ public static function match(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int
+ {
+ self::checkOffsetCapture($flags, 'matchWithOffsets');
+
+ $result = preg_match($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL, $offset);
+ if ($result === false) {
+ throw PcreException::fromFunction('preg_match', $pattern);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Variant of `match()` which outputs non-null matches (or throws)
+ *
+ * @param non-empty-string $pattern
+ * @param array $matches Set by method
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ * @return 0|1
+ * @throws UnexpectedNullMatchException
+ *
+ * @param-out array $matches
+ */
+ public static function matchStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int
+ {
+ $result = self::match($pattern, $subject, $matchesInternal, $flags, $offset);
+ $matches = self::enforceNonNullMatches($pattern, $matchesInternal, 'match');
+
+ return $result;
+ }
+
+ /**
+ * Runs preg_match with PREG_OFFSET_CAPTURE
+ *
+ * @param non-empty-string $pattern
+ * @param array $matches Set by method
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_OFFSET_CAPTURE are always set, no other flags are supported
+ * @return 0|1
+ *
+ * @param-out array}> $matches
+ */
+ public static function matchWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): int
+ {
+ $result = preg_match($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL | PREG_OFFSET_CAPTURE, $offset);
+ if ($result === false) {
+ throw PcreException::fromFunction('preg_match', $pattern);
+ }
+
+ return $result;
+ }
+
+ /**
+ * @param non-empty-string $pattern
+ * @param array $matches Set by method
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ * @return 0|positive-int
+ *
+ * @param-out array> $matches
+ */
+ public static function matchAll(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int
+ {
+ self::checkOffsetCapture($flags, 'matchAllWithOffsets');
+ self::checkSetOrder($flags);
+
+ $result = preg_match_all($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL, $offset);
+ if (!is_int($result)) { // PHP < 8 may return null, 8+ returns int|false
+ throw PcreException::fromFunction('preg_match_all', $pattern);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Variant of `match()` which outputs non-null matches (or throws)
+ *
+ * @param non-empty-string $pattern
+ * @param array $matches Set by method
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ * @return 0|positive-int
+ * @throws UnexpectedNullMatchException
+ *
+ * @param-out array> $matches
+ */
+ public static function matchAllStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): int
+ {
+ $result = self::matchAll($pattern, $subject, $matchesInternal, $flags, $offset);
+ $matches = self::enforceNonNullMatchAll($pattern, $matchesInternal, 'matchAll');
+
+ return $result;
+ }
+
+ /**
+ * Runs preg_match_all with PREG_OFFSET_CAPTURE
+ *
+ * @param non-empty-string $pattern
+ * @param array $matches Set by method
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_MATCH_OFFSET are always set, no other flags are supported
+ * @return 0|positive-int
+ *
+ * @param-out array}>> $matches
+ */
+ public static function matchAllWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): int
+ {
+ self::checkSetOrder($flags);
+
+ $result = preg_match_all($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL | PREG_OFFSET_CAPTURE, $offset);
+ if (!is_int($result)) { // PHP < 8 may return null, 8+ returns int|false
+ throw PcreException::fromFunction('preg_match_all', $pattern);
+ }
+
+ return $result;
+ }
+
+ /**
+ * @param string|string[] $pattern
+ * @param string|string[] $replacement
+ * @param string $subject
+ * @param int $count Set by method
+ *
+ * @param-out int<0, max> $count
+ */
+ public static function replace($pattern, $replacement, $subject, int $limit = -1, ?int &$count = null): string
+ {
+ if (!is_scalar($subject)) {
+ if (is_array($subject)) {
+ throw new \InvalidArgumentException(static::ARRAY_MSG);
+ }
+
+ throw new \TypeError(sprintf(static::INVALID_TYPE_MSG, gettype($subject)));
+ }
+
+ $result = preg_replace($pattern, $replacement, $subject, $limit, $count);
+ if ($result === null) {
+ throw PcreException::fromFunction('preg_replace', $pattern);
+ }
+
+ return $result;
+ }
+
+ /**
+ * @param string|string[] $pattern
+ * @param ($flags is PREG_OFFSET_CAPTURE ? (callable(array}>): string) : callable(array): string) $replacement
+ * @param string $subject
+ * @param int $count Set by method
+ * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set
+ *
+ * @param-out int<0, max> $count
+ */
+ public static function replaceCallback($pattern, callable $replacement, $subject, int $limit = -1, ?int &$count = null, int $flags = 0): string
+ {
+ if (!is_scalar($subject)) {
+ if (is_array($subject)) {
+ throw new \InvalidArgumentException(static::ARRAY_MSG);
+ }
+
+ throw new \TypeError(sprintf(static::INVALID_TYPE_MSG, gettype($subject)));
+ }
+
+ $result = preg_replace_callback($pattern, $replacement, $subject, $limit, $count, $flags | PREG_UNMATCHED_AS_NULL);
+ if ($result === null) {
+ throw PcreException::fromFunction('preg_replace_callback', $pattern);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Variant of `replaceCallback()` which outputs non-null matches (or throws)
+ *
+ * @param string $pattern
+ * @param ($flags is PREG_OFFSET_CAPTURE ? (callable(array}>): string) : callable(array): string) $replacement
+ * @param string $subject
+ * @param int $count Set by method
+ * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set
+ *
+ * @param-out int<0, max> $count
+ */
+ public static function replaceCallbackStrictGroups(string $pattern, callable $replacement, $subject, int $limit = -1, ?int &$count = null, int $flags = 0): string
+ {
+ return self::replaceCallback($pattern, function (array $matches) use ($pattern, $replacement) {
+ return $replacement(self::enforceNonNullMatches($pattern, $matches, 'replaceCallback'));
+ }, $subject, $limit, $count, $flags);
+ }
+
+ /**
+ * @param ($flags is PREG_OFFSET_CAPTURE ? (array}>): string>) : array): string>) $pattern
+ * @param string $subject
+ * @param int $count Set by method
+ * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set
+ *
+ * @param-out int<0, max> $count
+ */
+ public static function replaceCallbackArray(array $pattern, $subject, int $limit = -1, ?int &$count = null, int $flags = 0): string
+ {
+ if (!is_scalar($subject)) {
+ if (is_array($subject)) {
+ throw new \InvalidArgumentException(static::ARRAY_MSG);
+ }
+
+ throw new \TypeError(sprintf(static::INVALID_TYPE_MSG, gettype($subject)));
+ }
+
+ $result = preg_replace_callback_array($pattern, $subject, $limit, $count, $flags | PREG_UNMATCHED_AS_NULL);
+ if ($result === null) {
+ $pattern = array_keys($pattern);
+ throw PcreException::fromFunction('preg_replace_callback_array', $pattern);
+ }
+
+ return $result;
+ }
+
+ /**
+ * @param int-mask $flags PREG_SPLIT_NO_EMPTY or PREG_SPLIT_DELIM_CAPTURE
+ * @return list
+ */
+ public static function split(string $pattern, string $subject, int $limit = -1, int $flags = 0): array
+ {
+ if (($flags & PREG_SPLIT_OFFSET_CAPTURE) !== 0) {
+ throw new \InvalidArgumentException('PREG_SPLIT_OFFSET_CAPTURE is not supported as it changes the type of $matches, use splitWithOffsets() instead');
+ }
+
+ $result = preg_split($pattern, $subject, $limit, $flags);
+ if ($result === false) {
+ throw PcreException::fromFunction('preg_split', $pattern);
+ }
+
+ return $result;
+ }
+
+ /**
+ * @param int-mask $flags PREG_SPLIT_NO_EMPTY or PREG_SPLIT_DELIM_CAPTURE, PREG_SPLIT_OFFSET_CAPTURE is always set
+ * @return list
+ * @phpstan-return list}>
+ */
+ public static function splitWithOffsets(string $pattern, string $subject, int $limit = -1, int $flags = 0): array
+ {
+ $result = preg_split($pattern, $subject, $limit, $flags | PREG_SPLIT_OFFSET_CAPTURE);
+ if ($result === false) {
+ throw PcreException::fromFunction('preg_split', $pattern);
+ }
+
+ return $result;
+ }
+
+ /**
+ * @template T of string|\Stringable
+ * @param string $pattern
+ * @param array $array
+ * @param int-mask $flags PREG_GREP_INVERT
+ * @return array
+ */
+ public static function grep(string $pattern, array $array, int $flags = 0): array
+ {
+ $result = preg_grep($pattern, $array, $flags);
+ if ($result === false) {
+ throw PcreException::fromFunction('preg_grep', $pattern);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Variant of match() which returns a bool instead of int
+ *
+ * @param non-empty-string $pattern
+ * @param array $matches Set by method
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ *
+ * @param-out array $matches
+ */
+ public static function isMatch(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool
+ {
+ return (bool) static::match($pattern, $subject, $matches, $flags, $offset);
+ }
+
+ /**
+ * Variant of `isMatch()` which outputs non-null matches (or throws)
+ *
+ * @param non-empty-string $pattern
+ * @param array $matches Set by method
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ * @throws UnexpectedNullMatchException
+ *
+ * @param-out array $matches
+ */
+ public static function isMatchStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool
+ {
+ return (bool) self::matchStrictGroups($pattern, $subject, $matches, $flags, $offset);
+ }
+
+ /**
+ * Variant of matchAll() which returns a bool instead of int
+ *
+ * @param non-empty-string $pattern
+ * @param array $matches Set by method
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ *
+ * @param-out array> $matches
+ */
+ public static function isMatchAll(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool
+ {
+ return (bool) static::matchAll($pattern, $subject, $matches, $flags, $offset);
+ }
+
+ /**
+ * Variant of `isMatchAll()` which outputs non-null matches (or throws)
+ *
+ * @param non-empty-string $pattern
+ * @param array $matches Set by method
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ *
+ * @param-out array> $matches
+ */
+ public static function isMatchAllStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0): bool
+ {
+ return (bool) self::matchAllStrictGroups($pattern, $subject, $matches, $flags, $offset);
+ }
+
+ /**
+ * Variant of matchWithOffsets() which returns a bool instead of int
+ *
+ * Runs preg_match with PREG_OFFSET_CAPTURE
+ *
+ * @param non-empty-string $pattern
+ * @param array $matches Set by method
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ *
+ * @param-out array}> $matches
+ */
+ public static function isMatchWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): bool
+ {
+ return (bool) static::matchWithOffsets($pattern, $subject, $matches, $flags, $offset);
+ }
+
+ /**
+ * Variant of matchAllWithOffsets() which returns a bool instead of int
+ *
+ * Runs preg_match_all with PREG_OFFSET_CAPTURE
+ *
+ * @param non-empty-string $pattern
+ * @param array $matches Set by method
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ *
+ * @param-out array}>> $matches
+ */
+ public static function isMatchAllWithOffsets(string $pattern, string $subject, ?array &$matches, int $flags = 0, int $offset = 0): bool
+ {
+ return (bool) static::matchAllWithOffsets($pattern, $subject, $matches, $flags, $offset);
+ }
+
+ private static function checkOffsetCapture(int $flags, string $useFunctionName): void
+ {
+ if (($flags & PREG_OFFSET_CAPTURE) !== 0) {
+ throw new \InvalidArgumentException('PREG_OFFSET_CAPTURE is not supported as it changes the type of $matches, use ' . $useFunctionName . '() instead');
+ }
+ }
+
+ private static function checkSetOrder(int $flags): void
+ {
+ if (($flags & PREG_SET_ORDER) !== 0) {
+ throw new \InvalidArgumentException('PREG_SET_ORDER is not supported as it changes the type of $matches');
+ }
+ }
+
+ /**
+ * @param array $matches
+ * @return array
+ * @throws UnexpectedNullMatchException
+ */
+ private static function enforceNonNullMatches(string $pattern, array $matches, string $variantMethod)
+ {
+ foreach ($matches as $group => $match) {
+ if (is_string($match) || (is_array($match) && is_string($match[0]))) {
+ continue;
+ }
+
+ throw new UnexpectedNullMatchException('Pattern "'.$pattern.'" had an unexpected unmatched group "'.$group.'", make sure the pattern always matches or use '.$variantMethod.'() instead.');
+ }
+
+ /** @var array */
+ return $matches;
+ }
+
+ /**
+ * @param array> $matches
+ * @return array>
+ * @throws UnexpectedNullMatchException
+ */
+ private static function enforceNonNullMatchAll(string $pattern, array $matches, string $variantMethod)
+ {
+ foreach ($matches as $group => $groupMatches) {
+ foreach ($groupMatches as $match) {
+ if (null === $match) {
+ throw new UnexpectedNullMatchException('Pattern "'.$pattern.'" had an unexpected unmatched group "'.$group.'", make sure the pattern always matches or use '.$variantMethod.'() instead.');
+ }
+ }
+ }
+
+ /** @var array> */
+ return $matches;
+ }
+}
diff --git a/vendor/composer/pcre/src/Regex.php b/vendor/composer/pcre/src/Regex.php
new file mode 100644
index 0000000..038cf06
--- /dev/null
+++ b/vendor/composer/pcre/src/Regex.php
@@ -0,0 +1,176 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Pcre;
+
+class Regex
+{
+ /**
+ * @param non-empty-string $pattern
+ */
+ public static function isMatch(string $pattern, string $subject, int $offset = 0): bool
+ {
+ return (bool) Preg::match($pattern, $subject, $matches, 0, $offset);
+ }
+
+ /**
+ * @param non-empty-string $pattern
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ */
+ public static function match(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchResult
+ {
+ self::checkOffsetCapture($flags, 'matchWithOffsets');
+
+ $count = Preg::match($pattern, $subject, $matches, $flags, $offset);
+
+ return new MatchResult($count, $matches);
+ }
+
+ /**
+ * Variant of `match()` which returns non-null matches (or throws)
+ *
+ * @param non-empty-string $pattern
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ * @throws UnexpectedNullMatchException
+ */
+ public static function matchStrictGroups(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchStrictGroupsResult
+ {
+ // @phpstan-ignore composerPcre.maybeUnsafeStrictGroups
+ $count = Preg::matchStrictGroups($pattern, $subject, $matches, $flags, $offset);
+
+ return new MatchStrictGroupsResult($count, $matches);
+ }
+
+ /**
+ * Runs preg_match with PREG_OFFSET_CAPTURE
+ *
+ * @param non-empty-string $pattern
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_MATCH_OFFSET are always set, no other flags are supported
+ */
+ public static function matchWithOffsets(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchWithOffsetsResult
+ {
+ $count = Preg::matchWithOffsets($pattern, $subject, $matches, $flags, $offset);
+
+ return new MatchWithOffsetsResult($count, $matches);
+ }
+
+ /**
+ * @param non-empty-string $pattern
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ */
+ public static function matchAll(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchAllResult
+ {
+ self::checkOffsetCapture($flags, 'matchAllWithOffsets');
+ self::checkSetOrder($flags);
+
+ $count = Preg::matchAll($pattern, $subject, $matches, $flags, $offset);
+
+ return new MatchAllResult($count, $matches);
+ }
+
+ /**
+ * Variant of `matchAll()` which returns non-null matches (or throws)
+ *
+ * @param non-empty-string $pattern
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported
+ * @throws UnexpectedNullMatchException
+ */
+ public static function matchAllStrictGroups(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchAllStrictGroupsResult
+ {
+ self::checkOffsetCapture($flags, 'matchAllWithOffsets');
+ self::checkSetOrder($flags);
+
+ // @phpstan-ignore composerPcre.maybeUnsafeStrictGroups
+ $count = Preg::matchAllStrictGroups($pattern, $subject, $matches, $flags, $offset);
+
+ return new MatchAllStrictGroupsResult($count, $matches);
+ }
+
+ /**
+ * Runs preg_match_all with PREG_OFFSET_CAPTURE
+ *
+ * @param non-empty-string $pattern
+ * @param int-mask $flags PREG_UNMATCHED_AS_NULL and PREG_MATCH_OFFSET are always set, no other flags are supported
+ */
+ public static function matchAllWithOffsets(string $pattern, string $subject, int $flags = 0, int $offset = 0): MatchAllWithOffsetsResult
+ {
+ self::checkSetOrder($flags);
+
+ $count = Preg::matchAllWithOffsets($pattern, $subject, $matches, $flags, $offset);
+
+ return new MatchAllWithOffsetsResult($count, $matches);
+ }
+ /**
+ * @param string|string[] $pattern
+ * @param string|string[] $replacement
+ * @param string $subject
+ */
+ public static function replace($pattern, $replacement, $subject, int $limit = -1): ReplaceResult
+ {
+ $result = Preg::replace($pattern, $replacement, $subject, $limit, $count);
+
+ return new ReplaceResult($count, $result);
+ }
+
+ /**
+ * @param string|string[] $pattern
+ * @param ($flags is PREG_OFFSET_CAPTURE ? (callable(array}>): string) : callable(array): string) $replacement
+ * @param string $subject
+ * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set
+ */
+ public static function replaceCallback($pattern, callable $replacement, $subject, int $limit = -1, int $flags = 0): ReplaceResult
+ {
+ $result = Preg::replaceCallback($pattern, $replacement, $subject, $limit, $count, $flags);
+
+ return new ReplaceResult($count, $result);
+ }
+
+ /**
+ * Variant of `replaceCallback()` which outputs non-null matches (or throws)
+ *
+ * @param string $pattern
+ * @param ($flags is PREG_OFFSET_CAPTURE ? (callable(array}>): string) : callable(array): string) $replacement
+ * @param string $subject
+ * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set
+ */
+ public static function replaceCallbackStrictGroups($pattern, callable $replacement, $subject, int $limit = -1, int $flags = 0): ReplaceResult
+ {
+ $result = Preg::replaceCallbackStrictGroups($pattern, $replacement, $subject, $limit, $count, $flags);
+
+ return new ReplaceResult($count, $result);
+ }
+
+ /**
+ * @param ($flags is PREG_OFFSET_CAPTURE ? (array}>): string>) : array): string>) $pattern
+ * @param string $subject
+ * @param int-mask $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set
+ */
+ public static function replaceCallbackArray(array $pattern, $subject, int $limit = -1, int $flags = 0): ReplaceResult
+ {
+ $result = Preg::replaceCallbackArray($pattern, $subject, $limit, $count, $flags);
+
+ return new ReplaceResult($count, $result);
+ }
+
+ private static function checkOffsetCapture(int $flags, string $useFunctionName): void
+ {
+ if (($flags & PREG_OFFSET_CAPTURE) !== 0) {
+ throw new \InvalidArgumentException('PREG_OFFSET_CAPTURE is not supported as it changes the return type, use '.$useFunctionName.'() instead');
+ }
+ }
+
+ private static function checkSetOrder(int $flags): void
+ {
+ if (($flags & PREG_SET_ORDER) !== 0) {
+ throw new \InvalidArgumentException('PREG_SET_ORDER is not supported as it changes the return type');
+ }
+ }
+}
diff --git a/vendor/composer/pcre/src/ReplaceResult.php b/vendor/composer/pcre/src/ReplaceResult.php
new file mode 100644
index 0000000..3384771
--- /dev/null
+++ b/vendor/composer/pcre/src/ReplaceResult.php
@@ -0,0 +1,43 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Pcre;
+
+final class ReplaceResult
+{
+ /**
+ * @readonly
+ * @var string
+ */
+ public $result;
+
+ /**
+ * @readonly
+ * @var 0|positive-int
+ */
+ public $count;
+
+ /**
+ * @readonly
+ * @var bool
+ */
+ public $matched;
+
+ /**
+ * @param 0|positive-int $count
+ */
+ public function __construct(int $count, string $result)
+ {
+ $this->count = $count;
+ $this->matched = (bool) $count;
+ $this->result = $result;
+ }
+}
diff --git a/vendor/composer/pcre/src/UnexpectedNullMatchException.php b/vendor/composer/pcre/src/UnexpectedNullMatchException.php
new file mode 100644
index 0000000..f123828
--- /dev/null
+++ b/vendor/composer/pcre/src/UnexpectedNullMatchException.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view
+ * the LICENSE file that was distributed with this source code.
+ */
+
+namespace Composer\Pcre;
+
+class UnexpectedNullMatchException extends PcreException
+{
+ public static function fromFunction($function, $pattern)
+ {
+ throw new \LogicException('fromFunction should not be called on '.self::class.', use '.PcreException::class);
+ }
+}
diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php
new file mode 100644
index 0000000..78a19e1
--- /dev/null
+++ b/vendor/composer/platform_check.php
@@ -0,0 +1,29 @@
+= 80300)) {
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 8.3.0". You are running ' . PHP_VERSION . '.';
+}
+
+if (PHP_INT_SIZE !== 8) {
+ $issues[] = 'Your Composer dependencies require a 64-bit build of PHP.';
+}
+
+if ($issues) {
+ if (!headers_sent()) {
+ header('HTTP/1.1 500 Internal Server Error');
+ }
+ if (!ini_get('display_errors')) {
+ if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
+ fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
+ } elseif (!headers_sent()) {
+ echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
+ }
+ }
+ throw new \RuntimeException(
+ 'Composer detected issues in your platform: ' . implode(' ', $issues)
+ );
+}
diff --git a/vendor/maennchen/zipstream-php/.editorconfig b/vendor/maennchen/zipstream-php/.editorconfig
new file mode 100644
index 0000000..f7cd914
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/.editorconfig
@@ -0,0 +1,22 @@
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+charset = utf-8
+
+[*.{yml,md,xml}]
+indent_style = space
+indent_size = 2
+
+[*.{rst,php}]
+indent_style = space
+indent_size = 4
+
+[composer.json]
+indent_style = space
+indent_size = 2
+
+[composer.lock]
+indent_style = space
+indent_size = 4
diff --git a/vendor/maennchen/zipstream-php/.phive/phars.xml b/vendor/maennchen/zipstream-php/.phive/phars.xml
new file mode 100644
index 0000000..10f0df2
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/.phive/phars.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/vendor/maennchen/zipstream-php/.php-cs-fixer.dist.php b/vendor/maennchen/zipstream-php/.php-cs-fixer.dist.php
new file mode 100644
index 0000000..31c8f0c
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/.php-cs-fixer.dist.php
@@ -0,0 +1,74 @@
+
+ * @copyright 2022 Nicolas CARPi
+ * @see https://github.com/maennchen/ZipStream-PHP
+ * @license MIT
+ * @package maennchen/ZipStream-PHP
+ */
+
+use PhpCsFixer\Config;
+use PhpCsFixer\Finder;
+use PhpCsFixer\Runner;
+
+$finder = Finder::create()
+ ->exclude('.github')
+ ->exclude('.phpdoc')
+ ->exclude('docs')
+ ->exclude('tools')
+ ->exclude('vendor')
+ ->in(__DIR__);
+
+$config = new Config();
+return $config->setRules([
+ '@PER' => true,
+ '@PER:risky' => true,
+ '@PHP83Migration' => true,
+ // Enable once PHP 8.4 is the minimum version
+ // '@PHP84Migration' => true,
+ '@PHPUnit84Migration:risky' => true,
+ 'array_syntax' => ['syntax' => 'short'],
+ 'class_attributes_separation' => true,
+ 'declare_strict_types' => true,
+ 'dir_constant' => true,
+ 'is_null' => true,
+ 'no_homoglyph_names' => true,
+ 'no_null_property_initialization' => true,
+ 'no_php4_constructor' => true,
+ 'no_unused_imports' => true,
+ 'no_useless_else' => true,
+ 'non_printable_character' => true,
+ 'ordered_imports' => true,
+ 'ordered_class_elements' => true,
+ 'php_unit_construct' => true,
+ 'pow_to_exponentiation' => true,
+ 'psr_autoloading' => true,
+ 'random_api_migration' => true,
+ 'return_assignment' => true,
+ 'self_accessor' => true,
+ 'semicolon_after_instruction' => true,
+ 'short_scalar_cast' => true,
+ 'simplified_null_return' => true,
+ 'single_class_element_per_statement' => true,
+ 'single_line_comment_style' => true,
+ 'single_quote' => true,
+ 'space_after_semicolon' => true,
+ 'standardize_not_equals' => true,
+ 'strict_param' => true,
+ 'ternary_operator_spaces' => true,
+ 'trailing_comma_in_multiline' => true,
+ 'trim_array_spaces' => true,
+ 'unary_operator_spaces' => true,
+ 'global_namespace_import' => [
+ 'import_classes' => true,
+ 'import_functions' => true,
+ 'import_constants' => true,
+ ],
+ ])
+ ->setFinder($finder)
+ ->setRiskyAllowed(true)
+ ->setParallelConfig(Runner\Parallel\ParallelConfigFactory::detect());
diff --git a/vendor/maennchen/zipstream-php/.phpdoc/template/base.html.twig b/vendor/maennchen/zipstream-php/.phpdoc/template/base.html.twig
new file mode 100644
index 0000000..2a70c0a
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/.phpdoc/template/base.html.twig
@@ -0,0 +1,15 @@
+{% extends 'layout.html.twig' %}
+
+{% set topMenu = {
+ "menu": [
+ { "name": "Guides", "url": "https://maennchen.dev/ZipStream-PHP/guide/index.html"},
+ { "name": "API", "url": "https://maennchen.dev/ZipStream-PHP/classes/ZipStream-ZipStream.html"},
+ { "name": "Issues", "url": "https://github.com/maennchen/ZipStream-PHP/issues"},
+ ],
+ "social": [
+ { "iconClass": "fab fa-github", "url": "https://github.com/maennchen/ZipStream-PHP"},
+ { "iconClass": "fas fa-envelope-open-text", "url": "https://github.com/maennchen/ZipStream-PHP/discussions"},
+ { "iconClass": "fas fa-money-bill", "url": "https://github.com/sponsors/maennchen"},
+ ]
+}
+%}
\ No newline at end of file
diff --git a/vendor/maennchen/zipstream-php/.tool-versions b/vendor/maennchen/zipstream-php/.tool-versions
new file mode 100644
index 0000000..abc068c
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/.tool-versions
@@ -0,0 +1 @@
+php 8.4.10
diff --git a/vendor/maennchen/zipstream-php/LICENSE b/vendor/maennchen/zipstream-php/LICENSE
new file mode 100644
index 0000000..ebe7fe2
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/LICENSE
@@ -0,0 +1,24 @@
+MIT License
+
+Copyright (C) 2007-2009 Paul Duncan
+Copyright (C) 2014 Jonatan Männchen
+Copyright (C) 2014 Jesse G. Donat
+Copyright (C) 2018 Nicolas CARPi
+
+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.
diff --git a/vendor/maennchen/zipstream-php/README.md b/vendor/maennchen/zipstream-php/README.md
new file mode 100644
index 0000000..3e527f0
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/README.md
@@ -0,0 +1,201 @@
+# ZipStream-PHP
+
+[](https://github.com/maennchen/ZipStream-PHP/actions/workflows/branch_main.yml)
+[](https://coveralls.io/github/maennchen/ZipStream-PHP?branch=main)
+[](https://packagist.org/packages/maennchen/zipstream-php)
+[](https://packagist.org/packages/maennchen/zipstream-php)
+[](https://www.bestpractices.dev/projects/9524)
+[](https://scorecard.dev/viewer/?uri=github.com/maennchen/ZipStream-PHP)
+
+## Unstable Branch
+
+The `main` branch is not stable. Please see the
+[releases](https://github.com/maennchen/ZipStream-PHP/releases) for a stable
+version.
+
+## Overview
+
+A fast and simple streaming zip file downloader for PHP. Using this library will
+save you from having to write the Zip to disk. You can directly send it to the
+user, which is much faster. It can work with S3 buckets or any PSR7 Stream.
+
+Please see the [LICENSE](LICENSE) file for licensing and warranty information.
+
+## Installation
+
+Simply add a dependency on maennchen/zipstream-php to your project's
+`composer.json` file if you use Composer to manage the dependencies of your
+project. Use following command to add the package to your project's dependencies:
+
+```bash
+composer require maennchen/zipstream-php
+```
+
+## Usage
+
+For detailed instructions, please check the
+[Documentation](https://maennchen.github.io/ZipStream-PHP/).
+
+```php
+// Autoload the dependencies
+require 'vendor/autoload.php';
+
+// create a new zipstream object
+$zip = new ZipStream\ZipStream(
+ outputName: 'example.zip',
+
+ // enable output of HTTP headers
+ sendHttpHeaders: true,
+);
+
+// create a file named 'hello.txt'
+$zip->addFile(
+ fileName: 'hello.txt',
+ data: 'This is the contents of hello.txt',
+);
+
+// add a file named 'some_image.jpg' from a local file 'path/to/image.jpg'
+$zip->addFileFromPath(
+ fileName: 'some_image.jpg',
+ path: 'path/to/image.jpg',
+);
+
+// finish the zip stream
+$zip->finish();
+```
+
+### Callback Output
+
+You can stream ZIP data to a custom callback function instead of directly to the browser:
+
+```php
+use ZipStream\ZipStream;
+use ZipStream\Stream\CallbackStreamWrapper;
+
+// Stream to a callback function with proper file handling
+$outputFile = fopen('output.zip', 'wb');
+$backupFile = fopen('backup.zip', 'wb');
+
+$zip = new ZipStream(
+ outputStream: CallbackStreamWrapper::open(function (string $data) use ($outputFile, $backupFile) {
+ // Handle ZIP data as it's generated
+ fwrite($outputFile, $data);
+
+ // Send to multiple destinations efficiently
+ echo $data; // Browser
+ fwrite($backupFile, $data); // Backup file
+ }),
+ sendHttpHeaders: false,
+);
+
+$zip->addFile('hello.txt', 'Hello World!');
+$zip->finish();
+
+// Clean up resources
+fclose($outputFile);
+fclose($backupFile);
+```
+
+## Questions
+
+**💬 Questions? Please Read This First!**
+
+If you have a question about using this library, please *do not email the
+authors directly*. Instead, head over to the
+[GitHub Discussions](https://github.com/maennchen/ZipStream-PHP/discussions)
+page — your question might already be answered there! Using Discussions helps
+build a shared knowledge base, so others can also benefit from the answers. If
+you need dedicated 1:1 support, check out the options available on
+[@maennchen's sponsorship page](https://github.com/sponsors/maennchen?frequency=one-time&sponsor=maennchen).
+
+## Upgrade to version 3.1.2
+
+- Minimum PHP Version: `8.2`
+
+## Upgrade to version 3.0.0
+
+### General
+
+- Minimum PHP Version: `8.1`
+- Only 64bit Architecture is supported.
+- The class `ZipStream\Option\Method` has been replaced with the enum
+ `ZipStream\CompressionMethod`.
+- Most classes have been flagged as `@internal` and should not be used from the
+ outside.
+ If you're using internal resources to extend this library, please open an
+ issue so that a clean interface can be added & published.
+ The externally available classes & enums are:
+ - `ZipStream\CompressionMethod`
+ - `ZipStream\Exception*`
+ - `ZipStream\ZipStream`
+
+### Archive Options
+
+- The class `ZipStream\Option\Archive` has been replaced in favor of named
+ arguments in the `ZipStream\ZipStream` constructor.
+- The archive options `largeFileSize` & `largeFileMethod` has been removed. If
+ you want different `compressionMethods` based on the file size, you'll have to
+ implement this yourself.
+- The archive option `httpHeaderCallback` changed the type from `callable` to
+ `Closure`.
+- The archive option `zeroHeader` has been replaced with the option
+ `defaultEnableZeroHeader` and can be overridden for every file. Its default
+ value changed from `false` to `true`.
+- The archive option `statFiles` was removed since the library no longer checks
+ filesizes this way.
+- The archive option `deflateLevel` has been replaced with the option
+ `defaultDeflateLevel` and can be overridden for every file.
+- The first argument (`name`) of the `ZipStream\ZipStream` constructor has been
+ replaced with the named argument `outputName`.
+- Headers are now also sent if the `outputName` is empty. If you do not want to
+ automatically send http headers, set `sendHttpHeaders` to `false`.
+
+### File Options
+
+- The class `ZipStream\Option\File` has been replaced in favor of named
+ arguments in the `ZipStream\ZipStream->addFile*` functions.
+- The file option `method` has been renamed to `compressionMethod`.
+- The file option `time` has been renamed to `lastModificationDateTime`.
+- The file option `size` has been renamed to `maxSize`.
+
+## Upgrade to version 2.0.0
+
+https://github.com/maennchen/ZipStream-PHP/tree/2.0.0#upgrade-to-version-200
+
+## Upgrade to version 1.0.0
+
+https://github.com/maennchen/ZipStream-PHP/tree/2.0.0#upgrade-to-version-100
+
+## Contributing
+
+ZipStream-PHP is a collaborative project. Please take a look at the
+[.github/CONTRIBUTING.md](.github/CONTRIBUTING.md) file.
+
+## Version Support
+
+Versions are supported according to the table below.
+
+Please do not open any pull requests contradicting the current version support
+status.
+
+Careful: Always check the `README` on `main` for up-to-date information.
+
+| Version | New Features | Bugfixes | Security |
+|---------|--------------|----------|----------|
+| *3* | ✓ | ✓ | ✓ |
+| *2* | ✗ | ✗ | ✓ |
+| *1* | ✗ | ✗ | ✗ |
+| *0* | ✗ | ✗ | ✗ |
+
+This library aligns itself with the PHP core support. New features and bugfixes
+will only target PHP versions according to their current status.
+
+See: https://www.php.net/supported-versions.php
+
+## About the Authors
+
+- Paul Duncan - https://pablotron.org/
+- Jonatan Männchen - https://maennchen.dev
+- Jesse G. Donat - https://donatstudios.com
+- Nicolas CARPi - https://www.deltablot.com
+- Nik Barham - https://www.brokencube.co.uk
diff --git a/vendor/maennchen/zipstream-php/composer.json b/vendor/maennchen/zipstream-php/composer.json
new file mode 100644
index 0000000..529c244
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/composer.json
@@ -0,0 +1,93 @@
+{
+ "name": "maennchen/zipstream-php",
+ "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
+ "keywords": ["zip", "stream"],
+ "type": "library",
+ "license": "MIT",
+ "authors": [{
+ "name": "Paul Duncan",
+ "email": "pabs@pablotron.org"
+ },
+ {
+ "name": "Jonatan Männchen",
+ "email": "jonatan@maennchen.ch"
+ },
+ {
+ "name": "Jesse Donat",
+ "email": "donatj@gmail.com"
+ },
+ {
+ "name": "András Kolesár",
+ "email": "kolesar@kolesar.hu"
+ }
+ ],
+ "require": {
+ "php-64bit": "^8.3",
+ "ext-mbstring": "*",
+ "ext-zlib": "*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^12.0",
+ "guzzlehttp/guzzle": "^7.5",
+ "ext-zip": "*",
+ "mikey179/vfsstream": "^1.6",
+ "php-coveralls/php-coveralls": "^2.5",
+ "friendsofphp/php-cs-fixer": "^3.16",
+ "vimeo/psalm": "^6.0",
+ "brianium/paratest": "^7.7"
+ },
+ "suggest": {
+ "psr/http-message": "^2.0",
+ "guzzlehttp/psr7": "^2.4"
+ },
+ "scripts": {
+ "format": "php-cs-fixer fix",
+ "test": [
+ "@test:unit",
+ "@test:formatted",
+ "@test:lint"
+ ],
+ "test:unit:setup-cov": "@putenv XDEBUG_MODE=coverage",
+ "test:unit": "paratest --functional",
+ "test:unit:cov": ["@test:unit:setup-cov", "@test:unit --coverage-clover=coverage.clover.xml --coverage-html cov"],
+ "test:unit:slow": "@test:unit --group slow",
+ "test:unit:slow:cov": ["@test:unit:setup-cov", "@test:unit --coverage-clover=coverage.clover.xml --coverage-html cov --group slow"],
+ "test:unit:fast": "@test:unit --exclude-group slow",
+ "test:unit:fast:cov": ["@test:unit:setup-cov", "@test:unit --coverage-clover=coverage.clover.xml --coverage-html cov --exclude-group slow"],
+ "test:formatted": "@format --dry-run --stop-on-violation --using-cache=no",
+ "test:lint": "psalm --stats --show-info=true --find-unused-psalm-suppress",
+ "coverage:report": "php-coveralls --coverage_clover=coverage.clover.xml --json_path=coveralls-upload.json --insecure",
+ "install:tools": "phive install --trust-gpg-keys 0x67F861C3D889C656 --trust-gpg-keys 0x8AC0BAA79732DD42 --trust-gpg-keys 0x6DA3ACC4991FFAE5",
+ "docs:generate": "tools/phpdocumentor --sourcecode"
+ },
+ "autoload": {
+ "psr-4": {
+ "ZipStream\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": { "ZipStream\\Test\\": "test/" }
+ },
+ "archive": {
+ "exclude": [
+ "/composer.lock",
+ "/docs",
+ "/.gitattributes",
+ "/.github",
+ "/.gitignore",
+ "/guides",
+ "/.phive",
+ "/.php-cs-fixer.cache",
+ "/.php-cs-fixer.dist.php",
+ "/.phpdoc",
+ "/phpdoc.dist.xml",
+ "/.phpunit.result.cache",
+ "/phpunit.xml.dist",
+ "/psalm.xml",
+ "/test",
+ "/tools",
+ "/.tool-versions",
+ "/vendor"
+ ]
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/guides/ContentLength.rst b/vendor/maennchen/zipstream-php/guides/ContentLength.rst
new file mode 100644
index 0000000..3b75dd7
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/guides/ContentLength.rst
@@ -0,0 +1,47 @@
+Adding Content-Length header
+=============
+
+Adding a ``Content-Length`` header for ``ZipStream`` can be achieved by
+using the options ``SIMULATION_STRICT`` or ``SIMULATION_LAX`` in the
+``operationMode`` parameter.
+
+In the ``SIMULATION_STRICT`` mode, ``ZipStream`` will not allow to calculate the
+size based on reading the whole file. ``SIMULATION_LAX`` will read the whole
+file if necessary.
+
+``SIMULATION_STRICT`` is therefore useful to make sure that the size can be
+calculated efficiently.
+
+.. code-block:: php
+ use ZipStream\OperationMode;
+ use ZipStream\ZipStream;
+
+ $zip = new ZipStream(
+ operationMode: OperationMode::SIMULATE_STRICT, // or SIMULATE_LAX
+ defaultEnableZeroHeader: false,
+ sendHttpHeaders: true,
+ outputStream: $stream,
+ );
+
+ // Normally add files
+ $zip->addFile('sample.txt', 'Sample String Data');
+
+ // Use addFileFromCallback and exactSize if you want to defer opening of
+ // the file resource
+ $zip->addFileFromCallback(
+ 'sample.txt',
+ exactSize: 18,
+ callback: function () {
+ return fopen('...');
+ }
+ );
+
+ // Read resulting file size
+ $size = $zip->finish();
+
+ // Tell it to the browser
+ header('Content-Length: '. $size);
+
+ // Execute the Simulation and stream the actual zip to the client
+ $zip->executeSimulation();
+
diff --git a/vendor/maennchen/zipstream-php/guides/FlySystem.rst b/vendor/maennchen/zipstream-php/guides/FlySystem.rst
new file mode 100644
index 0000000..4e6c6fb
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/guides/FlySystem.rst
@@ -0,0 +1,34 @@
+Usage with FlySystem
+===============
+
+For saving or uploading the generated zip, you can use the
+`Flysystem `_ package, and its many
+adapters.
+
+For that you will need to provide another stream than the ``php://output``
+default one, and pass it to Flysystem ``putStream`` method.
+
+.. code-block:: php
+
+ // Open Stream only once for read and write since it's a memory stream and
+ // the content is lost when closing the stream / opening another one
+ $tempStream = fopen('php://memory', 'w+');
+
+ // Create Zip Archive
+ $zipStream = new ZipStream(
+ outputStream: $tempStream,
+ outputName: 'test.zip',
+ );
+ $zipStream->addFile('test.txt', 'text');
+ $zipStream->finish();
+
+ // Store File
+ // (see Flysystem documentation, and all its framework integration)
+ // Can be any adapter (AWS, Google, Ftp, etc.)
+ $adapter = new Local(__DIR__.'/path/to/folder');
+ $filesystem = new Filesystem($adapter);
+
+ $filesystem->writeStream('test.zip', $tempStream)
+
+ // Close Stream
+ fclose($tempStream);
diff --git a/vendor/maennchen/zipstream-php/guides/Nginx.rst b/vendor/maennchen/zipstream-php/guides/Nginx.rst
new file mode 100644
index 0000000..c53d300
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/guides/Nginx.rst
@@ -0,0 +1,16 @@
+Usage with nginx
+=============
+
+If you are using nginx as a webserver, it will try to buffer the response.
+So you'll want to disable this with a custom header:
+
+.. code-block:: php
+ header('X-Accel-Buffering: no');
+ # or with the Response class from Symfony
+ $response->headers->set('X-Accel-Buffering', 'no');
+
+Alternatively, you can tweak the
+`fastcgi cache parameters `_
+within nginx config.
+
+See `original issue `_.
\ No newline at end of file
diff --git a/vendor/maennchen/zipstream-php/guides/Options.rst b/vendor/maennchen/zipstream-php/guides/Options.rst
new file mode 100644
index 0000000..373afef
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/guides/Options.rst
@@ -0,0 +1,69 @@
+Available options
+===============
+
+Here is the full list of options available to you. You can also have a look at
+``src/ZipStream.php`` file.
+
+.. code-block:: php
+
+ use ZipStream\ZipStream;
+
+ require_once 'vendor/autoload.php';
+
+ $zip = new ZipStream(
+ // Define output stream
+ // (argument is either a resource or implementing
+ // `Psr\Http\Message\StreamInterface`)
+ //
+ // Setup with `psr/http-message` & `guzzlehttp/psr7` dependencies
+ // required when using `Psr\Http\Message\StreamInterface`.
+ //
+ // Can also use CallbackStreamWrapper for custom output handling:
+ // outputStream: CallbackStreamWrapper::open(function($data) { /* handle data */ }),
+ outputStream: $filePointer,
+
+ // Set the deflate level (default is 6; use -1 to disable it)
+ defaultDeflateLevel: 6,
+
+ // Add a comment to the zip file
+ comment: 'This is a comment.',
+
+ // Send http headers (default is true)
+ sendHttpHeaders: false,
+
+ // HTTP Content-Disposition.
+ // Defaults to 'attachment', where FILENAME is the specified filename.
+ // Note that this does nothing if you are not sending HTTP headers.
+ contentDisposition: 'attachment',
+
+ // Output Name for HTTP Content-Disposition
+ // Defaults to no name
+ outputName: "example.zip",
+
+ // HTTP Content-Type.
+ // Defaults to 'application/x-zip'.
+ // Note that this does nothing if you are not sending HTTP headers.
+ contentType: 'application/x-zip',
+
+ // Set the function called for setting headers.
+ // Default is the `header()` of PHP
+ httpHeaderCallback: header(...),
+
+ // Enable streaming files with single read where general purpose bit 3
+ // indicates local file header contain zero values in crc and size
+ // fields, these appear only after file contents in data descriptor
+ // block.
+ // Set to true if your input stream is remote
+ // (used with addFileFromStream()).
+ // Default is false.
+ defaultEnableZeroHeader: false,
+
+ // Enable zip64 extension, allowing very large archives
+ // (> 4Gb or file count > 64k)
+ // Default is true
+ enableZip64: true,
+
+ // Flush output buffer after every write
+ // Default is false
+ flushOutput: true,
+ );
diff --git a/vendor/maennchen/zipstream-php/guides/PSR7Streams.rst b/vendor/maennchen/zipstream-php/guides/PSR7Streams.rst
new file mode 100644
index 0000000..22af71d
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/guides/PSR7Streams.rst
@@ -0,0 +1,21 @@
+Usage with PSR 7 Streams
+===============
+
+PSR-7 streams are `standardized streams `_.
+
+ZipStream-PHP supports working with these streams with the function
+``addFileFromPsr7Stream``.
+
+For all parameters of the function see the API documentation.
+
+Example
+---------------
+
+.. code-block:: php
+
+ $stream = $response->getBody();
+ // add a file named 'streamfile.txt' from the content of the stream
+ $zip->addFileFromPsr7Stream(
+ fileName: 'streamfile.txt',
+ stream: $stream,
+ );
diff --git a/vendor/maennchen/zipstream-php/guides/StreamOutput.rst b/vendor/maennchen/zipstream-php/guides/StreamOutput.rst
new file mode 100644
index 0000000..60593f9
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/guides/StreamOutput.rst
@@ -0,0 +1,113 @@
+Stream Output
+===============
+
+Stream to S3 Bucket
+---------------
+
+.. code-block:: php
+
+ use Aws\S3\S3Client;
+ use Aws\Credentials\CredentialProvider;
+ use ZipStream\ZipStream;
+
+ $bucket = 'your bucket name';
+ $client = new S3Client([
+ 'region' => 'your region',
+ 'version' => 'latest',
+ 'bucketName' => $bucket,
+ 'credentials' => CredentialProvider::defaultProvider(),
+ ]);
+ $client->registerStreamWrapper();
+
+ $zipFile = fopen("s3://$bucket/example.zip", 'w');
+
+ $zip = new ZipStream(
+ enableZip64: false,
+ outputStream: $zipFile,
+ );
+
+ $zip->addFile(
+ fileName: 'file1.txt',
+ data: 'File1 data',
+ );
+ $zip->addFile(
+ fileName: 'file2.txt',
+ data: 'File2 data',
+ );
+ $zip->finish();
+
+ fclose($zipFile);
+
+Stream to Callback Function
+---------------------------
+
+The CallbackStreamWrapper allows you to stream ZIP data to a custom callback function,
+enabling flexible output handling such as streaming to multiple destinations,
+progress tracking, or data transformation.
+
+.. code-block:: php
+
+ use ZipStream\ZipStream;
+ use ZipStream\Stream\CallbackStreamWrapper;
+
+ // Example 1: Stream to multiple destinations with proper file handling
+ $backupFile = fopen('backup.zip', 'wb');
+ $logFile = fopen('transfer.log', 'ab');
+
+ $zip = new ZipStream(
+ outputStream: CallbackStreamWrapper::open(function (string $data) use ($backupFile, $logFile) {
+ // Send to browser
+ echo $data;
+
+ // Save to file efficiently
+ fwrite($backupFile, $data);
+
+ // Log transfer progress
+ fwrite($logFile, "Transferred " . strlen($data) . " bytes\n");
+ }),
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile('hello.txt', 'Hello World!');
+ $zip->finish();
+
+ // Clean up resources
+ fclose($backupFile);
+ fclose($logFile);
+
+.. code-block:: php
+
+ // Example 2: Progress tracking
+ $totalBytes = 0;
+ $zip = new ZipStream(
+ outputStream: CallbackStreamWrapper::open(function (string $data) use (&$totalBytes) {
+ $totalBytes += strlen($data);
+ reportProgress($totalBytes); // Report progress to your tracking system
+
+ // Your actual output handling
+ echo $data;
+ }),
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile('large_file.txt', str_repeat('A', 10000));
+ $zip->finish();
+
+.. code-block:: php
+
+ // Example 3: Data transformation using PHP stream filters
+ // For data transformations, prefer PHP's built-in stream filters
+ $outputStream = fopen('php://output', 'w');
+ stream_filter_append($outputStream, 'convert.base64-encode');
+
+ $zip = new ZipStream(
+ outputStream: $outputStream,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile('secret.txt', 'Confidential data');
+ $zip->finish();
+ fclose($outputStream);
+
+.. note::
+ For data transformations, PHP's built-in stream filters are preferred over callback transformations. Stream filters operate at the stream level and maintain data integrity. You can register custom filters using ``stream_filter_register()`` for specialized transformations.
diff --git a/vendor/maennchen/zipstream-php/guides/Symfony.rst b/vendor/maennchen/zipstream-php/guides/Symfony.rst
new file mode 100644
index 0000000..902552c
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/guides/Symfony.rst
@@ -0,0 +1,130 @@
+Usage with Symfony
+===============
+
+Overview for using ZipStream in Symfony
+--------
+
+Using ZipStream in Symfony requires use of Symfony's ``StreamedResponse`` when
+used in controller actions.
+
+Wrap your call to the relevant ``ZipStream`` stream method (i.e. ``addFile``,
+``addFileFromPath``, ``addFileFromStream``) in Symfony's ``StreamedResponse``
+function passing in any required arguments for your use case.
+
+Using Symfony's ``StreamedResponse`` will allow Symfony to stream output from
+ZipStream correctly to users' browsers and avoid a corrupted final zip landing
+on the users' end.
+
+Example for using ``ZipStream`` in a controller action to zip stream files
+stored in an AWS S3 bucket by key:
+
+.. code-block:: php
+
+ use Symfony\Component\HttpFoundation\StreamedResponse;
+ use Aws\S3\S3Client;
+ use ZipStream;
+
+ //...
+
+ /**
+ * @Route("/zipstream", name="zipstream")
+ */
+ public function zipStreamAction()
+ {
+ // sample test file on s3
+ $s3keys = array(
+ "ziptestfolder/file1.txt"
+ );
+
+ $s3Client = $this->get('app.amazon.s3'); //s3client service
+ $s3Client->registerStreamWrapper(); //required
+
+ // using StreamedResponse to wrap ZipStream functionality
+ // for files on AWS s3.
+ $response = new StreamedResponse(function() use($s3keys, $s3Client)
+ {
+ // Define suitable options for ZipStream Archive.
+ // this is needed to prevent issues with truncated zip files
+ //initialise zipstream with output zip filename and options.
+ $zip = new ZipStream\ZipStream(
+ outputName: 'test.zip',
+ defaultEnableZeroHeader: true,
+ contentType: 'application/octet-stream',
+ );
+
+ //loop keys - useful for multiple files
+ foreach ($s3keys as $key) {
+ // Get the file name in S3 key so we can save it to the zip
+ //file using the same name.
+ $fileName = basename($key);
+
+ // concatenate s3path.
+ // replace with your bucket name or get from parameters file.
+ $bucket = 'bucketname';
+ $s3path = "s3://" . $bucket . "/" . $key;
+
+ //addFileFromStream
+ if ($streamRead = fopen($s3path, 'r')) {
+ $zip->addFileFromStream(
+ fileName: $fileName,
+ stream: $streamRead,
+ );
+ } else {
+ die('Could not open stream for reading');
+ }
+ }
+
+ $zip->finish();
+
+ });
+
+ return $response;
+ }
+
+In the above example, files on AWS S3 are being streamed from S3 to the Symfon
+application via ``fopen`` call when the s3Client has ``registerStreamWrapper``
+applied. This stream is then passed to ``ZipStream`` via the
+``addFileFromStream`` function, which ZipStream then streams as a zip to the
+client browser via Symfony's ``StreamedResponse``. No Zip is created server
+side, which makes this approach a more efficient solution for streaming zips to
+the client browser especially for larger files.
+
+For the above use case you will need to have installed
+`aws/aws-sdk-php-symfony `_ to
+support accessing S3 objects in your Symfony web application. This is not
+required for locally stored files on you server you intend to stream via
+``ZipStream``.
+
+See official Symfony documentation for details on
+`Symfony's StreamedResponse `_
+``Symfony\Component\HttpFoundation\StreamedResponse``.
+
+Note from `S3 documentation `_:
+
+ Streams opened in "r" mode only allow data to be read from the stream, and
+ are not seekable by default. This is so that data can be downloaded from
+ Amazon S3 in a truly streaming manner, where previously read bytes do not
+ need to be buffered into memory. If you need a stream to be seekable, you
+ can pass seekable into the stream context options of a function.
+
+Make sure to configure your S3 context correctly!
+
+Uploading a file
+--------
+
+You need to add correct permissions
+(see `#120 `_)
+
+**example code**
+
+
+.. code-block:: php
+
+ $path = "s3://{$adapter->getBucket()}/{$this->getArchivePath()}";
+
+ // the important bit
+ $outputContext = stream_context_create([
+ 's3' => ['ACL' => 'public-read'],
+ ]);
+
+ fopen($path, 'w', null, $outputContext);
diff --git a/vendor/maennchen/zipstream-php/guides/Varnish.rst b/vendor/maennchen/zipstream-php/guides/Varnish.rst
new file mode 100644
index 0000000..952d287
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/guides/Varnish.rst
@@ -0,0 +1,22 @@
+Usage with Varnish
+=============
+
+Serving a big zip with varnish in between can cause random stream close.
+This can be solved by adding attached code to the vcl file.
+
+To avoid the problem, add the following to your varnish config file:
+
+.. code-block::
+ sub vcl_recv {
+ # Varnish can’t intercept the discussion anymore
+ # helps for streaming big zips
+ if (req.url ~ "\.(tar|gz|zip|7z|exe)$") {
+ return (pipe);
+ }
+ }
+ # Varnish can’t intercept the discussion anymore
+ # helps for streaming big zips
+ sub vcl_pipe {
+ set bereq.http.connection = "close";
+ return (pipe);
+ }
diff --git a/vendor/maennchen/zipstream-php/guides/index.rst b/vendor/maennchen/zipstream-php/guides/index.rst
new file mode 100644
index 0000000..70211c0
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/guides/index.rst
@@ -0,0 +1,126 @@
+ZipStream PHP
+=============
+
+A fast and simple streaming zip file downloader for PHP. Using this library will
+save you from having to write the Zip to disk. You can directly send it to the
+user, which is much faster. It can work with S3 buckets or any PSR7 Stream.
+
+.. toctree::
+
+ index
+ Symfony
+ Options
+ StreamOutput
+ FlySystem
+ PSR7Streams
+ Nginx
+ Varnish
+ ContentLength
+
+Installation
+---------------
+
+Simply add a dependency on ``maennchen/zipstream-php`` to your project's
+``composer.json`` file if you use Composer to manage the dependencies of your
+project. Use following command to add the package to your project's
+dependencies:
+
+.. code-block:: sh
+ composer require maennchen/zipstream-php
+
+If you want to use``addFileFromPsr7Stream```
+(``Psr\Http\Message\StreamInterface``) or use a stream instead of a
+``resource`` as ``outputStream``, the following dependencies must be installed
+as well:
+
+.. code-block:: sh
+ composer require psr/http-message guzzlehttp/psr7
+
+If ``composer install`` yields the following error, your installation is missing
+the `mbstring extension `_,
+either `install it `_
+or run the following command:
+
+.. code-block::
+ Your requirements could not be resolved to an installable set of packages.
+
+ Problem 1
+ - Root composer.json requires PHP extension ext-mbstring * but it is
+ missing from your system. Install or enable PHP's mbstrings extension.
+
+.. code-block:: sh
+ composer require symfony/polyfill-mbstring
+
+Usage Intro
+---------------
+
+Here's a simple example:
+
+.. code-block:: php
+
+ // Autoload the dependencies
+ require 'vendor/autoload.php';
+
+ // create a new zipstream object
+ $zip = new ZipStream\ZipStream(
+ outputName: 'example.zip',
+
+ // enable output of HTTP headers
+ sendHttpHeaders: true,
+ );
+
+ // create a file named 'hello.txt'
+ $zip->addFile(
+ fileName: 'hello.txt',
+ data: 'This is the contents of hello.txt',
+ );
+
+ // add a file named 'some_image.jpg' from a local file 'path/to/image.jpg'
+ $zip->addFileFromPath(
+ fileName: 'some_image.jpg',
+ path: 'path/to/image.jpg',
+ );
+
+ // add a file named 'goodbye.txt' from an open stream resource
+ $filePointer = tmpfile();
+ fwrite($filePointer, 'The quick brown fox jumped over the lazy dog.');
+ rewind($filePointer);
+ $zip->addFileFromStream(
+ fileName: 'goodbye.txt',
+ stream: $filePointer,
+ );
+ fclose($filePointer);
+
+ // add a file named 'streamfile.txt' from the body of a `guzzle` response
+ // Setup with `psr/http-message` & `guzzlehttp/psr7` dependencies required.
+ $zip->addFileFromPsr7Stream(
+ fileName: 'streamfile.txt',
+ stream: $response->getBody(),
+ );
+
+ // finish the zip stream
+ $zip->finish();
+
+You can also add comments, modify file timestamps, and customize (or
+disable) the HTTP headers. It is also possible to specify the storage method
+when adding files, the current default storage method is ``DEFLATE``
+i.e files are stored with Compression mode 0x08.
+
+Known Issues
+---------------
+
+The native Mac OS archive extraction tool prior to macOS 10.15 might not open
+archives in some conditions. A workaround is to disable the Zip64 feature with
+the option ``enableZip64: false``. This limits the archive to 4 Gb and 64k files
+but will allow users on macOS 10.14 and below to open them without issue.
+See `#116 `_.
+
+The linux ``unzip`` utility might not handle properly unicode characters.
+It is recommended to extract with another tool like
+`7-zip `_.
+See `#146 `_.
+
+It is the responsibility of the client code to make sure that files are not
+saved with the same path, as it is not possible for the library to figure it out
+while streaming a zip.
+See `#154 `_.
diff --git a/vendor/maennchen/zipstream-php/phpdoc.dist.xml b/vendor/maennchen/zipstream-php/phpdoc.dist.xml
new file mode 100644
index 0000000..b98fe1c
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/phpdoc.dist.xml
@@ -0,0 +1,39 @@
+
+
+ 💾 ZipStream-PHP
+
+
+
+
+ latest
+
+
+ src
+
+
+
+ tests/**/*
+ vendor/**/*
+
+
+ php
+
+ public
+ ZipStream
+ true
+
+
+
+ guides
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/vendor/maennchen/zipstream-php/phpunit.xml.dist b/vendor/maennchen/zipstream-php/phpunit.xml.dist
new file mode 100644
index 0000000..1b02a3a
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/phpunit.xml.dist
@@ -0,0 +1,15 @@
+
+
+
+
+
+ test
+
+
+
+
+
+ src
+
+
+
diff --git a/vendor/maennchen/zipstream-php/psalm.xml b/vendor/maennchen/zipstream-php/psalm.xml
new file mode 100644
index 0000000..56af0e6
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/psalm.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vendor/maennchen/zipstream-php/src/CentralDirectoryFileHeader.php b/vendor/maennchen/zipstream-php/src/CentralDirectoryFileHeader.php
new file mode 100644
index 0000000..ffcfc6e
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/CentralDirectoryFileHeader.php
@@ -0,0 +1,52 @@
+value),
+ new PackField(format: 'V', value: Time::dateTimeToDosTime($lastModificationDateTime)),
+ new PackField(format: 'V', value: $crc32),
+ new PackField(format: 'V', value: $compressedSize),
+ new PackField(format: 'V', value: $uncompressedSize),
+ new PackField(format: 'v', value: strlen($fileName)),
+ new PackField(format: 'v', value: strlen($extraField)),
+ new PackField(format: 'v', value: strlen($fileComment)),
+ new PackField(format: 'v', value: $diskNumberStart),
+ new PackField(format: 'v', value: $internalFileAttributes),
+ new PackField(format: 'V', value: $externalFileAttributes),
+ new PackField(format: 'V', value: $relativeOffsetOfLocalHeader),
+ ) . $fileName . $extraField . $fileComment;
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/CompressionMethod.php b/vendor/maennchen/zipstream-php/src/CompressionMethod.php
new file mode 100644
index 0000000..2e1289c
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/CompressionMethod.php
@@ -0,0 +1,109 @@
+format(DateTimeInterface::ATOM) . " can't be represented as DOS time / date.");
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Exception/FileNotFoundException.php b/vendor/maennchen/zipstream-php/src/Exception/FileNotFoundException.php
new file mode 100644
index 0000000..b9b1a2b
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Exception/FileNotFoundException.php
@@ -0,0 +1,24 @@
+resource = $resource;
+ parent::__construct('Function ' . $function . 'failed on resource.');
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Exception/SimulationFileUnknownException.php b/vendor/maennchen/zipstream-php/src/Exception/SimulationFileUnknownException.php
new file mode 100644
index 0000000..240f825
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Exception/SimulationFileUnknownException.php
@@ -0,0 +1,21 @@
+fileName = self::filterFilename($fileName);
+ $this->checkEncoding();
+
+ if ($this->enableZeroHeader) {
+ $this->generalPurposeBitFlag |= GeneralPurposeBitFlag::ZERO_HEADER;
+ }
+
+ $this->version = $this->compressionMethod === CompressionMethod::DEFLATE ? Version::DEFLATE : Version::STORE;
+ }
+
+ public function cloneSimulationExecution(): self
+ {
+ return new self(
+ $this->fileName,
+ $this->dataCallback,
+ OperationMode::NORMAL,
+ $this->startOffset,
+ $this->compressionMethod,
+ $this->comment,
+ $this->lastModificationDateTime,
+ $this->deflateLevel,
+ $this->maxSize,
+ $this->exactSize,
+ $this->enableZip64,
+ $this->enableZeroHeader,
+ $this->send,
+ $this->recordSentBytes,
+ );
+ }
+
+ public function process(): string
+ {
+ $forecastSize = $this->forecastSize();
+
+ if ($this->enableZeroHeader) {
+ // No calculation required
+ } elseif ($this->isSimulation() && $forecastSize !== null) {
+ $this->uncompressedSize = $forecastSize;
+ $this->compressedSize = $forecastSize;
+ } else {
+ $this->readStream(send: false);
+ if (rewind($this->unpackStream()) === false) {
+ throw new ResourceActionException('rewind', $this->unpackStream());
+ }
+ }
+
+ $this->addFileHeader();
+
+ $detectedSize = $forecastSize ?? ($this->compressedSize > 0 ? $this->compressedSize : null);
+
+ if (
+ $this->isSimulation() &&
+ $detectedSize !== null
+ ) {
+ $this->uncompressedSize = $detectedSize;
+ $this->compressedSize = $detectedSize;
+ ($this->recordSentBytes)($detectedSize);
+ } else {
+ $this->readStream(send: true);
+ }
+
+ $this->addFileFooter();
+ return $this->getCdrFile();
+ }
+
+ /**
+ * @return resource
+ */
+ private function unpackStream()
+ {
+ if ($this->stream) {
+ return $this->stream;
+ }
+
+ if ($this->operationMode === OperationMode::SIMULATE_STRICT) {
+ throw new SimulationFileUnknownException();
+ }
+
+ $this->stream = ($this->dataCallback)();
+
+ if (!$this->enableZeroHeader && !stream_get_meta_data($this->stream)['seekable']) {
+ throw new StreamNotSeekableException();
+ }
+ if (!(
+ str_contains(stream_get_meta_data($this->stream)['mode'], 'r')
+ || str_contains(stream_get_meta_data($this->stream)['mode'], 'w+')
+ || str_contains(stream_get_meta_data($this->stream)['mode'], 'a+')
+ || str_contains(stream_get_meta_data($this->stream)['mode'], 'x+')
+ || str_contains(stream_get_meta_data($this->stream)['mode'], 'c+')
+ )) {
+ throw new StreamNotReadableException();
+ }
+
+ return $this->stream;
+ }
+
+ private function forecastSize(): ?int
+ {
+ if ($this->compressionMethod !== CompressionMethod::STORE) {
+ return null;
+ }
+ if ($this->exactSize !== null) {
+ return $this->exactSize;
+ }
+ $fstat = fstat($this->unpackStream());
+ if (!$fstat || !array_key_exists('size', $fstat) || $fstat['size'] < 1) {
+ return null;
+ }
+
+ if ($this->maxSize !== null && $this->maxSize < $fstat['size']) {
+ return $this->maxSize;
+ }
+
+ return $fstat['size'];
+ }
+
+ /**
+ * Create and send zip header for this file.
+ */
+ private function addFileHeader(): void
+ {
+ $forceEnableZip64 = $this->enableZeroHeader && $this->enableZip64;
+
+ $footer = $this->buildZip64ExtraBlock($forceEnableZip64);
+
+ $zip64Enabled = $footer !== '';
+
+ if ($zip64Enabled) {
+ $this->version = Version::ZIP64;
+ }
+
+ if ($this->generalPurposeBitFlag & GeneralPurposeBitFlag::EFS) {
+ // Put the tricky entry to
+ // force Linux unzip to lookup EFS flag.
+ $footer .= Zs\ExtendedInformationExtraField::generate();
+ }
+
+ $data = LocalFileHeader::generate(
+ versionNeededToExtract: $this->version->value,
+ generalPurposeBitFlag: $this->generalPurposeBitFlag,
+ compressionMethod: $this->compressionMethod,
+ lastModificationDateTime: $this->lastModificationDateTime,
+ crc32UncompressedData: $this->crc,
+ compressedSize: $zip64Enabled
+ ? 0xFFFFFFFF
+ : $this->compressedSize,
+ uncompressedSize: $zip64Enabled
+ ? 0xFFFFFFFF
+ : $this->uncompressedSize,
+ fileName: $this->fileName,
+ extraField: $footer,
+ );
+
+
+ ($this->send)($data);
+ }
+
+ /**
+ * Strip characters that are not legal in Windows filenames
+ * to prevent compatibility issues
+ */
+ private static function filterFilename(
+ /**
+ * Unprocessed filename
+ */
+ string $fileName
+ ): string {
+ // strip leading slashes from file name
+ // (fixes bug in windows archive viewer)
+ $fileName = ltrim($fileName, '/');
+
+ return str_replace(['\\', ':', '*', '?', '"', '<', '>', '|'], '_', $fileName);
+ }
+
+ private function checkEncoding(): void
+ {
+ // Sets Bit 11: Language encoding flag (EFS). If this bit is set,
+ // the filename and comment fields for this file
+ // MUST be encoded using UTF-8. (see APPENDIX D)
+ if (mb_check_encoding($this->fileName, 'UTF-8') &&
+ mb_check_encoding($this->comment, 'UTF-8')) {
+ $this->generalPurposeBitFlag |= GeneralPurposeBitFlag::EFS;
+ }
+ }
+
+ private function buildZip64ExtraBlock(bool $force = false): string
+ {
+ $outputZip64ExtraBlock = false;
+
+ $originalSize = null;
+ if ($force || $this->uncompressedSize > 0xFFFFFFFF) {
+ $outputZip64ExtraBlock = true;
+ $originalSize = $this->uncompressedSize;
+ }
+
+ $compressedSize = null;
+ if ($force || $this->compressedSize > 0xFFFFFFFF) {
+ $outputZip64ExtraBlock = true;
+ $compressedSize = $this->compressedSize;
+ }
+
+ // If this file will start over 4GB limit in ZIP file,
+ // CDR record will have to use Zip64 extension to describe offset
+ // to keep consistency we use the same value here
+ $relativeHeaderOffset = null;
+ if ($this->startOffset > 0xFFFFFFFF) {
+ $outputZip64ExtraBlock = true;
+ $relativeHeaderOffset = $this->startOffset;
+ }
+
+ if (!$outputZip64ExtraBlock) {
+ return '';
+ }
+
+ if (!$this->enableZip64) {
+ throw new OverflowException();
+ }
+
+ return Zip64\ExtendedInformationExtraField::generate(
+ originalSize: $originalSize,
+ compressedSize: $compressedSize,
+ relativeHeaderOffset: $relativeHeaderOffset,
+ diskStartNumber: null,
+ );
+ }
+
+ private function addFileFooter(): void
+ {
+ if (($this->compressedSize > 0xFFFFFFFF || $this->uncompressedSize > 0xFFFFFFFF) && $this->version !== Version::ZIP64) {
+ throw new OverflowException();
+ }
+
+ if (!$this->enableZeroHeader) {
+ return;
+ }
+
+ if ($this->version === Version::ZIP64) {
+ $footer = Zip64\DataDescriptor::generate(
+ crc32UncompressedData: $this->crc,
+ compressedSize: $this->compressedSize,
+ uncompressedSize: $this->uncompressedSize,
+ );
+ } else {
+ $footer = DataDescriptor::generate(
+ crc32UncompressedData: $this->crc,
+ compressedSize: $this->compressedSize,
+ uncompressedSize: $this->uncompressedSize,
+ );
+ }
+
+ ($this->send)($footer);
+ }
+
+ private function readStream(bool $send): void
+ {
+ $this->compressedSize = 0;
+ $this->uncompressedSize = 0;
+ $hash = hash_init('crc32b');
+
+ $deflate = $this->compressionInit();
+
+ while (
+ !feof($this->unpackStream()) &&
+ ($this->maxSize === null || $this->uncompressedSize < $this->maxSize) &&
+ ($this->exactSize === null || $this->uncompressedSize < $this->exactSize)
+ ) {
+ $readLength = min(
+ ($this->maxSize ?? PHP_INT_MAX) - $this->uncompressedSize,
+ ($this->exactSize ?? PHP_INT_MAX) - $this->uncompressedSize,
+ self::CHUNKED_READ_BLOCK_SIZE
+ );
+
+ $data = fread($this->unpackStream(), $readLength);
+
+ if ($data === false) {
+ throw new ResourceActionException('fread', $this->unpackStream());
+ }
+
+ hash_update($hash, $data);
+
+ $this->uncompressedSize += strlen($data);
+
+ if ($deflate) {
+ $data = deflate_add(
+ $deflate,
+ $data,
+ feof($this->unpackStream()) ? ZLIB_FINISH : ZLIB_NO_FLUSH
+ );
+
+ if ($data === false) {
+ throw new RuntimeException('deflate_add failed');
+ }
+ }
+
+ $this->compressedSize += strlen($data);
+
+ if ($send) {
+ ($this->send)($data);
+ }
+ }
+
+ if ($this->exactSize !== null && $this->uncompressedSize !== $this->exactSize) {
+ throw new FileSizeIncorrectException(expectedSize: $this->exactSize, actualSize: $this->uncompressedSize);
+ }
+
+ $this->crc = hexdec(hash_final($hash));
+ }
+
+ private function compressionInit(): ?DeflateContext
+ {
+ switch ($this->compressionMethod) {
+ case CompressionMethod::STORE:
+ // Noting to do
+ return null;
+ case CompressionMethod::DEFLATE:
+ $deflateContext = deflate_init(
+ ZLIB_ENCODING_RAW,
+ ['level' => $this->deflateLevel]
+ );
+
+ if (!$deflateContext) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException("Can't initialize deflate context.");
+ // @codeCoverageIgnoreEnd
+ }
+
+ // False positive, resource is no longer returned from this function
+ return $deflateContext;
+ default:
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException('Unsupported Compression Method ' . print_r($this->compressionMethod, true));
+ // @codeCoverageIgnoreEnd
+ }
+ }
+
+ private function getCdrFile(): string
+ {
+ $footer = $this->buildZip64ExtraBlock();
+
+ return CentralDirectoryFileHeader::generate(
+ versionMadeBy: ZipStream::ZIP_VERSION_MADE_BY,
+ versionNeededToExtract: $this->version->value,
+ generalPurposeBitFlag: $this->generalPurposeBitFlag,
+ compressionMethod: $this->compressionMethod,
+ lastModificationDateTime: $this->lastModificationDateTime,
+ crc32: $this->crc,
+ compressedSize: $this->compressedSize > 0xFFFFFFFF
+ ? 0xFFFFFFFF
+ : $this->compressedSize,
+ uncompressedSize: $this->uncompressedSize > 0xFFFFFFFF
+ ? 0xFFFFFFFF
+ : $this->uncompressedSize,
+ fileName: $this->fileName,
+ extraField: $footer,
+ fileComment: $this->comment,
+ diskNumberStart: 0,
+ internalFileAttributes: 0,
+ externalFileAttributes: 32,
+ relativeOffsetOfLocalHeader: $this->startOffset > 0xFFFFFFFF
+ ? 0xFFFFFFFF
+ : $this->startOffset,
+ );
+ }
+
+ private function isSimulation(): bool
+ {
+ return $this->operationMode === OperationMode::SIMULATE_LAX || $this->operationMode === OperationMode::SIMULATE_STRICT;
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/GeneralPurposeBitFlag.php b/vendor/maennchen/zipstream-php/src/GeneralPurposeBitFlag.php
new file mode 100644
index 0000000..23a66d8
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/GeneralPurposeBitFlag.php
@@ -0,0 +1,89 @@
+value),
+ new PackField(format: 'V', value: Time::dateTimeToDosTime($lastModificationDateTime)),
+ new PackField(format: 'V', value: $crc32UncompressedData),
+ new PackField(format: 'V', value: $compressedSize),
+ new PackField(format: 'V', value: $uncompressedSize),
+ new PackField(format: 'v', value: strlen($fileName)),
+ new PackField(format: 'v', value: strlen($extraField)),
+ ) . $fileName . $extraField;
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/OperationMode.php b/vendor/maennchen/zipstream-php/src/OperationMode.php
new file mode 100644
index 0000000..ae45e31
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/OperationMode.php
@@ -0,0 +1,37 @@
+format;
+ }, '');
+
+ $args = array_map(function (self $field) {
+ switch ($field->format) {
+ case 'V':
+ if ($field->value > self::MAX_V) {
+ throw new RuntimeException(print_r($field->value, true) . ' is larger than 32 bits');
+ }
+ break;
+ case 'v':
+ if ($field->value > self::MAX_v) {
+ throw new RuntimeException(print_r($field->value, true) . ' is larger than 16 bits');
+ }
+ break;
+ case 'P': break;
+ default:
+ break;
+ }
+
+ return $field->value;
+ }, $fields);
+
+ return pack($fmt, ...$args);
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Stream/CallbackStreamWrapper.php b/vendor/maennchen/zipstream-php/src/Stream/CallbackStreamWrapper.php
new file mode 100644
index 0000000..fb35487
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Stream/CallbackStreamWrapper.php
@@ -0,0 +1,253 @@
+ Map of stream IDs to callback functions */
+ private static array $callbacks = [];
+
+ /** @var string|null Unique identifier for this stream instance */
+ private ?string $id = null;
+
+ /** @var int Current position in the stream */
+ private int $pos = 0;
+
+ /**
+ * Destructor - ensures cleanup even if stream_close() isn't called.
+ * Prevents memory leaks in long-running processes.
+ */
+ public function __destruct()
+ {
+ $this->stream_close();
+ }
+
+ /**
+ * Create a new callback stream.
+ *
+ * @param callable(string):void $callback Function to call with written data
+ * @return resource|false Stream resource or false on failure
+ */
+ public static function open(callable $callback)
+ {
+ if (!in_array(self::PROTOCOL, stream_get_wrappers(), true)) {
+ if (!stream_wrapper_register(self::PROTOCOL, self::class)) {
+ return false;
+ }
+ }
+
+ // Generate cryptographically secure unique ID to prevent collisions
+ $id = 'cb_' . bin2hex(random_bytes(16));
+ self::$callbacks[$id] = $callback;
+
+ return fopen(self::PROTOCOL . "://{$id}", 'wb');
+ }
+
+ /**
+ * Clean up all registered callbacks (useful for testing).
+ *
+ * @internal
+ */
+ public static function cleanup(): void
+ {
+ self::$callbacks = [];
+ }
+
+ /**
+ * Open the stream.
+ *
+ * @param string $path Stream path containing the callback ID
+ * @param string $mode File mode (must contain 'w' for writing)
+ * @param int $options Stream options (required by interface, unused)
+ * @param string|null $opened_path Opened path reference (required by interface, unused)
+ * @return bool True if stream opened successfully
+ * @psalm-suppress UnusedParam $options and $opened_path are required by the stream wrapper interface
+ */
+ public function stream_open(string $path, string $mode, int $options, ?string &$opened_path): bool
+ {
+ if (!str_contains($mode, 'w')) {
+ return false;
+ }
+
+ $host = parse_url($path, PHP_URL_HOST);
+ if ($host === false || $host === null) {
+ return false;
+ }
+
+ $this->id = $host;
+ return isset(self::$callbacks[$this->id]);
+ }
+
+ /**
+ * Write data to the callback.
+ *
+ * @param string $data Data to write
+ * @return int Number of bytes written
+ * @throws RuntimeException If callback execution fails
+ */
+ public function stream_write(string $data): int
+ {
+ if ($this->id === null) {
+ trigger_error('Stream not properly initialized', E_USER_WARNING);
+ return 0;
+ }
+
+ $callback = self::$callbacks[$this->id] ?? null;
+ if ($callback === null) {
+ trigger_error('Callback not found for stream', E_USER_WARNING);
+ return 0;
+ }
+
+ try {
+ $callback($data);
+ } catch (Throwable $e) {
+ throw new RuntimeException(
+ 'Callback function failed during stream write: ' . $e->getMessage(),
+ 0,
+ $e
+ );
+ }
+
+ $length = strlen($data);
+ $this->pos += $length;
+ return $length;
+ }
+
+ /**
+ * Get current position in stream.
+ *
+ * @return int Current position
+ */
+ public function stream_tell(): int
+ {
+ return $this->pos;
+ }
+
+ /**
+ * Check if stream has reached end of file.
+ *
+ * @return bool Always false for write-only streams
+ */
+ public function stream_eof(): bool
+ {
+ return false;
+ }
+
+ /**
+ * Flush stream buffers.
+ *
+ * @return bool Always true (no buffering)
+ */
+ public function stream_flush(): bool
+ {
+ return true;
+ }
+
+ /**
+ * Close the stream and clean up callback.
+ */
+ public function stream_close(): void
+ {
+ if ($this->id !== null) {
+ unset(self::$callbacks[$this->id]);
+ $this->id = null;
+ }
+ }
+
+ /**
+ * Get stream statistics.
+ *
+ * @return array Stream statistics
+ */
+ public function stream_stat(): array
+ {
+ return [
+ 'dev' => 0,
+ 'ino' => 0,
+ 'mode' => 0o100666, // Regular file, read/write permissions
+ 'nlink' => 1,
+ 'uid' => 0,
+ 'gid' => 0,
+ 'rdev' => 0,
+ 'size' => $this->pos,
+ 'atime' => time(),
+ 'mtime' => time(),
+ 'ctime' => time(),
+ 'blksize' => 4096,
+ 'blocks' => ceil($this->pos / 4096),
+ ];
+ }
+
+ /**
+ * Read data from stream (not supported - write-only stream).
+ *
+ * @param int $count Number of bytes to read (required by interface, unused)
+ * @return string Always empty string
+ * @psalm-suppress UnusedParam $count is required by the stream wrapper interface
+ */
+ public function stream_read(int $count): string
+ {
+ trigger_error('Read operations not supported on callback streams', E_USER_WARNING);
+ return '';
+ }
+
+ /**
+ * Seek to position in stream (not supported).
+ *
+ * @param int $offset Offset to seek to (required by interface, unused)
+ * @param int $whence Seek mode (required by interface, unused)
+ * @return bool Always false
+ * @psalm-suppress UnusedParam $offset and $whence are required by the stream wrapper interface
+ */
+ public function stream_seek(int $offset, int $whence = SEEK_SET): bool
+ {
+ trigger_error('Seek operations not supported on callback streams', E_USER_WARNING);
+ return false;
+ }
+
+ /**
+ * Set options on stream (not supported).
+ *
+ * @param int $option Option to set (required by interface, unused)
+ * @param int $arg1 First argument (required by interface, unused)
+ * @param int $arg2 Second argument (required by interface, unused)
+ * @return bool Always false
+ * @psalm-suppress UnusedParam All parameters are required by the stream wrapper interface
+ */
+ public function stream_set_option(int $option, int $arg1, int $arg2): bool
+ {
+ return false;
+ }
+
+ /**
+ * Truncate stream (not supported).
+ *
+ * @param int $new_size New size (required by interface, unused)
+ * @return bool Always false
+ * @psalm-suppress UnusedParam $new_size is required by the stream wrapper interface
+ */
+ public function stream_truncate(int $new_size): bool
+ {
+ trigger_error('Truncate operations not supported on callback streams', E_USER_WARNING);
+ return false;
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Time.php b/vendor/maennchen/zipstream-php/src/Time.php
new file mode 100644
index 0000000..1b4121c
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Time.php
@@ -0,0 +1,39 @@
+getTimestamp() < $dosMinimumDate->getTimestamp()) {
+ throw new DosTimeOverflowException(dateTime: $dateTime);
+ }
+
+ $dateTime = DateTimeImmutable::createFromInterface($dateTime)->sub(new DateInterval('P1980Y'));
+
+ [$year, $month, $day, $hour, $minute, $second] = explode(' ', $dateTime->format('Y n j G i s'));
+
+ return
+ ((int) $year << 25) |
+ ((int) $month << 21) |
+ ((int) $day << 16) |
+ ((int) $hour << 11) |
+ ((int) $minute << 5) |
+ ((int) $second >> 1);
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Version.php b/vendor/maennchen/zipstream-php/src/Version.php
new file mode 100644
index 0000000..483d25a
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Version.php
@@ -0,0 +1,15 @@
+addFile(fileName: 'world.txt', data: 'Hello World');
+ *
+ * // add second file
+ * $zip->addFile(fileName: 'moon.txt', data: 'Hello Moon');
+ * ```
+ *
+ * 3. Finish the zip stream:
+ *
+ * ```php
+ * $zip->finish();
+ * ```
+ *
+ * You can also add an archive comment, add comments to individual files,
+ * and adjust the timestamp of files. See the API documentation for each
+ * method below for additional information.
+ *
+ * ## Example
+ *
+ * ```php
+ * // create a new zip stream object
+ * $zip = new ZipStream(outputName: 'some_files.zip');
+ *
+ * // list of local files
+ * $files = array('foo.txt', 'bar.jpg');
+ *
+ * // read and add each file to the archive
+ * foreach ($files as $path)
+ * $zip->addFileFromPath(fileName: $path, $path);
+ *
+ * // write archive footer to stream
+ * $zip->finish();
+ * ```
+ *
+ * @api
+ */
+class ZipStream
+{
+ /**
+ * This number corresponds to the ZIP version/OS used (2 bytes)
+ * From: https://www.iana.org/assignments/media-types/application/zip
+ * The upper byte (leftmost one) indicates the host system (OS) for the
+ * file. Software can use this information to determine
+ * the line record format for text files etc. The current
+ * mappings are:
+ *
+ * 0 - MS-DOS and OS/2 (F.A.T. file systems)
+ * 1 - Amiga 2 - VAX/VMS
+ * 3 - *nix 4 - VM/CMS
+ * 5 - Atari ST 6 - OS/2 H.P.F.S.
+ * 7 - Macintosh 8 - Z-System
+ * 9 - CP/M 10 thru 255 - unused
+ *
+ * The lower byte (rightmost one) indicates the version number of the
+ * software used to encode the file. The value/10
+ * indicates the major version number, and the value
+ * mod 10 is the minor version number.
+ * Here we are using 6 for the OS, indicating OS/2 H.P.F.S.
+ * to prevent file permissions issues upon extract (see #84)
+ * 0x603 is 00000110 00000011 in binary, so 6 and 3
+ *
+ * @internal
+ */
+ public const ZIP_VERSION_MADE_BY = 0x603;
+
+ private bool $ready = true;
+
+ private int $offset = 0;
+
+ /**
+ * @var string[]
+ */
+ private array $centralDirectoryRecords = [];
+
+ /**
+ * @var resource
+ */
+ private $outputStream;
+
+ private readonly Closure $httpHeaderCallback;
+
+ /**
+ * @var File[]
+ */
+ private array $recordedSimulation = [];
+
+ /**
+ * Create a new ZipStream object.
+ *
+ * ##### Examples
+ *
+ * ```php
+ * // create a new zip file named 'foo.zip'
+ * $zip = new ZipStream(outputName: 'foo.zip');
+ *
+ * // create a new zip file named 'bar.zip' with a comment
+ * $zip = new ZipStream(
+ * outputName: 'bar.zip',
+ * comment: 'this is a comment for the zip file.',
+ * );
+ * ```
+ *
+ * @param OperationMode $operationMode
+ * The mode can be used to switch between `NORMAL` and `SIMULATION_*` modes.
+ * For details see the `OperationMode` documentation.
+ *
+ * Default to `NORMAL`.
+ *
+ * @param string $comment
+ * Archive Level Comment
+ *
+ * @param StreamInterface|resource|null $outputStream
+ * Override the output of the archive to a different target.
+ *
+ * By default the archive is sent to `STDOUT`.
+ *
+ * @param CompressionMethod $defaultCompressionMethod
+ * How to handle file compression. Legal values are
+ * `CompressionMethod::DEFLATE` (the default), or
+ * `CompressionMethod::STORE`. `STORE` sends the file raw and is
+ * significantly faster, while `DEFLATE` compresses the file and
+ * is much, much slower.
+ *
+ * @param int $defaultDeflateLevel
+ * Default deflation level. Only relevant if `compressionMethod`
+ * is `DEFLATE`.
+ *
+ * See details of [`deflate_init`](https://www.php.net/manual/en/function.deflate-init.php#refsect1-function.deflate-init-parameters)
+ *
+ * @param bool $enableZip64
+ * Enable Zip64 extension, supporting very large
+ * archives (any size > 4 GB or file count > 64k)
+ *
+ * @param bool $defaultEnableZeroHeader
+ * Enable streaming files with single read.
+ *
+ * When the zero header is set, the file is streamed into the output
+ * and the size & checksum are added at the end of the file. This is the
+ * fastest method and uses the least memory. Unfortunately not all
+ * ZIP clients fully support this and can lead to clients reporting
+ * the generated ZIP files as corrupted in combination with other
+ * circumstances. (Zip64 enabled, using UTF8 in comments / names etc.)
+ *
+ * When the zero header is not set, the length & checksum need to be
+ * defined before the file is actually added. To prevent loading all
+ * the data into memory, the data has to be read twice. If the data
+ * which is added is not seekable, this call will fail.
+ *
+ * @param bool $sendHttpHeaders
+ * Boolean indicating whether or not to send
+ * the HTTP headers for this file.
+ *
+ * @param ?Closure $httpHeaderCallback
+ * The method called to send HTTP headers
+ *
+ * @param string|null $outputName
+ * The name of the created archive.
+ *
+ * Only relevant if `$sendHttpHeaders = true`.
+ *
+ * @param string $contentDisposition
+ * HTTP Content-Disposition
+ *
+ * Only relevant if `sendHttpHeaders = true`.
+ *
+ * @param string $contentType
+ * HTTP Content Type
+ *
+ * Only relevant if `sendHttpHeaders = true`.
+ *
+ * @param bool $flushOutput
+ * Enable flush after every write to output stream.
+ *
+ * @return self
+ */
+ public function __construct(
+ private OperationMode $operationMode = OperationMode::NORMAL,
+ private readonly string $comment = '',
+ $outputStream = null,
+ private readonly CompressionMethod $defaultCompressionMethod = CompressionMethod::DEFLATE,
+ private readonly int $defaultDeflateLevel = 6,
+ private readonly bool $enableZip64 = true,
+ private readonly bool $defaultEnableZeroHeader = true,
+ private bool $sendHttpHeaders = true,
+ ?Closure $httpHeaderCallback = null,
+ private readonly ?string $outputName = null,
+ private readonly string $contentDisposition = 'attachment',
+ private readonly string $contentType = 'application/x-zip',
+ private bool $flushOutput = false,
+ ) {
+ $this->outputStream = self::normalizeStream($outputStream);
+ $this->httpHeaderCallback = $httpHeaderCallback ?? header(...);
+ }
+
+ /**
+ * Add a file to the archive.
+ *
+ * ##### File Options
+ *
+ * See {@see addFileFromPsr7Stream()}
+ *
+ * ##### Examples
+ *
+ * ```php
+ * // add a file named 'world.txt'
+ * $zip->addFile(fileName: 'world.txt', data: 'Hello World!');
+ *
+ * // add a file named 'bar.jpg' with a comment and a last-modified
+ * // time of two hours ago
+ * $zip->addFile(
+ * fileName: 'bar.jpg',
+ * data: $data,
+ * comment: 'this is a comment about bar.jpg',
+ * lastModificationDateTime: new DateTime('2 hours ago'),
+ * );
+ * ```
+ *
+ * @param string $data
+ *
+ * contents of file
+ */
+ public function addFile(
+ string $fileName,
+ string $data,
+ string $comment = '',
+ ?CompressionMethod $compressionMethod = null,
+ ?int $deflateLevel = null,
+ ?DateTimeInterface $lastModificationDateTime = null,
+ ?int $maxSize = null,
+ ?int $exactSize = null,
+ ?bool $enableZeroHeader = null,
+ ): void {
+ $this->addFileFromCallback(
+ fileName: $fileName,
+ callback: fn() => $data,
+ comment: $comment,
+ compressionMethod: $compressionMethod,
+ deflateLevel: $deflateLevel,
+ lastModificationDateTime: $lastModificationDateTime,
+ maxSize: $maxSize,
+ exactSize: $exactSize,
+ enableZeroHeader: $enableZeroHeader,
+ );
+ }
+
+ /**
+ * Add a file at path to the archive.
+ *
+ * ##### File Options
+ *
+ * See {@see addFileFromPsr7Stream()}
+ *
+ * ###### Examples
+ *
+ * ```php
+ * // add a file named 'foo.txt' from the local file '/tmp/foo.txt'
+ * $zip->addFileFromPath(
+ * fileName: 'foo.txt',
+ * path: '/tmp/foo.txt',
+ * );
+ *
+ * // add a file named 'bigfile.rar' from the local file
+ * // '/usr/share/bigfile.rar' with a comment and a last-modified
+ * // time of two hours ago
+ * $zip->addFileFromPath(
+ * fileName: 'bigfile.rar',
+ * path: '/usr/share/bigfile.rar',
+ * comment: 'this is a comment about bigfile.rar',
+ * lastModificationDateTime: new DateTime('2 hours ago'),
+ * );
+ * ```
+ *
+ * @throws \ZipStream\Exception\FileNotFoundException
+ * @throws \ZipStream\Exception\FileNotReadableException
+ */
+ public function addFileFromPath(
+ /**
+ * name of file in archive (including directory path).
+ */
+ string $fileName,
+
+ /**
+ * path to file on disk (note: paths should be encoded using
+ * UNIX-style forward slashes -- e.g '/path/to/some/file').
+ */
+ string $path,
+ string $comment = '',
+ ?CompressionMethod $compressionMethod = null,
+ ?int $deflateLevel = null,
+ ?DateTimeInterface $lastModificationDateTime = null,
+ ?int $maxSize = null,
+ ?int $exactSize = null,
+ ?bool $enableZeroHeader = null,
+ ): void {
+ if (!is_readable($path)) {
+ if (!file_exists($path)) {
+ throw new FileNotFoundException($path);
+ }
+ throw new FileNotReadableException($path);
+ }
+
+ $fileTime = filemtime($path);
+ if ($fileTime !== false) {
+ $lastModificationDateTime ??= (new DateTimeImmutable())->setTimestamp($fileTime);
+ }
+
+ $this->addFileFromCallback(
+ fileName: $fileName,
+ callback: function () use ($path) {
+
+ $stream = fopen($path, 'rb');
+
+ if (!$stream) {
+ // @codeCoverageIgnoreStart
+ throw new ResourceActionException('fopen');
+ // @codeCoverageIgnoreEnd
+ }
+
+ return $stream;
+ },
+ comment: $comment,
+ compressionMethod: $compressionMethod,
+ deflateLevel: $deflateLevel,
+ lastModificationDateTime: $lastModificationDateTime,
+ maxSize: $maxSize,
+ exactSize: $exactSize,
+ enableZeroHeader: $enableZeroHeader,
+ );
+ }
+
+ /**
+ * Add an open stream (resource) to the archive.
+ *
+ * ##### File Options
+ *
+ * See {@see addFileFromPsr7Stream()}
+ *
+ * ##### Examples
+ *
+ * ```php
+ * // create a temporary file stream and write text to it
+ * $filePointer = tmpfile();
+ * fwrite($filePointer, 'The quick brown fox jumped over the lazy dog.');
+ *
+ * // add a file named 'streamfile.txt' from the content of the stream
+ * $archive->addFileFromStream(
+ * fileName: 'streamfile.txt',
+ * stream: $filePointer,
+ * );
+ * ```
+ *
+ * @param resource $stream contents of file as a stream resource
+ */
+ public function addFileFromStream(
+ string $fileName,
+ $stream,
+ string $comment = '',
+ ?CompressionMethod $compressionMethod = null,
+ ?int $deflateLevel = null,
+ ?DateTimeInterface $lastModificationDateTime = null,
+ ?int $maxSize = null,
+ ?int $exactSize = null,
+ ?bool $enableZeroHeader = null,
+ ): void {
+ $this->addFileFromCallback(
+ fileName: $fileName,
+ callback: fn() => $stream,
+ comment: $comment,
+ compressionMethod: $compressionMethod,
+ deflateLevel: $deflateLevel,
+ lastModificationDateTime: $lastModificationDateTime,
+ maxSize: $maxSize,
+ exactSize: $exactSize,
+ enableZeroHeader: $enableZeroHeader,
+ );
+ }
+
+ /**
+ * Add an open stream to the archive.
+ *
+ * ##### Examples
+ *
+ * ```php
+ * $stream = $response->getBody();
+ * // add a file named 'streamfile.txt' from the content of the stream
+ * $archive->addFileFromPsr7Stream(
+ * fileName: 'streamfile.txt',
+ * stream: $stream,
+ * );
+ * ```
+ *
+ * @param string $fileName
+ * path of file in archive (including directory)
+ *
+ * @param StreamInterface $stream
+ * contents of file as a stream resource
+ *
+ * @param string $comment
+ * ZIP comment for this file
+ *
+ * @param ?CompressionMethod $compressionMethod
+ * Override `defaultCompressionMethod`
+ *
+ * See {@see __construct()}
+ *
+ * @param ?int $deflateLevel
+ * Override `defaultDeflateLevel`
+ *
+ * See {@see __construct()}
+ *
+ * @param ?DateTimeInterface $lastModificationDateTime
+ * Set last modification time of file.
+ *
+ * Default: `now`
+ *
+ * @param ?int $maxSize
+ * Only read `maxSize` bytes from file.
+ *
+ * The file is considered done when either reaching `EOF`
+ * or the `maxSize`.
+ *
+ * @param ?int $exactSize
+ * Read exactly `exactSize` bytes from file.
+ * If `EOF` is reached before reading `exactSize` bytes, an error will be
+ * thrown. The parameter allows for faster size calculations if the `stream`
+ * does not support `fstat` size or is slow and otherwise known beforehand.
+ *
+ * @param ?bool $enableZeroHeader
+ * Override `defaultEnableZeroHeader`
+ *
+ * See {@see __construct()}
+ */
+ public function addFileFromPsr7Stream(
+ string $fileName,
+ StreamInterface $stream,
+ string $comment = '',
+ ?CompressionMethod $compressionMethod = null,
+ ?int $deflateLevel = null,
+ ?DateTimeInterface $lastModificationDateTime = null,
+ ?int $maxSize = null,
+ ?int $exactSize = null,
+ ?bool $enableZeroHeader = null,
+ ): void {
+ $this->addFileFromCallback(
+ fileName: $fileName,
+ callback: fn() => $stream,
+ comment: $comment,
+ compressionMethod: $compressionMethod,
+ deflateLevel: $deflateLevel,
+ lastModificationDateTime: $lastModificationDateTime,
+ maxSize: $maxSize,
+ exactSize: $exactSize,
+ enableZeroHeader: $enableZeroHeader,
+ );
+ }
+
+ /**
+ * Add a file based on a callback.
+ *
+ * This is useful when you want to simulate a lot of files without keeping
+ * all of the file handles open at the same time.
+ *
+ * ##### Examples
+ *
+ * ```php
+ * foreach($files as $name => $size) {
+ * $archive->addFileFromCallback(
+ * fileName: 'streamfile.txt',
+ * exactSize: $size,
+ * callback: function() use($name): Psr\Http\Message\StreamInterface {
+ * $response = download($name);
+ * return $response->getBody();
+ * }
+ * );
+ * }
+ * ```
+ *
+ * @param string $fileName
+ * path of file in archive (including directory)
+ *
+ * @param Closure $callback
+ * @psalm-param Closure(): (resource|StreamInterface|string) $callback
+ * A callback to get the file contents in the shape of a PHP stream,
+ * a Psr StreamInterface implementation, or a string.
+ *
+ * @param string $comment
+ * ZIP comment for this file
+ *
+ * @param ?CompressionMethod $compressionMethod
+ * Override `defaultCompressionMethod`
+ *
+ * See {@see __construct()}
+ *
+ * @param ?int $deflateLevel
+ * Override `defaultDeflateLevel`
+ *
+ * See {@see __construct()}
+ *
+ * @param ?DateTimeInterface $lastModificationDateTime
+ * Set last modification time of file.
+ *
+ * Default: `now`
+ *
+ * @param ?int $maxSize
+ * Only read `maxSize` bytes from file.
+ *
+ * The file is considered done when either reaching `EOF`
+ * or the `maxSize`.
+ *
+ * @param ?int $exactSize
+ * Read exactly `exactSize` bytes from file.
+ * If `EOF` is reached before reading `exactSize` bytes, an error will be
+ * thrown. The parameter allows for faster size calculations if the `stream`
+ * does not support `fstat` size or is slow and otherwise known beforehand.
+ *
+ * @param ?bool $enableZeroHeader
+ * Override `defaultEnableZeroHeader`
+ *
+ * See {@see __construct()}
+ */
+ public function addFileFromCallback(
+ string $fileName,
+ Closure $callback,
+ string $comment = '',
+ ?CompressionMethod $compressionMethod = null,
+ ?int $deflateLevel = null,
+ ?DateTimeInterface $lastModificationDateTime = null,
+ ?int $maxSize = null,
+ ?int $exactSize = null,
+ ?bool $enableZeroHeader = null,
+ ): void {
+ $file = new File(
+ dataCallback: function () use ($callback, $maxSize) {
+ $data = $callback();
+
+ if (is_resource($data)) {
+ return $data;
+ }
+
+ if ($data instanceof StreamInterface) {
+ return StreamWrapper::getResource($data);
+ }
+
+
+ $stream = fopen('php://memory', 'rw+');
+ if ($stream === false) {
+ // @codeCoverageIgnoreStart
+ throw new ResourceActionException('fopen');
+ // @codeCoverageIgnoreEnd
+ }
+ if ($maxSize !== null && fwrite($stream, $data, $maxSize) === false) {
+ // @codeCoverageIgnoreStart
+ throw new ResourceActionException('fwrite', $stream);
+ // @codeCoverageIgnoreEnd
+ } elseif (fwrite($stream, $data) === false) {
+ // @codeCoverageIgnoreStart
+ throw new ResourceActionException('fwrite', $stream);
+ // @codeCoverageIgnoreEnd
+ }
+ if (rewind($stream) === false) {
+ // @codeCoverageIgnoreStart
+ throw new ResourceActionException('rewind', $stream);
+ // @codeCoverageIgnoreEnd
+ }
+
+ return $stream;
+
+ },
+ send: $this->send(...),
+ recordSentBytes: $this->recordSentBytes(...),
+ operationMode: $this->operationMode,
+ fileName: $fileName,
+ startOffset: $this->offset,
+ compressionMethod: $compressionMethod ?? $this->defaultCompressionMethod,
+ comment: $comment,
+ deflateLevel: $deflateLevel ?? $this->defaultDeflateLevel,
+ lastModificationDateTime: $lastModificationDateTime ?? new DateTimeImmutable(),
+ maxSize: $maxSize,
+ exactSize: $exactSize,
+ enableZip64: $this->enableZip64,
+ enableZeroHeader: $enableZeroHeader ?? $this->defaultEnableZeroHeader,
+ );
+
+ if ($this->operationMode !== OperationMode::NORMAL) {
+ $this->recordedSimulation[] = $file;
+ }
+
+ $this->centralDirectoryRecords[] = $file->process();
+ }
+
+ /**
+ * Add a directory to the archive.
+ *
+ * ##### File Options
+ *
+ * See {@see addFileFromPsr7Stream()}
+ *
+ * ##### Examples
+ *
+ * ```php
+ * // add a directory named 'world/'
+ * $zip->addDirectory(fileName: 'world/');
+ * ```
+ */
+ public function addDirectory(
+ string $fileName,
+ string $comment = '',
+ ?DateTimeInterface $lastModificationDateTime = null,
+ ): void {
+ if (!str_ends_with($fileName, '/')) {
+ $fileName .= '/';
+ }
+
+ $this->addFile(
+ fileName: $fileName,
+ data: '',
+ comment: $comment,
+ compressionMethod: CompressionMethod::STORE,
+ deflateLevel: null,
+ lastModificationDateTime: $lastModificationDateTime,
+ maxSize: 0,
+ exactSize: 0,
+ enableZeroHeader: false,
+ );
+ }
+
+ /**
+ * Executes a previously calculated simulation.
+ *
+ * ##### Example
+ *
+ * ```php
+ * $zip = new ZipStream(
+ * outputName: 'foo.zip',
+ * operationMode: OperationMode::SIMULATE_STRICT,
+ * );
+ *
+ * $zip->addFile('test.txt', 'Hello World');
+ *
+ * $size = $zip->finish();
+ *
+ * header('Content-Length: '. $size);
+ *
+ * $zip->executeSimulation();
+ * ```
+ */
+ public function executeSimulation(): void
+ {
+ if ($this->operationMode !== OperationMode::NORMAL) {
+ throw new RuntimeException('Zip simulation is not finished.');
+ }
+
+ foreach ($this->recordedSimulation as $file) {
+ $this->centralDirectoryRecords[] = $file->cloneSimulationExecution()->process();
+ }
+
+ $this->finish();
+ }
+
+ /**
+ * Write zip footer to stream.
+ *
+ * The class is left in an unusable state after `finish`.
+ *
+ * ##### Example
+ *
+ * ```php
+ * // write footer to stream
+ * $zip->finish();
+ * ```
+ */
+ public function finish(): int
+ {
+ $centralDirectoryStartOffsetOnDisk = $this->offset;
+ $sizeOfCentralDirectory = 0;
+
+ // add trailing cdr file records
+ foreach ($this->centralDirectoryRecords as $centralDirectoryRecord) {
+ $this->send($centralDirectoryRecord);
+ $sizeOfCentralDirectory += strlen($centralDirectoryRecord);
+ }
+
+ // Add 64bit headers (if applicable)
+ if (count($this->centralDirectoryRecords) >= 0xFFFF ||
+ $centralDirectoryStartOffsetOnDisk > 0xFFFFFFFF ||
+ $sizeOfCentralDirectory > 0xFFFFFFFF) {
+ if (!$this->enableZip64) {
+ throw new OverflowException();
+ }
+
+ $this->send(Zip64\EndOfCentralDirectory::generate(
+ versionMadeBy: self::ZIP_VERSION_MADE_BY,
+ versionNeededToExtract: Version::ZIP64->value,
+ numberOfThisDisk: 0,
+ numberOfTheDiskWithCentralDirectoryStart: 0,
+ numberOfCentralDirectoryEntriesOnThisDisk: count($this->centralDirectoryRecords),
+ numberOfCentralDirectoryEntries: count($this->centralDirectoryRecords),
+ sizeOfCentralDirectory: $sizeOfCentralDirectory,
+ centralDirectoryStartOffsetOnDisk: $centralDirectoryStartOffsetOnDisk,
+ extensibleDataSector: '',
+ ));
+
+ $this->send(Zip64\EndOfCentralDirectoryLocator::generate(
+ numberOfTheDiskWithZip64CentralDirectoryStart: 0x00,
+ zip64centralDirectoryStartOffsetOnDisk: $centralDirectoryStartOffsetOnDisk + $sizeOfCentralDirectory,
+ totalNumberOfDisks: 1,
+ ));
+ }
+
+ // add trailing cdr eof record
+ $numberOfCentralDirectoryEntries = min(count($this->centralDirectoryRecords), 0xFFFF);
+ $this->send(EndOfCentralDirectory::generate(
+ numberOfThisDisk: 0x00,
+ numberOfTheDiskWithCentralDirectoryStart: 0x00,
+ numberOfCentralDirectoryEntriesOnThisDisk: $numberOfCentralDirectoryEntries,
+ numberOfCentralDirectoryEntries: $numberOfCentralDirectoryEntries,
+ sizeOfCentralDirectory: min($sizeOfCentralDirectory, 0xFFFFFFFF),
+ centralDirectoryStartOffsetOnDisk: min($centralDirectoryStartOffsetOnDisk, 0xFFFFFFFF),
+ zipFileComment: $this->comment,
+ ));
+
+ $size = $this->offset;
+
+ // The End
+ $this->clear();
+
+ return $size;
+ }
+
+ /**
+ * @param StreamInterface|resource|null $outputStream
+ * @return resource
+ */
+ private static function normalizeStream($outputStream)
+ {
+ if ($outputStream instanceof StreamInterface) {
+ return StreamWrapper::getResource($outputStream);
+ }
+ if (is_resource($outputStream)) {
+ return $outputStream;
+ }
+ $resource = fopen('php://output', 'wb');
+
+ if ($resource === false) {
+ throw new RuntimeException('fopen of php://output failed');
+ }
+
+ return $resource;
+ }
+
+ /**
+ * Record sent bytes
+ */
+ private function recordSentBytes(int $sentBytes): void
+ {
+ $this->offset += $sentBytes;
+ }
+
+ /**
+ * Send string, sending HTTP headers if necessary.
+ * Flush output after write if configure option is set.
+ */
+ private function send(string $data): void
+ {
+ if (!$this->ready) {
+ throw new RuntimeException('Archive is already finished');
+ }
+
+ if ($this->operationMode === OperationMode::NORMAL && $this->sendHttpHeaders) {
+ $this->sendHttpHeaders();
+ $this->sendHttpHeaders = false;
+ }
+
+ $this->recordSentBytes(strlen($data));
+
+ if ($this->operationMode === OperationMode::NORMAL) {
+ if (fwrite($this->outputStream, $data) === false) {
+ throw new ResourceActionException('fwrite', $this->outputStream);
+ }
+
+ if ($this->flushOutput) {
+ // flush output buffer if it is on and flushable
+ $status = ob_get_status();
+ if (isset($status['flags']) && is_int($status['flags']) && ($status['flags'] & PHP_OUTPUT_HANDLER_FLUSHABLE)) {
+ ob_flush();
+ }
+
+ // Flush system buffers after flushing userspace output buffer
+ flush();
+ }
+ }
+ }
+
+ /**
+ * Send HTTP headers for this stream.
+ */
+ private function sendHttpHeaders(): void
+ {
+ // grab content disposition
+ $disposition = $this->contentDisposition;
+
+ if ($this->outputName !== null) {
+ // Various different browsers dislike various characters here. Strip them all for safety.
+ $safeOutput = trim(str_replace(['"', "'", '\\', ';', "\n", "\r"], '', $this->outputName));
+
+ // Check if we need to UTF-8 encode the filename
+ $urlencoded = rawurlencode($safeOutput);
+ $disposition .= "; filename*=UTF-8''{$urlencoded}";
+ }
+
+ $headers = [
+ 'Content-Type' => $this->contentType,
+ 'Content-Disposition' => $disposition,
+ 'Pragma' => 'public',
+ 'Cache-Control' => 'public, must-revalidate',
+ 'Content-Transfer-Encoding' => 'binary',
+ ];
+
+ foreach ($headers as $key => $val) {
+ ($this->httpHeaderCallback)("$key: $val");
+ }
+ }
+
+ /**
+ * Clear all internal variables. Note that the stream object is not
+ * usable after this.
+ */
+ private function clear(): void
+ {
+ $this->centralDirectoryRecords = [];
+ $this->offset = 0;
+
+ if ($this->operationMode === OperationMode::NORMAL) {
+ $this->ready = false;
+ $this->recordedSimulation = [];
+ } else {
+ $this->operationMode = OperationMode::NORMAL;
+ }
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/src/Zs/ExtendedInformationExtraField.php b/vendor/maennchen/zipstream-php/src/Zs/ExtendedInformationExtraField.php
new file mode 100644
index 0000000..bf621bc
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/src/Zs/ExtendedInformationExtraField.php
@@ -0,0 +1,23 @@
+fail("File {$filePath} must contain {$needle}");
+ }
+
+ protected function assertFileDoesNotContain(string $filePath, string $needle): void
+ {
+ $last = '';
+
+ $handle = fopen($filePath, 'r');
+ while (!feof($handle)) {
+ $line = fgets($handle, 1024);
+
+ if (str_contains($last . $line, $needle)) {
+ fclose($handle);
+
+ $this->fail("File {$filePath} must not contain {$needle}");
+ }
+
+ $last = $line;
+ }
+
+ fclose($handle);
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/CallbackOutputTest.php b/vendor/maennchen/zipstream-php/test/CallbackOutputTest.php
new file mode 100644
index 0000000..1f185fe
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/CallbackOutputTest.php
@@ -0,0 +1,202 @@
+addFile('hello.txt', 'Hello World');
+ $zip->finish();
+
+ $tmp = tmpfile();
+ fwrite($tmp, $buf);
+ rewind($tmp);
+
+ $meta = stream_get_meta_data($tmp);
+ $za = new ZipArchive();
+ $za->open($meta['uri']);
+
+ $content = $za->getFromName('hello.txt');
+ $za->close();
+ fclose($tmp);
+
+ $this->assertSame('Hello World', $content);
+ }
+
+ public function testMultipleSimultaneousStreams(): void
+ {
+ $buf1 = '';
+ $buf2 = '';
+
+ $stream1 = CallbackStreamWrapper::open(
+ static function (string $chunk) use (&$buf1): void { $buf1 .= $chunk; }
+ );
+ $stream2 = CallbackStreamWrapper::open(
+ static function (string $chunk) use (&$buf2): void { $buf2 .= $chunk; }
+ );
+
+ $this->assertIsResource($stream1);
+ $this->assertIsResource($stream2);
+
+ fwrite($stream1, 'data1');
+ fwrite($stream2, 'data2');
+ fclose($stream1);
+ fclose($stream2);
+
+ $this->assertSame('data1', $buf1);
+ $this->assertSame('data2', $buf2);
+ }
+
+ public function testExceptionHandlingInCallback(): void
+ {
+ $stream = CallbackStreamWrapper::open(
+ static function (string $chunk): void {
+ throw new RuntimeException('Callback error');
+ }
+ );
+
+ $this->expectException(RuntimeException::class);
+ $this->expectExceptionMessage('Callback function failed during stream write: Callback error');
+
+ fwrite($stream, 'test data');
+ }
+
+ public function testLargeDataChunks(): void
+ {
+ $receivedChunks = [];
+ $totalBytes = 0;
+
+ $stream = CallbackStreamWrapper::open(
+ static function (string $chunk) use (&$receivedChunks, &$totalBytes): void {
+ $receivedChunks[] = strlen($chunk);
+ $totalBytes += strlen($chunk);
+ }
+ );
+
+ // Write large chunks of data
+ $largeData = str_repeat('x', 65536); // 64KB
+ fwrite($stream, $largeData);
+ fwrite($stream, $largeData);
+ fclose($stream);
+
+ $this->assertSame(131072, $totalBytes); // 128KB total
+ $this->assertNotEmpty($receivedChunks);
+ // Large data should be written (possibly in multiple chunks)
+ $this->assertGreaterThan(0, max($receivedChunks));
+ }
+
+ public function testStreamPositionTracking(): void
+ {
+ $stream = CallbackStreamWrapper::open(
+ static function (string $chunk): void { /* no-op */ }
+ );
+
+ $this->assertSame(0, ftell($stream));
+
+ fwrite($stream, 'hello');
+ $this->assertSame(5, ftell($stream));
+
+ fwrite($stream, ' world');
+ $this->assertSame(11, ftell($stream));
+
+ fclose($stream);
+ }
+
+ public function testInvalidModeRejection(): void
+ {
+ $stream = CallbackStreamWrapper::open(
+ static function (string $chunk): void { /* no-op */ }
+ );
+
+ // Close the stream first
+ fclose($stream);
+
+ // Try to open with read mode - should fail
+ $readStream = fopen('zipcb://invalid', 'rb');
+ $this->assertFalse($readStream);
+ }
+
+ public function testStreamStatistics(): void
+ {
+ $stream = CallbackStreamWrapper::open(
+ static function (string $chunk): void { /* no-op */ }
+ );
+
+ fwrite($stream, 'test data');
+
+ $stats = fstat($stream);
+ $this->assertIsArray($stats);
+ $this->assertSame(9, $stats['size']); // Length of 'test data'
+ $this->assertSame(0o100666, $stats['mode']); // Regular file permissions
+
+ fclose($stream);
+ }
+
+ public function testProgressTracking(): void
+ {
+ $progress = [];
+ $totalBytes = 0;
+
+ $zip = new ZipStream(
+ outputStream: CallbackStreamWrapper::open(
+ static function (string $chunk) use (&$progress, &$totalBytes): void {
+ $totalBytes += strlen($chunk);
+ $progress[] = $totalBytes;
+ }
+ ),
+ sendHttpHeaders: false
+ );
+
+ $zip->addFile('file1.txt', 'Content 1');
+ $zip->addFile('file2.txt', 'Content 2');
+ $zip->finish();
+
+ $this->assertNotEmpty($progress);
+ $this->assertGreaterThan(0, $totalBytes);
+ $this->assertTrue(count($progress) > 1, 'Should have multiple progress updates');
+ }
+
+ public function testCallbackCleanupOnClose(): void
+ {
+ $callbackExecuted = false;
+
+ $stream = CallbackStreamWrapper::open(
+ static function (string $chunk) use (&$callbackExecuted): void {
+ $callbackExecuted = true;
+ }
+ );
+
+ fwrite($stream, 'test');
+ $this->assertTrue($callbackExecuted);
+
+ fclose($stream);
+
+ // After closing, callback should be cleaned up
+ // We can't directly test this, but the tearDown cleanup should work without issues
+ $this->assertTrue(true); // Placeholder assertion
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/CentralDirectoryFileHeaderTest.php b/vendor/maennchen/zipstream-php/test/CentralDirectoryFileHeaderTest.php
new file mode 100644
index 0000000..5457b4f
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/CentralDirectoryFileHeaderTest.php
@@ -0,0 +1,60 @@
+assertSame(
+ bin2hex($header),
+ '504b0102' . // 4 bytes; central file header signature
+ '0306' . // 2 bytes; version made by
+ '2d00' . // 2 bytes; version needed to extract
+ '2222' . // 2 bytes; general purpose bit flag
+ '0800' . // 2 bytes; compression method
+ '2008' . // 2 bytes; last mod file time
+ '2154' . // 2 bytes; last mod file date
+ '11111111' . // 4 bytes; crc-32
+ '77777777' . // 4 bytes; compressed size
+ '99999999' . // 4 bytes; uncompressed size
+ '0800' . // 2 bytes; file name length (n)
+ '0c00' . // 2 bytes; extra field length (m)
+ '0c00' . // 2 bytes; file comment length (o)
+ '0000' . // 2 bytes; disk number start
+ '0000' . // 2 bytes; internal file attributes
+ '20000000' . // 4 bytes; external file attributes
+ '34120000' . // 4 bytes; relative offset of local header
+ '746573742e706e67' . // n bytes; file name
+ '736f6d6520636f6e74656e74' . // m bytes; extra field
+ '736f6d6520636f6d6d656e74' // o bytes; file comment
+ );
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/DataDescriptorTest.php b/vendor/maennchen/zipstream-php/test/DataDescriptorTest.php
new file mode 100644
index 0000000..cc886c7
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/DataDescriptorTest.php
@@ -0,0 +1,26 @@
+assertSame(
+ bin2hex(DataDescriptor::generate(
+ crc32UncompressedData: 0x11111111,
+ compressedSize: 0x77777777,
+ uncompressedSize: 0x99999999,
+ )),
+ '504b0708' . // 4 bytes; Optional data descriptor signature = 0x08074b50
+ '11111111' . // 4 bytes; CRC-32 of uncompressed data
+ '77777777' . // 4 bytes; Compressed size
+ '99999999' // 4 bytes; Uncompressed size
+ );
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/EndOfCentralDirectoryTest.php b/vendor/maennchen/zipstream-php/test/EndOfCentralDirectoryTest.php
new file mode 100644
index 0000000..be0a907
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/EndOfCentralDirectoryTest.php
@@ -0,0 +1,35 @@
+assertSame(
+ bin2hex(EndOfCentralDirectory::generate(
+ numberOfThisDisk: 0x00,
+ numberOfTheDiskWithCentralDirectoryStart: 0x00,
+ numberOfCentralDirectoryEntriesOnThisDisk: 0x10,
+ numberOfCentralDirectoryEntries: 0x10,
+ sizeOfCentralDirectory: 0x22,
+ centralDirectoryStartOffsetOnDisk: 0x33,
+ zipFileComment: 'foo',
+ )),
+ '504b0506' . // 4 bytes; end of central dir signature 0x06054b50
+ '0000' . // 2 bytes; number of this disk
+ '0000' . // 2 bytes; number of the disk with the start of the central directory
+ '1000' . // 2 bytes; total number of entries in the central directory on this disk
+ '1000' . // 2 bytes; total number of entries in the central directory
+ '22000000' . // 4 bytes; size of the central directory
+ '33000000' . // 4 bytes; offset of start of central directory with respect to the starting disk number
+ '0300' . // 2 bytes; .ZIP file comment length
+ bin2hex('foo')
+ );
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/EndlessCycleStream.php b/vendor/maennchen/zipstream-php/test/EndlessCycleStream.php
new file mode 100644
index 0000000..d9e7df1
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/EndlessCycleStream.php
@@ -0,0 +1,104 @@
+detach();
+ }
+
+ /**
+ * @return null
+ */
+ public function detach()
+ {
+ return;
+ }
+
+ public function getSize(): ?int
+ {
+ return null;
+ }
+
+ public function tell(): int
+ {
+ return $this->offset;
+ }
+
+ public function eof(): bool
+ {
+ return false;
+ }
+
+ public function isSeekable(): bool
+ {
+ return true;
+ }
+
+ public function seek(int $offset, int $whence = SEEK_SET): void
+ {
+ switch ($whence) {
+ case SEEK_SET:
+ $this->offset = $offset;
+ break;
+ case SEEK_CUR:
+ $this->offset += $offset;
+ break;
+ case SEEK_END:
+ throw new RuntimeException('Infinite Stream!');
+ break;
+ }
+ }
+
+ public function rewind(): void
+ {
+ $this->seek(0);
+ }
+
+ public function isWritable(): bool
+ {
+ return false;
+ }
+
+ public function write(string $string): int
+ {
+ throw new RuntimeException('Not writeable');
+ }
+
+ public function isReadable(): bool
+ {
+ return true;
+ }
+
+ public function read(int $length): string
+ {
+ $this->offset += $length;
+ return substr(str_repeat($this->toRepeat, (int) ceil($length / strlen($this->toRepeat))), 0, $length);
+ }
+
+ public function getContents(): string
+ {
+ throw new RuntimeException('Infinite Stream!');
+ }
+
+ public function getMetadata(?string $key = null): array|null
+ {
+ return $key !== null ? null : [];
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/FaultInjectionResource.php b/vendor/maennchen/zipstream-php/test/FaultInjectionResource.php
new file mode 100644
index 0000000..af9305b
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/FaultInjectionResource.php
@@ -0,0 +1,141 @@
+context);
+
+ if (!isset($options[self::NAME]['injectFaults'])) {
+ return false;
+ }
+
+ $this->mode = $mode;
+ $this->injectFaults = $options[self::NAME]['injectFaults'];
+
+ if ($this->shouldFail(__FUNCTION__)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public function stream_write(string $data)
+ {
+ if ($this->shouldFail(__FUNCTION__)) {
+ return false;
+ }
+ return true;
+ }
+
+ public function stream_eof()
+ {
+ return true;
+ }
+
+ public function stream_seek(int $offset, int $whence): bool
+ {
+ if ($this->shouldFail(__FUNCTION__)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public function stream_tell(): int
+ {
+ if ($this->shouldFail(__FUNCTION__)) {
+ return false;
+ }
+
+ return 0;
+ }
+
+ public static function register(): void
+ {
+ if (!in_array(self::NAME, stream_get_wrappers(), true)) {
+ stream_wrapper_register(self::NAME, __CLASS__);
+ }
+ }
+
+ public function stream_stat(): array
+ {
+ static $modeMap = [
+ 'r' => 33060,
+ 'rb' => 33060,
+ 'r+' => 33206,
+ 'w' => 33188,
+ 'wb' => 33188,
+ ];
+
+ return [
+ 'dev' => 0,
+ 'ino' => 0,
+ 'mode' => $modeMap[$this->mode],
+ 'nlink' => 0,
+ 'uid' => 0,
+ 'gid' => 0,
+ 'rdev' => 0,
+ 'size' => 0,
+ 'atime' => 0,
+ 'mtime' => 0,
+ 'ctime' => 0,
+ 'blksize' => 0,
+ 'blocks' => 0,
+ ];
+ }
+
+ public function url_stat(string $path, int $flags): array
+ {
+ return [
+ 'dev' => 0,
+ 'ino' => 0,
+ 'mode' => 0,
+ 'nlink' => 0,
+ 'uid' => 0,
+ 'gid' => 0,
+ 'rdev' => 0,
+ 'size' => 0,
+ 'atime' => 0,
+ 'mtime' => 0,
+ 'ctime' => 0,
+ 'blksize' => 0,
+ 'blocks' => 0,
+ ];
+ }
+
+ private static function createStreamContext(array $injectFaults)
+ {
+ return stream_context_create([
+ self::NAME => ['injectFaults' => $injectFaults],
+ ]);
+ }
+
+ private function shouldFail(string $function): bool
+ {
+ return in_array($function, $this->injectFaults, true);
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/LocalFileHeaderTest.php b/vendor/maennchen/zipstream-php/test/LocalFileHeaderTest.php
new file mode 100644
index 0000000..196dd0f
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/LocalFileHeaderTest.php
@@ -0,0 +1,47 @@
+assertSame(
+ bin2hex((string) $header),
+ '504b0304' . // 4 bytes; Local file header signature
+ '2d00' . // 2 bytes; Version needed to extract (minimum)
+ '2222' . // 2 bytes; General purpose bit flag
+ '0800' . // 2 bytes; Compression method; e.g. none = 0, DEFLATE = 8
+ '2008' . // 2 bytes; File last modification time
+ '2154' . // 2 bytes; File last modification date
+ '11111111' . // 4 bytes; CRC-32 of uncompressed data
+ '77777777' . // 4 bytes; Compressed size (or 0xffffffff for ZIP64)
+ '99999999' . // 4 bytes; Uncompressed size (or 0xffffffff for ZIP64)
+ '0800' . // 2 bytes; File name length (n)
+ '0c00' . // 2 bytes; Extra field length (m)
+ '746573742e706e67' . // n bytes; File name
+ '736f6d6520636f6e74656e74' // m bytes; Extra field
+ );
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/PackFieldTest.php b/vendor/maennchen/zipstream-php/test/PackFieldTest.php
new file mode 100644
index 0000000..ecd66ba
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/PackFieldTest.php
@@ -0,0 +1,42 @@
+assertSame(
+ bin2hex(PackField::pack(new PackField(format: 'v', value: 0x1122))),
+ '2211',
+ );
+ }
+
+ public function testOverflow2(): void
+ {
+ $this->expectException(RuntimeException::class);
+
+ PackField::pack(new PackField(format: 'v', value: 0xFFFFF));
+ }
+
+ public function testOverflow4(): void
+ {
+ $this->expectException(RuntimeException::class);
+
+ PackField::pack(new PackField(format: 'V', value: 0xFFFFFFFFF));
+ }
+
+ public function testUnknownOperator(): void
+ {
+ $this->assertSame(
+ bin2hex(PackField::pack(new PackField(format: 'a', value: 0x1122))),
+ '34',
+ );
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/ResourceStream.php b/vendor/maennchen/zipstream-php/test/ResourceStream.php
new file mode 100644
index 0000000..752a1a3
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/ResourceStream.php
@@ -0,0 +1,159 @@
+isSeekable()) {
+ $this->seek(0);
+ }
+ return (string) stream_get_contents($this->stream);
+ }
+
+ public function close(): void
+ {
+ $stream = $this->detach();
+ if ($stream) {
+ fclose($stream);
+ }
+ }
+
+ public function detach()
+ {
+ $result = $this->stream;
+ // According to the interface, the stream is left in an unusable state;
+ /** @psalm-suppress PossiblyNullPropertyAssignmentValue */
+ $this->stream = null;
+ return $result;
+ }
+
+ public function seek(int $offset, int $whence = SEEK_SET): void
+ {
+ if (!$this->isSeekable()) {
+ throw new RuntimeException();
+ }
+ if (fseek($this->stream, $offset, $whence) !== 0) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException();
+ // @codeCoverageIgnoreEnd
+ }
+ }
+
+ public function isSeekable(): bool
+ {
+ return (bool) $this->getMetadata('seekable');
+ }
+
+ public function getMetadata(?string $key = null)
+ {
+ $metadata = stream_get_meta_data($this->stream);
+ return $key !== null ? @$metadata[$key] : $metadata;
+ }
+
+ public function getSize(): ?int
+ {
+ $stats = fstat($this->stream);
+ return $stats['size'];
+ }
+
+ public function tell(): int
+ {
+ $position = ftell($this->stream);
+ if ($position === false) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException();
+ // @codeCoverageIgnoreEnd
+ }
+ return $position;
+ }
+
+ public function eof(): bool
+ {
+ return feof($this->stream);
+ }
+
+ public function rewind(): void
+ {
+ $this->seek(0);
+ }
+
+ public function write(string $string): int
+ {
+ if (!$this->isWritable()) {
+ throw new RuntimeException();
+ }
+ if (fwrite($this->stream, $string) === false) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException();
+ // @codeCoverageIgnoreEnd
+ }
+ return strlen($string);
+ }
+
+ public function isWritable(): bool
+ {
+ $mode = $this->getMetadata('mode');
+ if (!is_string($mode)) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException('Could not get stream mode from metadata!');
+ // @codeCoverageIgnoreEnd
+ }
+ return preg_match('/[waxc+]/', $mode) === 1;
+ }
+
+ public function read(int $length): string
+ {
+ if (!$this->isReadable()) {
+ throw new RuntimeException();
+ }
+ $result = fread($this->stream, $length);
+ if ($result === false) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException();
+ // @codeCoverageIgnoreEnd
+ }
+ return $result;
+ }
+
+ public function isReadable(): bool
+ {
+ $mode = $this->getMetadata('mode');
+ if (!is_string($mode)) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException('Could not get stream mode from metadata!');
+ // @codeCoverageIgnoreEnd
+ }
+ return preg_match('/[r+]/', $mode) === 1;
+ }
+
+ public function getContents(): string
+ {
+ if (!$this->isReadable()) {
+ throw new RuntimeException();
+ }
+ $result = stream_get_contents($this->stream);
+ if ($result === false) {
+ // @codeCoverageIgnoreStart
+ throw new RuntimeException();
+ // @codeCoverageIgnoreEnd
+ }
+ return $result;
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/Tempfile.php b/vendor/maennchen/zipstream-php/test/Tempfile.php
new file mode 100644
index 0000000..7ef9c61
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/Tempfile.php
@@ -0,0 +1,42 @@
+getTmpFileStream();
+
+ $this->tempfile = $tempfile;
+ $this->tempfileStream = $tempfileStream;
+ }
+
+ protected function tearDown(): void
+ {
+ unlink($this->tempfile);
+ if (is_resource($this->tempfileStream)) {
+ fclose($this->tempfileStream);
+ }
+
+ $this->tempfile = null;
+ $this->tempfileStream = null;
+ }
+
+ protected function getTmpFileStream(): array
+ {
+ $tmp = tempnam(sys_get_temp_dir(), 'zipstreamtest');
+ $stream = fopen($tmp, 'wb+');
+
+ return [$tmp, $stream];
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/TimeTest.php b/vendor/maennchen/zipstream-php/test/TimeTest.php
new file mode 100644
index 0000000..61cfe03
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/TimeTest.php
@@ -0,0 +1,44 @@
+assertSame(
+ Time::dateTimeToDosTime(new DateTimeImmutable('2014-11-17T17:46:08Z')),
+ 1165069764
+ );
+
+ // January 1 1980 - DOS Epoch.
+ $this->assertSame(
+ Time::dateTimeToDosTime(new DateTimeImmutable('1980-01-01T00:00:00+00:00')),
+ 2162688
+ );
+
+ // Local timezone different than UTC.
+ $prevLocalTimezone = date_default_timezone_get();
+ date_default_timezone_set('Europe/Berlin');
+ $this->assertSame(
+ Time::dateTimeToDosTime(new DateTimeImmutable('1980-01-01T00:00:00+00:00')),
+ 2162688
+ );
+ date_default_timezone_set($prevLocalTimezone);
+ }
+
+ public function testTooEarlyDateToDosTime(): void
+ {
+ $this->expectException(DosTimeOverflowException::class);
+
+ // January 1 1980 is the minimum DOS Epoch.
+ Time::dateTimeToDosTime(new DateTimeImmutable('1970-01-01T00:00:00+00:00'));
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/Util.php b/vendor/maennchen/zipstream-php/test/Util.php
new file mode 100644
index 0000000..86592b4
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/Util.php
@@ -0,0 +1,127 @@
+cmdExists('hexdump')) {
+ return '';
+ }
+
+ $output = [];
+
+ if (!exec("hexdump -C \"$path\" | head -n 50", $output)) {
+ return '';
+ }
+
+ return "\nHexdump:\n" . implode("\n", $output);
+ }
+
+ protected function validateAndExtractZip(string $zipPath): string
+ {
+ $tmpDir = $this->getTmpDir();
+
+ $zipArchive = new ZipArchive();
+ $result = $zipArchive->open($zipPath);
+
+ if ($result !== true) {
+ $codeName = $this->zipArchiveOpenErrorCodeName($result);
+ $debugInformation = $this->dumpZipContents($zipPath);
+
+ $this->fail("Failed to open {$zipPath}. Code: $result ($codeName)$debugInformation");
+
+ return $tmpDir;
+ }
+
+ $this->assertSame(0, $zipArchive->status);
+ $this->assertSame(0, $zipArchive->statusSys);
+
+ $zipArchive->extractTo($tmpDir);
+ $zipArchive->close();
+
+ return $tmpDir;
+ }
+
+ protected function zipArchiveOpenErrorCodeName(int $code): string
+ {
+ switch ($code) {
+ case ZipArchive::ER_EXISTS: return 'ER_EXISTS';
+ case ZipArchive::ER_INCONS: return 'ER_INCONS';
+ case ZipArchive::ER_INVAL: return 'ER_INVAL';
+ case ZipArchive::ER_MEMORY: return 'ER_MEMORY';
+ case ZipArchive::ER_NOENT: return 'ER_NOENT';
+ case ZipArchive::ER_NOZIP: return 'ER_NOZIP';
+ case ZipArchive::ER_OPEN: return 'ER_OPEN';
+ case ZipArchive::ER_READ: return 'ER_READ';
+ case ZipArchive::ER_SEEK: return 'ER_SEEK';
+ default: return 'unknown';
+ }
+ }
+
+ protected function getTmpDir(): string
+ {
+ $tmp = tempnam(sys_get_temp_dir(), 'zipstreamtest');
+ unlink($tmp);
+ mkdir($tmp) or $this->fail('Failed to make directory');
+
+ return $tmp;
+ }
+
+ /**
+ * @return string[]
+ */
+ protected function getRecursiveFileList(string $path, bool $includeDirectories = false): array
+ {
+ $data = [];
+ $path = (string) realpath($path);
+ $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
+
+ $pathLen = strlen($path);
+ foreach ($files as $file) {
+ $filePath = $file->getRealPath();
+
+ if (is_dir($filePath) && !$includeDirectories) {
+ continue;
+ }
+
+ $data[] = substr($filePath, $pathLen + 1);
+ }
+
+ sort($data);
+
+ return $data;
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/Zip64/DataDescriptorTest.php b/vendor/maennchen/zipstream-php/test/Zip64/DataDescriptorTest.php
new file mode 100644
index 0000000..49fb2cc
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/Zip64/DataDescriptorTest.php
@@ -0,0 +1,28 @@
+assertSame(
+ bin2hex($descriptor),
+ '504b0708' . // 4 bytes; Optional data descriptor signature = 0x08074b50
+ '11111111' . // 4 bytes; CRC-32 of uncompressed data
+ '6666666677777777' . // 8 bytes; Compressed size
+ '8888888899999999' // 8 bytes; Uncompressed size
+ );
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryLocatorTest.php b/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryLocatorTest.php
new file mode 100644
index 0000000..271a298
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryLocatorTest.php
@@ -0,0 +1,28 @@
+assertSame(
+ bin2hex($descriptor),
+ '504b0607' . // 4 bytes; zip64 end of central dir locator signature - 0x07064b50
+ '11111111' . // 4 bytes; number of the disk with the start of the zip64 end of central directory
+ '3333333322222222' . // 28 bytes; relative offset of the zip64 end of central directory record
+ '44444444' // 4 bytes;total number of disks
+ );
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryTest.php b/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryTest.php
new file mode 100644
index 0000000..b86fb17
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/Zip64/EndOfCentralDirectoryTest.php
@@ -0,0 +1,41 @@
+assertSame(
+ bin2hex($descriptor),
+ '504b0606' . // 4 bytes;zip64 end of central dir signature - 0x06064b50
+ '2f00000000000000' . // 8 bytes; size of zip64 end of central directory record
+ '3333' . // 2 bytes; version made by
+ '4444' . // 2 bytes; version needed to extract
+ '55555555' . // 4 bytes; number of this disk
+ '66666666' . // 4 bytes; number of the disk with the start of the central directory
+ '8888888877777777' . // 8 bytes; total number of entries in the central directory on this disk
+ 'aaaaaaaa99999999' . // 8 bytes; total number of entries in the central directory
+ 'ccccccccbbbbbbbb' . // 8 bytes; size of the central directory
+ 'eeeeeeeedddddddd' . // 8 bytes; offset of start of central directory with respect to the starting disk number
+ bin2hex('foo')
+ );
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/Zip64/ExtendedInformationExtraFieldTest.php b/vendor/maennchen/zipstream-php/test/Zip64/ExtendedInformationExtraFieldTest.php
new file mode 100644
index 0000000..904783d
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/Zip64/ExtendedInformationExtraFieldTest.php
@@ -0,0 +1,42 @@
+assertSame(
+ bin2hex($extraField),
+ '0100' . // 2 bytes; Tag for this "extra" block type
+ '1c00' . // 2 bytes; Size of this "extra" block
+ '6666666677777777' . // 8 bytes; Original uncompressed file size
+ '8888888899999999' . // 8 bytes; Size of compressed data
+ '1111111122222222' . // 8 bytes; Offset of local header record
+ '33333333' // 4 bytes; Number of the disk on which this file starts
+ );
+ }
+
+ public function testSerializesEmptyCorrectly(): void
+ {
+ $extraField = ExtendedInformationExtraField::generate();
+
+ $this->assertSame(
+ bin2hex($extraField),
+ '0100' . // 2 bytes; Tag for this "extra" block type
+ '0000' // 2 bytes; Size of this "extra" block
+ );
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/ZipStreamTest.php b/vendor/maennchen/zipstream-php/test/ZipStreamTest.php
new file mode 100644
index 0000000..f4ead1d
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/ZipStreamTest.php
@@ -0,0 +1,1216 @@
+tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+ $zip->addFile('test/sample.txt', 'More Simple Sample Data');
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt', 'test' . DIRECTORY_SEPARATOR . 'sample.txt'], $files);
+
+ $this->assertStringEqualsFile($tmpDir . '/sample.txt', 'Sample String Data');
+ $this->assertStringEqualsFile($tmpDir . '/test/sample.txt', 'More Simple Sample Data');
+ }
+
+ public function testAddFileUtf8NameComment(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ $name = 'árvíztűrő tükörfúrógép.txt';
+ $content = 'Sample String Data';
+ $comment =
+ 'Filename has every special characters ' .
+ 'from Hungarian language in lowercase. ' .
+ 'In uppercase: ÁÍŰŐÜÖÚÓÉ';
+
+ $zip->addFile(fileName: $name, data: $content, comment: $comment);
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame([$name], $files);
+ $this->assertStringEqualsFile($tmpDir . '/' . $name, $content);
+
+ $zipArchive = new ZipArchive();
+ $zipArchive->open($this->tempfile);
+ $this->assertSame($comment, $zipArchive->getCommentName($name));
+ }
+
+ public function testAddFileUtf8NameNonUtfComment(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ $name = 'á.txt';
+ $content = 'any';
+ $comment = mb_convert_encoding('á', 'ISO-8859-2', 'UTF-8');
+
+ // @see https://libzip.org/documentation/zip_file_get_comment.html
+ //
+ // mb_convert_encoding hasn't CP437.
+ // nearly CP850 (DOS-Latin-1)
+ $guessComment = mb_convert_encoding($comment, 'UTF-8', 'CP850');
+
+ $zip->addFile(fileName: $name, data: $content, comment: $comment);
+
+ $zip->finish();
+
+ $zipArch = new ZipArchive();
+ $zipArch->open($this->tempfile);
+ $this->assertSame($guessComment, $zipArch->getCommentName($name));
+ $this->assertSame($comment, $zipArch->getCommentName($name, ZipArchive::FL_ENC_RAW));
+ }
+
+ public function testAddFileWithStorageMethod(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile(fileName: 'sample.txt', data: 'Sample String Data', compressionMethod: CompressionMethod::STORE);
+ $zip->addFile(fileName: 'test/sample.txt', data: 'More Simple Sample Data');
+ $zip->finish();
+
+ $zipArchive = new ZipArchive();
+ $zipArchive->open($this->tempfile);
+
+ $sample1 = $zipArchive->statName('sample.txt');
+ $sample12 = $zipArchive->statName('test/sample.txt');
+ $this->assertSame($sample1['comp_method'], CompressionMethod::STORE->value);
+ $this->assertSame($sample12['comp_method'], CompressionMethod::DEFLATE->value);
+
+ $zipArchive->close();
+ }
+
+ public function testAddFileFromPath(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ [$tmpExample, $streamExample] = $this->getTmpFileStream();
+ fwrite($streamExample, 'Sample String Data');
+ fclose($streamExample);
+ $zip->addFileFromPath(fileName: 'sample.txt', path: $tmpExample);
+
+ [$tmpExample, $streamExample] = $this->getTmpFileStream();
+ fwrite($streamExample, 'More Simple Sample Data');
+ fclose($streamExample);
+ $zip->addFileFromPath(fileName: 'test/sample.txt', path: $tmpExample);
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt', 'test' . DIRECTORY_SEPARATOR . 'sample.txt'], $files);
+
+ $this->assertStringEqualsFile($tmpDir . '/sample.txt', 'Sample String Data');
+ $this->assertStringEqualsFile($tmpDir . '/test/sample.txt', 'More Simple Sample Data');
+
+ unlink($tmpExample);
+ }
+
+ public function testAddFileFromPathFileNotFoundException(): void
+ {
+ $this->expectException(FileNotFoundException::class);
+
+ // Get ZipStream Object
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ // Trigger error by adding a file which doesn't exist
+ $zip->addFileFromPath(fileName: 'foobar.php', path: '/foo/bar/foobar.php');
+ }
+
+ public function testAddFileFromPathFileNotReadableException(): void
+ {
+ $this->expectException(FileNotReadableException::class);
+
+ // create new virtual filesystem
+ $root = vfsStream::setup('vfs');
+ // create a virtual file with no permissions
+ $file = vfsStream::newFile('foo.txt', 0)->at($root)->setContent('bar');
+
+ // Get ZipStream Object
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFileFromPath('foo.txt', $file->url());
+ }
+
+ public function testAddFileFromPathWithStorageMethod(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ [$tmpExample, $streamExample] = $this->getTmpFileStream();
+ fwrite($streamExample, 'Sample String Data');
+ fclose($streamExample);
+ $zip->addFileFromPath(fileName: 'sample.txt', path: $tmpExample, compressionMethod: CompressionMethod::STORE);
+
+ [$tmpExample, $streamExample] = $this->getTmpFileStream();
+ fwrite($streamExample, 'More Simple Sample Data');
+ fclose($streamExample);
+ $zip->addFileFromPath('test/sample.txt', $tmpExample);
+
+ $zip->finish();
+
+ $zipArchive = new ZipArchive();
+ $zipArchive->open($this->tempfile);
+
+ $sample1 = $zipArchive->statName('sample.txt');
+ $this->assertSame(CompressionMethod::STORE->value, $sample1['comp_method']);
+
+ $sample2 = $zipArchive->statName('test/sample.txt');
+ $this->assertSame(CompressionMethod::DEFLATE->value, $sample2['comp_method']);
+
+ $zipArchive->close();
+ }
+
+ public function testAddLargeFileFromPath(): void
+ {
+ foreach ([CompressionMethod::DEFLATE, CompressionMethod::STORE] as $compressionMethod) {
+ foreach ([false, true] as $zeroHeader) {
+ foreach ([false, true] as $zip64) {
+ if ($zeroHeader && $compressionMethod === CompressionMethod::DEFLATE) {
+ continue;
+ }
+ $this->addLargeFileFileFromPath(
+ compressionMethod: $compressionMethod,
+ zeroHeader: $zeroHeader,
+ zip64: $zip64
+ );
+ }
+ }
+ }
+ }
+
+ public function testAddFileFromStream(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ // In this test we can't use temporary stream to feed data
+ // because zlib.deflate filter gives empty string before PHP 7
+ // it works fine with file stream
+ $streamExample = fopen(__FILE__, 'rb');
+ $zip->addFileFromStream('sample.txt', $streamExample);
+ fclose($streamExample);
+
+ $streamExample2 = fopen('php://temp', 'wb+');
+ fwrite($streamExample2, 'More Simple Sample Data');
+ rewind($streamExample2); // move the pointer back to the beginning of file.
+ $zip->addFileFromStream('test/sample.txt', $streamExample2); //, $fileOptions);
+ fclose($streamExample2);
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt', 'test' . DIRECTORY_SEPARATOR . 'sample.txt'], $files);
+
+ $this->assertStringEqualsFile(__FILE__, file_get_contents($tmpDir . '/sample.txt'));
+ $this->assertStringEqualsFile($tmpDir . '/test/sample.txt', 'More Simple Sample Data');
+ }
+
+ public function testAddFileFromStreamUnreadableInput(): void
+ {
+ $this->expectException(StreamNotReadableException::class);
+
+ [$tmpInput] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ $streamUnreadable = fopen($tmpInput, 'w');
+
+ $zip->addFileFromStream('sample.json', $streamUnreadable);
+ }
+
+ public function testAddFileFromStreamBrokenOutputWrite(): void
+ {
+ $this->expectException(ResourceActionException::class);
+
+ $outputStream = FaultInjectionResource::getResource(['stream_write']);
+
+ $zip = new ZipStream(
+ outputStream: $outputStream,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile('sample.txt', 'foobar');
+ }
+
+ public function testAddFileFromStreamBrokenInputRewind(): void
+ {
+ $this->expectException(ResourceActionException::class);
+
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ defaultEnableZeroHeader: false,
+ );
+
+ $fileStream = FaultInjectionResource::getResource(['stream_seek']);
+
+ $zip->addFileFromStream('sample.txt', $fileStream, maxSize: 0);
+ }
+
+ public function testAddFileFromStreamUnseekableInputWithoutZeroHeader(): void
+ {
+ $this->expectException(StreamNotSeekableException::class);
+
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ defaultEnableZeroHeader: false,
+ );
+
+ if (file_exists('/dev/null')) {
+ $streamUnseekable = fopen('/dev/null', 'w+');
+ } elseif (file_exists('NUL')) {
+ $streamUnseekable = fopen('NUL', 'w+');
+ } else {
+ $this->markTestSkipped('Needs file /dev/null');
+ }
+
+ $zip->addFileFromStream('sample.txt', $streamUnseekable, maxSize: 2);
+ }
+
+ public function testAddFileFromStreamUnseekableInputWithZeroHeader(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ defaultEnableZeroHeader: true,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ );
+
+ $streamUnseekable = StreamWrapper::getResource(new class ('test') extends EndlessCycleStream {
+ public function isSeekable(): bool
+ {
+ return false;
+ }
+
+ public function seek(int $offset, int $whence = SEEK_SET): void
+ {
+ throw new RuntimeException('Not seekable');
+ }
+ });
+
+ $zip->addFileFromStream('sample.txt', $streamUnseekable, maxSize: 7);
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt'], $files);
+
+ $this->assertSame(filesize($tmpDir . '/sample.txt'), 7);
+ }
+
+ public function testAddFileFromStreamWithStorageMethod(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ $streamExample = fopen('php://temp', 'wb+');
+ fwrite($streamExample, 'Sample String Data');
+ rewind($streamExample); // move the pointer back to the beginning of file.
+ $zip->addFileFromStream('sample.txt', $streamExample, compressionMethod: CompressionMethod::STORE);
+ fclose($streamExample);
+
+ $streamExample2 = fopen('php://temp', 'bw+');
+ fwrite($streamExample2, 'More Simple Sample Data');
+ rewind($streamExample2); // move the pointer back to the beginning of file.
+ $zip->addFileFromStream('test/sample.txt', $streamExample2, compressionMethod: CompressionMethod::DEFLATE);
+ fclose($streamExample2);
+
+ $zip->finish();
+
+ $zipArchive = new ZipArchive();
+ $zipArchive->open($this->tempfile);
+
+ $sample1 = $zipArchive->statName('sample.txt');
+ $this->assertSame(CompressionMethod::STORE->value, $sample1['comp_method']);
+
+ $sample2 = $zipArchive->statName('test/sample.txt');
+ $this->assertSame(CompressionMethod::DEFLATE->value, $sample2['comp_method']);
+
+ $zipArchive->close();
+ }
+
+ public function testAddFileFromPsr7Stream(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ $body = 'Sample String Data';
+ $response = new Response(200, [], $body);
+
+ $zip->addFileFromPsr7Stream('sample.json', $response->getBody());
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.json'], $files);
+ $this->assertStringEqualsFile($tmpDir . '/sample.json', $body);
+ }
+
+ #[Group('slow')]
+ public function testAddLargeFileFromPsr7Stream(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ enableZip64: true,
+ );
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0x100000000,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.json'], $files);
+ $this->assertFileIsReadable($tmpDir . '/sample.json');
+ $this->assertStringStartsWith('000000', file_get_contents(filename: $tmpDir . '/sample.json', length: 20));
+ }
+
+ public function testContinueFinishedZip(): void
+ {
+ $this->expectException(RuntimeException::class);
+
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+ $zip->finish();
+
+ $zip->addFile('sample.txt', '1234');
+ }
+
+ #[Group('slow')]
+ public function testManyFilesWithoutZip64(): void
+ {
+ $this->expectException(OverflowException::class);
+
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ enableZip64: false,
+ );
+
+ for ($i = 0; $i <= 0xFFFF; $i++) {
+ $zip->addFile('sample' . $i, '');
+ }
+
+ $zip->finish();
+ }
+
+ #[Group('slow')]
+ public function testManyFilesWithZip64(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ enableZip64: true,
+ );
+
+ for ($i = 0; $i <= 0xFFFF; $i++) {
+ $zip->addFile('sample' . $i, '');
+ }
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+
+ $this->assertSame(count($files), 0x10000);
+ }
+
+ #[Group('slow')]
+ public function testLongZipWithout64(): void
+ {
+ $this->expectException(OverflowException::class);
+
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ enableZip64: false,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ );
+
+ for ($i = 0; $i < 4; $i++) {
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample' . $i,
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0xFFFFFFFF,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+ }
+ }
+
+ #[Group('slow')]
+ public function testLongZipWith64(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ enableZip64: true,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ );
+
+ for ($i = 0; $i < 4; $i++) {
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample' . $i,
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0x5FFFFFFF,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+ }
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample0', 'sample1', 'sample2', 'sample3'], $files);
+ }
+
+ #[Group('slow')]
+ public function testAddLargeFileWithoutZip64WithZeroHeader(): void
+ {
+ $this->expectException(OverflowException::class);
+
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ enableZip64: false,
+ defaultEnableZeroHeader: true,
+ );
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0x100000000,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+ }
+
+ #[Group('slow')]
+ public function testAddsZip64HeaderWhenNeeded(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ enableZip64: true,
+ defaultEnableZeroHeader: false,
+ );
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0x100000000,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+ $files = $this->getRecursiveFileList($tmpDir);
+
+ $this->assertSame(['sample.json'], $files);
+ $this->assertFileContains($this->tempfile, PackField::pack(
+ new PackField(format: 'V', value: 0x06064b50)
+ ));
+ }
+
+ #[Group('slow')]
+ public function testDoesNotAddZip64HeaderWhenNotNeeded(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ enableZip64: true,
+ defaultEnableZeroHeader: false,
+ );
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0x10,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+ $files = $this->getRecursiveFileList($tmpDir);
+
+ $this->assertSame(['sample.json'], $files);
+ $this->assertFileDoesNotContain($this->tempfile, PackField::pack(
+ new PackField(format: 'V', value: 0x06064b50)
+ ));
+ }
+
+ #[Group('slow')]
+ public function testAddLargeFileWithoutZip64WithoutZeroHeader(): void
+ {
+ $this->expectException(OverflowException::class);
+
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ enableZip64: false,
+ defaultEnableZeroHeader: false,
+ );
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: new EndlessCycleStream('0'),
+ maxSize: 0x100000000,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+ }
+
+ public function testAddFileFromPsr7StreamWithOutputToPsr7Stream(): void
+ {
+ $psr7OutputStream = new ResourceStream($this->tempfileStream);
+
+ $zip = new ZipStream(
+ outputStream: $psr7OutputStream,
+ sendHttpHeaders: false,
+ );
+
+ $body = 'Sample String Data';
+ $response = new Response(200, [], $body);
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: $response->getBody(),
+ compressionMethod: CompressionMethod::STORE,
+ );
+ $zip->finish();
+ $psr7OutputStream->close();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+ $files = $this->getRecursiveFileList($tmpDir);
+
+ $this->assertSame(['sample.json'], $files);
+ $this->assertStringEqualsFile($tmpDir . '/sample.json', $body);
+ }
+
+ public function testAddFileFromPsr7StreamWithFileSizeSet(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ $body = 'Sample String Data';
+ $fileSize = strlen($body);
+ // Add fake padding
+ $fakePadding = "\0\0\0\0\0\0";
+ $response = new Response(200, [], $body . $fakePadding);
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'sample.json',
+ stream: $response->getBody(),
+ compressionMethod: CompressionMethod::STORE,
+ maxSize: $fileSize
+ );
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.json'], $files);
+ $this->assertStringEqualsFile($tmpDir . '/sample.json', $body);
+ }
+
+ public function testCreateArchiveHeaders(): void
+ {
+ $headers = [];
+
+ $httpHeaderCallback = function (string $header) use (&$headers) {
+ $headers[] = $header;
+ };
+
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: true,
+ outputName: 'example.zip',
+ httpHeaderCallback: $httpHeaderCallback,
+ );
+
+ $zip->addFile(
+ fileName: 'sample.json',
+ data: 'foo',
+ );
+ $zip->finish();
+
+ $this->assertContains('Content-Type: application/x-zip', $headers);
+ $this->assertContains("Content-Disposition: attachment; filename*=UTF-8''example.zip", $headers);
+ $this->assertContains('Pragma: public', $headers);
+ $this->assertContains('Cache-Control: public, must-revalidate', $headers);
+ $this->assertContains('Content-Transfer-Encoding: binary', $headers);
+ }
+
+ public function testCreateArchiveWithFlushOptionSet(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ flushOutput: true,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+ $zip->addFile('test/sample.txt', 'More Simple Sample Data');
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt', 'test' . DIRECTORY_SEPARATOR . 'sample.txt'], $files);
+
+ $this->assertStringEqualsFile($tmpDir . '/sample.txt', 'Sample String Data');
+ $this->assertStringEqualsFile($tmpDir . '/test/sample.txt', 'More Simple Sample Data');
+ }
+
+ public function testCreateArchiveWithOutputBufferingOffAndFlushOptionSet(): void
+ {
+ // WORKAROUND (1/2): remove phpunit's output buffer in order to run test without any buffering
+ ob_end_flush();
+ $this->assertSame(0, ob_get_level());
+
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ flushOutput: true,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+ $this->assertStringEqualsFile($tmpDir . '/sample.txt', 'Sample String Data');
+
+ // WORKAROUND (2/2): add back output buffering so that PHPUnit doesn't complain that it is missing
+ ob_start();
+ }
+
+ public function testAddEmptyDirectory(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addDirectory('foo');
+
+ $zip->finish();
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir, includeDirectories: true);
+
+ $this->assertContains('foo', $files);
+
+ $this->assertFileExists($tmpDir . DIRECTORY_SEPARATOR . 'foo');
+ $this->assertDirectoryExists($tmpDir . DIRECTORY_SEPARATOR . 'foo');
+ }
+
+ public function testAddFileSimulate(): void
+ {
+ $create = function (OperationMode $operationMode): int {
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: $operationMode,
+ defaultEnableZeroHeader: true,
+ outputStream: $this->tempfileStream,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+ $zip->addFile('test/sample.txt', 'More Simple Sample Data');
+
+ return $zip->finish();
+ };
+
+
+ $sizeExpected = $create(OperationMode::NORMAL);
+ $sizeActual = $create(OperationMode::SIMULATE_LAX);
+
+ $this->assertEquals($sizeExpected, $sizeActual);
+ }
+
+ public function testAddFileSimulateWithMaxSize(): void
+ {
+ $create = function (OperationMode $operationMode): int {
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: $operationMode,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ defaultEnableZeroHeader: true,
+ outputStream: $this->tempfileStream,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data', maxSize: 0);
+
+ return $zip->finish();
+ };
+
+
+ $sizeExpected = $create(OperationMode::NORMAL);
+ $sizeActual = $create(OperationMode::SIMULATE_LAX);
+
+ $this->assertEquals($sizeExpected, $sizeActual);
+ }
+
+ public function testAddFileSimulateWithFstat(): void
+ {
+ $create = function (OperationMode $operationMode): int {
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: $operationMode,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ defaultEnableZeroHeader: true,
+ outputStream: $this->tempfileStream,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+ $zip->addFile('test/sample.txt', 'More Simple Sample Data');
+
+ return $zip->finish();
+ };
+
+
+ $sizeExpected = $create(OperationMode::NORMAL);
+ $sizeActual = $create(OperationMode::SIMULATE_LAX);
+
+ $this->assertEquals($sizeExpected, $sizeActual);
+ }
+
+ public function testAddFileSimulateWithExactSizeZero(): void
+ {
+ $create = function (OperationMode $operationMode): int {
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: $operationMode,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ defaultEnableZeroHeader: true,
+ outputStream: $this->tempfileStream,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data', exactSize: 18);
+
+ return $zip->finish();
+ };
+
+
+ $sizeExpected = $create(OperationMode::NORMAL);
+ $sizeActual = $create(OperationMode::SIMULATE_LAX);
+
+ $this->assertEquals($sizeExpected, $sizeActual);
+ }
+
+ public function testAddFileSimulateWithExactSizeInitial(): void
+ {
+ $create = function (OperationMode $operationMode): int {
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: $operationMode,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ defaultEnableZeroHeader: false,
+ outputStream: $this->tempfileStream,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data', exactSize: 18);
+
+ return $zip->finish();
+ };
+
+ $sizeExpected = $create(OperationMode::NORMAL);
+ $sizeActual = $create(OperationMode::SIMULATE_LAX);
+
+ $this->assertEquals($sizeExpected, $sizeActual);
+ }
+
+ public function testAddFileSimulateWithZeroSizeInFstat(): void
+ {
+ $create = function (OperationMode $operationMode): int {
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: $operationMode,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ defaultEnableZeroHeader: false,
+ outputStream: $this->tempfileStream,
+ );
+
+ $zip->addFileFromPsr7Stream('sample.txt', new class implements StreamInterface {
+ public $pos = 0;
+
+ public function __toString(): string
+ {
+ return 'test';
+ }
+
+ public function close(): void {}
+
+ public function detach() {}
+
+ public function getSize(): ?int
+ {
+ return null;
+ }
+
+ public function tell(): int
+ {
+ return $this->pos;
+ }
+
+ public function eof(): bool
+ {
+ return $this->pos >= 4;
+ }
+
+ public function isSeekable(): bool
+ {
+ return true;
+ }
+
+ public function seek(int $offset, int $whence = SEEK_SET): void
+ {
+ $this->pos = $offset;
+ }
+
+ public function rewind(): void
+ {
+ $this->pos = 0;
+ }
+
+ public function isWritable(): bool
+ {
+ return false;
+ }
+
+ public function write(string $string): int
+ {
+ return 0;
+ }
+
+ public function isReadable(): bool
+ {
+ return true;
+ }
+
+ public function read(int $length): string
+ {
+ $data = substr('test', $this->pos, $length);
+ $this->pos += strlen($data);
+ return $data;
+ }
+
+ public function getContents(): string
+ {
+ return $this->read(4);
+ }
+
+ public function getMetadata(?string $key = null)
+ {
+ return $key !== null ? null : [];
+ }
+ });
+
+ return $zip->finish();
+ };
+
+ $sizeExpected = $create(OperationMode::NORMAL);
+ $sizeActual = $create(OperationMode::SIMULATE_LAX);
+
+
+ $this->assertEquals($sizeExpected, $sizeActual);
+ }
+
+ public function testAddFileSimulateWithWrongExactSize(): void
+ {
+ $this->expectException(FileSizeIncorrectException::class);
+
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: OperationMode::SIMULATE_LAX,
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data', exactSize: 1000);
+ }
+
+ public function testAddFileSimulateStrictZero(): void
+ {
+ $this->expectException(SimulationFileUnknownException::class);
+
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: OperationMode::SIMULATE_STRICT,
+ defaultEnableZeroHeader: true
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+ }
+
+ public function testAddFileSimulateStrictInitial(): void
+ {
+ $this->expectException(SimulationFileUnknownException::class);
+
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: OperationMode::SIMULATE_STRICT,
+ defaultEnableZeroHeader: false
+ );
+
+ $zip->addFile('sample.txt', 'Sample String Data');
+ }
+
+ public function testAddFileCallbackStrict(): void
+ {
+ $this->expectException(SimulationFileUnknownException::class);
+
+ $zip = new ZipStream(
+ sendHttpHeaders: false,
+ operationMode: OperationMode::SIMULATE_STRICT,
+ defaultEnableZeroHeader: false
+ );
+
+ $zip->addFileFromCallback('sample.txt', callback: function () {
+ return '';
+ });
+ }
+
+ public function testAddFileCallbackLax(): void
+ {
+ $zip = new ZipStream(
+ operationMode: OperationMode::SIMULATE_LAX,
+ defaultEnableZeroHeader: false,
+ sendHttpHeaders: false,
+ );
+
+ $zip->addFileFromCallback('sample.txt', callback: function () {
+ return 'Sample String Data';
+ });
+
+ $size = $zip->finish();
+
+ $this->assertEquals($size, 142);
+ }
+
+ public function testExecuteSimulation(): void
+ {
+ $zip = new ZipStream(
+ operationMode: OperationMode::SIMULATE_STRICT,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ defaultEnableZeroHeader: false,
+ sendHttpHeaders: false,
+ outputStream: $this->tempfileStream,
+ );
+
+ $zip->addFileFromCallback(
+ 'sample.txt',
+ exactSize: 18,
+ callback: function () {
+ return 'Sample String Data';
+ }
+ );
+
+ $zip->addFileFromCallback(
+ '.gitkeep',
+ exactSize: 0,
+ callback: function () {
+ return '';
+ }
+ );
+
+ $size = $zip->finish();
+
+ $this->assertEquals(filesize($this->tempfile), 0);
+
+ $zip->executeSimulation();
+
+ clearstatcache();
+
+ $this->assertEquals(filesize($this->tempfile), $size);
+
+ $tmpDir = $this->validateAndExtractZip($this->tempfile);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['.gitkeep', 'sample.txt'], $files);
+ }
+
+ public function testExecuteSimulationBeforeFinish(): void
+ {
+ $this->expectException(RuntimeException::class);
+
+ $zip = new ZipStream(
+ operationMode: OperationMode::SIMULATE_LAX,
+ defaultEnableZeroHeader: false,
+ sendHttpHeaders: false,
+ outputStream: $this->tempfileStream,
+ );
+
+ $zip->executeSimulation();
+ }
+
+ #[Group('slow')]
+ public function testSimulationWithLargeZip64AndZeroHeader(): void
+ {
+ $zip = new ZipStream(
+ outputStream: $this->tempfileStream,
+ sendHttpHeaders: false,
+ operationMode: OperationMode::SIMULATE_STRICT,
+ defaultCompressionMethod: CompressionMethod::STORE,
+ outputName: 'archive.zip',
+ enableZip64: true,
+ defaultEnableZeroHeader: true
+ );
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'large',
+ stream: new EndlessCycleStream('large'),
+ exactSize: 0x120000000, // ~5gb
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+
+ $zip->addFileFromPsr7Stream(
+ fileName: 'small',
+ stream: new EndlessCycleStream('small'),
+ exactSize: 0x20,
+ compressionMethod: CompressionMethod::STORE,
+ lastModificationDateTime: new DateTimeImmutable('2022-01-01 01:01:01Z'),
+ );
+
+ $forecastedSize = $zip->finish();
+
+ $zip->executeSimulation();
+
+ $this->assertSame($forecastedSize, filesize($this->tempfile));
+
+ $this->validateAndExtractZip($this->tempfile);
+ }
+
+ private function addLargeFileFileFromPath(CompressionMethod $compressionMethod, $zeroHeader, $zip64): void
+ {
+ [$tmp, $stream] = $this->getTmpFileStream();
+
+ $zip = new ZipStream(
+ outputStream: $stream,
+ sendHttpHeaders: false,
+ defaultEnableZeroHeader: $zeroHeader,
+ enableZip64: $zip64,
+ );
+
+ [$tmpExample, $streamExample] = $this->getTmpFileStream();
+ for ($i = 0; $i <= 10000; $i++) {
+ fwrite($streamExample, sha1((string) $i));
+ if ($i % 100 === 0) {
+ fwrite($streamExample, "\n");
+ }
+ }
+ fclose($streamExample);
+ $shaExample = sha1_file($tmpExample);
+ $zip->addFileFromPath('sample.txt', $tmpExample);
+ unlink($tmpExample);
+
+ $zip->finish();
+ fclose($stream);
+
+ $tmpDir = $this->validateAndExtractZip($tmp);
+
+ $files = $this->getRecursiveFileList($tmpDir);
+ $this->assertSame(['sample.txt'], $files);
+
+ $this->assertSame(sha1_file($tmpDir . '/sample.txt'), $shaExample, "SHA-1 Mismatch Method: {$compressionMethod->value}");
+
+ unlink($tmp);
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/Zs/ExtendedInformationExtraFieldTest.php b/vendor/maennchen/zipstream-php/test/Zs/ExtendedInformationExtraFieldTest.php
new file mode 100644
index 0000000..2b8dbed
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/Zs/ExtendedInformationExtraFieldTest.php
@@ -0,0 +1,22 @@
+assertSame(
+ bin2hex((string) $extraField),
+ '5356' . // 2 bytes; Tag for this "extra" block type
+ '0000' // 2 bytes; TODO: Document
+ );
+ }
+}
diff --git a/vendor/maennchen/zipstream-php/test/bootstrap.php b/vendor/maennchen/zipstream-php/test/bootstrap.php
new file mode 100644
index 0000000..13c7a0e
--- /dev/null
+++ b/vendor/maennchen/zipstream-php/test/bootstrap.php
@@ -0,0 +1,7 @@
+add($complexString2);
+```
+
+or use the static Operation methods
+```php
+$complexString1 = '1.23-4.56i';
+$complexString2 = '2.34+5.67i';
+
+echo Complex\Operations::add($complexString1, $complexString2);
+```
+If you want to perform the same operation against multiple values (e.g. to add three or more complex numbers), then you can pass multiple arguments to any of the operations.
+
+You can pass these arguments as Complex objects, or as an array, or string that will parse to a complex object.
+
+## Using functions
+
+When calling any of the available functions for a complex value, you can either call the relevant method for the Complex object
+```php
+$complexString = '1.23-4.56i';
+
+$complexObject = new Complex\Complex($complexString);
+echo $complexObject->sinh();
+```
+
+or use the static Functions methods
+```php
+$complexString = '1.23-4.56i';
+
+echo Complex\Functions::sinh($complexString);
+```
+As with operations, you can pass these arguments as Complex objects, or as an array or string that will parse to a complex object.
+
+
+In the case of the `pow()` function (the only implemented function that requires an additional argument) you need to pass both arguments when calling the function
+
+```php
+$complexString = '1.23-4.56i';
+
+$complexObject = new Complex\Complex($complexString);
+echo Complex\Functions::pow($complexObject, 2);
+```
+or pass the additional argument when calling the method
+```php
+$complexString = '1.23-4.56i';
+
+$complexObject = new Complex\Complex($complexString);
+echo $complexObject->pow(2);
+```
diff --git a/vendor/markbaker/complex/classes/src/Complex.php b/vendor/markbaker/complex/classes/src/Complex.php
new file mode 100644
index 0000000..25414ee
--- /dev/null
+++ b/vendor/markbaker/complex/classes/src/Complex.php
@@ -0,0 +1,388 @@
+realPart = (float) $realPart;
+ $this->imaginaryPart = (float) $imaginaryPart;
+ $this->suffix = strtolower($suffix ?? '');
+ }
+
+ /**
+ * Gets the real part of this complex number
+ *
+ * @return Float
+ */
+ public function getReal(): float
+ {
+ return $this->realPart;
+ }
+
+ /**
+ * Gets the imaginary part of this complex number
+ *
+ * @return Float
+ */
+ public function getImaginary(): float
+ {
+ return $this->imaginaryPart;
+ }
+
+ /**
+ * Gets the suffix of this complex number
+ *
+ * @return String
+ */
+ public function getSuffix(): string
+ {
+ return $this->suffix;
+ }
+
+ /**
+ * Returns true if this is a real value, false if a complex value
+ *
+ * @return Bool
+ */
+ public function isReal(): bool
+ {
+ return $this->imaginaryPart == 0.0;
+ }
+
+ /**
+ * Returns true if this is a complex value, false if a real value
+ *
+ * @return Bool
+ */
+ public function isComplex(): bool
+ {
+ return !$this->isReal();
+ }
+
+ public function format(): string
+ {
+ $str = "";
+ if ($this->imaginaryPart != 0.0) {
+ if (\abs($this->imaginaryPart) != 1.0) {
+ $str .= $this->imaginaryPart . $this->suffix;
+ } else {
+ $str .= (($this->imaginaryPart < 0.0) ? '-' : '') . $this->suffix;
+ }
+ }
+ if ($this->realPart != 0.0) {
+ if (($str) && ($this->imaginaryPart > 0.0)) {
+ $str = "+" . $str;
+ }
+ $str = $this->realPart . $str;
+ }
+ if (!$str) {
+ $str = "0.0";
+ }
+
+ return $str;
+ }
+
+ public function __toString(): string
+ {
+ return $this->format();
+ }
+
+ /**
+ * Validates whether the argument is a valid complex number, converting scalar or array values if possible
+ *
+ * @param mixed $complex The value to validate
+ * @return Complex
+ * @throws Exception If the argument isn't a Complex number or cannot be converted to one
+ */
+ public static function validateComplexArgument($complex): Complex
+ {
+ if (is_scalar($complex) || is_array($complex)) {
+ $complex = new Complex($complex);
+ } elseif (!is_object($complex) || !($complex instanceof Complex)) {
+ throw new Exception('Value is not a valid complex number');
+ }
+
+ return $complex;
+ }
+
+ /**
+ * Returns the reverse of this complex number
+ *
+ * @return Complex
+ */
+ public function reverse(): Complex
+ {
+ return new Complex(
+ $this->imaginaryPart,
+ $this->realPart,
+ ($this->realPart == 0.0) ? null : $this->suffix
+ );
+ }
+
+ public function invertImaginary(): Complex
+ {
+ return new Complex(
+ $this->realPart,
+ $this->imaginaryPart * -1,
+ ($this->imaginaryPart == 0.0) ? null : $this->suffix
+ );
+ }
+
+ public function invertReal(): Complex
+ {
+ return new Complex(
+ $this->realPart * -1,
+ $this->imaginaryPart,
+ ($this->imaginaryPart == 0.0) ? null : $this->suffix
+ );
+ }
+
+ protected static $functions = [
+ 'abs',
+ 'acos',
+ 'acosh',
+ 'acot',
+ 'acoth',
+ 'acsc',
+ 'acsch',
+ 'argument',
+ 'asec',
+ 'asech',
+ 'asin',
+ 'asinh',
+ 'atan',
+ 'atanh',
+ 'conjugate',
+ 'cos',
+ 'cosh',
+ 'cot',
+ 'coth',
+ 'csc',
+ 'csch',
+ 'exp',
+ 'inverse',
+ 'ln',
+ 'log2',
+ 'log10',
+ 'negative',
+ 'pow',
+ 'rho',
+ 'sec',
+ 'sech',
+ 'sin',
+ 'sinh',
+ 'sqrt',
+ 'tan',
+ 'tanh',
+ 'theta',
+ ];
+
+ protected static $operations = [
+ 'add',
+ 'subtract',
+ 'multiply',
+ 'divideby',
+ 'divideinto',
+ ];
+
+ /**
+ * Returns the result of the function call or operation
+ *
+ * @return Complex|float
+ * @throws Exception|\InvalidArgumentException
+ */
+ public function __call($functionName, $arguments)
+ {
+ $functionName = strtolower(str_replace('_', '', $functionName));
+
+ // Test for function calls
+ if (in_array($functionName, self::$functions, true)) {
+ return Functions::$functionName($this, ...$arguments);
+ }
+ // Test for operation calls
+ if (in_array($functionName, self::$operations, true)) {
+ return Operations::$functionName($this, ...$arguments);
+ }
+ throw new Exception('Complex Function or Operation does not exist');
+ }
+}
diff --git a/vendor/markbaker/complex/classes/src/Exception.php b/vendor/markbaker/complex/classes/src/Exception.php
new file mode 100644
index 0000000..a2beb73
--- /dev/null
+++ b/vendor/markbaker/complex/classes/src/Exception.php
@@ -0,0 +1,13 @@
+getReal() - $invsqrt->getImaginary(),
+ $complex->getImaginary() + $invsqrt->getReal()
+ );
+ $log = self::ln($adjust);
+
+ return new Complex(
+ $log->getImaginary(),
+ -1 * $log->getReal()
+ );
+ }
+
+ /**
+ * Returns the inverse hyperbolic cosine of a complex number.
+ *
+ * Formula from Wolfram Alpha:
+ * cosh^(-1)z = ln(z + sqrt(z + 1) sqrt(z - 1)).
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse hyperbolic cosine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function acosh($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal() && ($complex->getReal() > 1)) {
+ return new Complex(\acosh($complex->getReal()));
+ }
+
+ $acosh = self::ln(
+ Operations::add(
+ $complex,
+ Operations::multiply(
+ self::sqrt(Operations::add($complex, 1)),
+ self::sqrt(Operations::subtract($complex, 1))
+ )
+ )
+ );
+
+ return $acosh;
+ }
+
+ /**
+ * Returns the inverse cotangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse cotangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function acot($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return self::atan(self::inverse($complex));
+ }
+
+ /**
+ * Returns the inverse hyperbolic cotangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse hyperbolic cotangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function acoth($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return self::atanh(self::inverse($complex));
+ }
+
+ /**
+ * Returns the inverse cosecant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse cosecant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function acsc($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::asin(self::inverse($complex));
+ }
+
+ /**
+ * Returns the inverse hyperbolic cosecant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse hyperbolic cosecant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function acsch($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::asinh(self::inverse($complex));
+ }
+
+ /**
+ * Returns the argument of a complex number.
+ * Also known as the theta of the complex number, i.e. the angle in radians
+ * from the real axis to the representation of the number in polar coordinates.
+ *
+ * This function is a synonym for theta()
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return float The argument (or theta) value of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ *
+ * @see theta
+ */
+ public static function argument($complex): float
+ {
+ return self::theta($complex);
+ }
+
+ /**
+ * Returns the inverse secant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse secant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function asec($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::acos(self::inverse($complex));
+ }
+
+ /**
+ * Returns the inverse hyperbolic secant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse hyperbolic secant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function asech($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::acosh(self::inverse($complex));
+ }
+
+ /**
+ * Returns the inverse sine of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse sine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function asin($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ $invsqrt = self::sqrt(Operations::subtract(1, Operations::multiply($complex, $complex)));
+ $adjust = new Complex(
+ $invsqrt->getReal() - $complex->getImaginary(),
+ $invsqrt->getImaginary() + $complex->getReal()
+ );
+ $log = self::ln($adjust);
+
+ return new Complex(
+ $log->getImaginary(),
+ -1 * $log->getReal()
+ );
+ }
+
+ /**
+ * Returns the inverse hyperbolic sine of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse hyperbolic sine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function asinh($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal() && ($complex->getReal() > 1)) {
+ return new Complex(\asinh($complex->getReal()));
+ }
+
+ $asinh = clone $complex;
+ $asinh = $asinh->reverse()
+ ->invertReal();
+ $asinh = self::asin($asinh);
+
+ return $asinh->reverse()
+ ->invertImaginary();
+ }
+
+ /**
+ * Returns the inverse tangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse tangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function atan($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ return new Complex(\atan($complex->getReal()));
+ }
+
+ $t1Value = new Complex(-1 * $complex->getImaginary(), $complex->getReal());
+ $uValue = new Complex(1, 0);
+
+ $d1Value = clone $uValue;
+ $d1Value = Operations::subtract($d1Value, $t1Value);
+ $d2Value = Operations::add($t1Value, $uValue);
+ $uResult = $d1Value->divideBy($d2Value);
+ $uResult = self::ln($uResult);
+
+ $realMultiplier = -0.5;
+ $imaginaryMultiplier = 0.5;
+
+ if (abs($uResult->getImaginary()) === M_PI) {
+ // If we have an imaginary value at the max or min (PI or -PI), then we need to ensure
+ // that the primary is assigned for the correct quadrant.
+ $realMultiplier = (
+ ($uResult->getImaginary() === M_PI && $uResult->getReal() > 0.0) ||
+ ($uResult->getImaginary() === -M_PI && $uResult->getReal() < 0.0)
+ ) ? 0.5 : -0.5;
+ }
+
+ return new Complex(
+ $uResult->getImaginary() * $realMultiplier,
+ $uResult->getReal() * $imaginaryMultiplier,
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the inverse hyperbolic tangent of a complex number.
+ *
+ * Formula from Wolfram Alpha:
+ * tanh^(-1)z = 1/2 [ln(1 + z) - ln(1 - z)].
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse hyperbolic tangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function atanh($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ $real = $complex->getReal();
+ if ($real >= -1.0 && $real <= 1.0) {
+ return new Complex(\atanh($real));
+ } else {
+ return new Complex(\atanh(1 / $real), (($real < 0.0) ? M_PI_2 : -1 * M_PI_2));
+ }
+ }
+
+ $atanh = Operations::multiply(
+ Operations::subtract(
+ self::ln(Operations::add(1.0, $complex)),
+ self::ln(Operations::subtract(1.0, $complex))
+ ),
+ 0.5
+ );
+
+ return $atanh;
+ }
+
+ /**
+ * Returns the complex conjugate of a complex number
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The conjugate of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function conjugate($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return new Complex(
+ $complex->getReal(),
+ -1 * $complex->getImaginary(),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the cosine of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The cosine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function cos($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ return new Complex(\cos($complex->getReal()));
+ }
+
+ return self::conjugate(
+ new Complex(
+ \cos($complex->getReal()) * \cosh($complex->getImaginary()),
+ \sin($complex->getReal()) * \sinh($complex->getImaginary()),
+ $complex->getSuffix()
+ )
+ );
+ }
+
+ /**
+ * Returns the hyperbolic cosine of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The hyperbolic cosine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function cosh($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ return new Complex(\cosh($complex->getReal()));
+ }
+
+ return new Complex(
+ \cosh($complex->getReal()) * \cos($complex->getImaginary()),
+ \sinh($complex->getReal()) * \sin($complex->getImaginary()),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the cotangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The cotangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function cot($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::inverse(self::tan($complex));
+ }
+
+ /**
+ * Returns the hyperbolic cotangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The hyperbolic cotangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function coth($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return self::inverse(self::tanh($complex));
+ }
+
+ /**
+ * Returns the cosecant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The cosecant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function csc($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::inverse(self::sin($complex));
+ }
+
+ /**
+ * Returns the hyperbolic cosecant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The hyperbolic cosecant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function csch($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return self::inverse(self::sinh($complex));
+ }
+
+ /**
+ * Returns the exponential of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The exponential of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function exp($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if (($complex->getReal() == 0.0) && (\abs($complex->getImaginary()) == M_PI)) {
+ return new Complex(-1.0, 0.0);
+ }
+
+ $rho = \exp($complex->getReal());
+
+ return new Complex(
+ $rho * \cos($complex->getImaginary()),
+ $rho * \sin($complex->getImaginary()),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the inverse of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The inverse of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws InvalidArgumentException If function would result in a division by zero
+ */
+ public static function inverse($complex): Complex
+ {
+ $complex = clone Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ throw new InvalidArgumentException('Division by zero');
+ }
+
+ return $complex->divideInto(1.0);
+ }
+
+ /**
+ * Returns the natural logarithm of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The natural logarithm of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws InvalidArgumentException If the real and the imaginary parts are both zero
+ */
+ public static function ln($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if (($complex->getReal() == 0.0) && ($complex->getImaginary() == 0.0)) {
+ throw new InvalidArgumentException();
+ }
+
+ return new Complex(
+ \log(self::rho($complex)),
+ self::theta($complex),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the base-2 logarithm of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The base-2 logarithm of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws InvalidArgumentException If the real and the imaginary parts are both zero
+ */
+ public static function log2($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if (($complex->getReal() == 0.0) && ($complex->getImaginary() == 0.0)) {
+ throw new InvalidArgumentException();
+ } elseif (($complex->getReal() > 0.0) && ($complex->getImaginary() == 0.0)) {
+ return new Complex(\log($complex->getReal(), 2), 0.0, $complex->getSuffix());
+ }
+
+ return self::ln($complex)
+ ->multiply(\log(Complex::EULER, 2));
+ }
+
+ /**
+ * Returns the common logarithm (base 10) of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The common logarithm (base 10) of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws InvalidArgumentException If the real and the imaginary parts are both zero
+ */
+ public static function log10($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if (($complex->getReal() == 0.0) && ($complex->getImaginary() == 0.0)) {
+ throw new InvalidArgumentException();
+ } elseif (($complex->getReal() > 0.0) && ($complex->getImaginary() == 0.0)) {
+ return new Complex(\log10($complex->getReal()), 0.0, $complex->getSuffix());
+ }
+
+ return self::ln($complex)
+ ->multiply(\log10(Complex::EULER));
+ }
+
+ /**
+ * Returns the negative of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The negative value of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ *
+ * @see rho
+ *
+ */
+ public static function negative($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return new Complex(
+ -1 * $complex->getReal(),
+ -1 * $complex->getImaginary(),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns a complex number raised to a power.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @param float|integer $power The power to raise this value to
+ * @return Complex The complex argument raised to the real power.
+ * @throws Exception If the power argument isn't a valid real
+ */
+ public static function pow($complex, $power): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if (!is_numeric($power)) {
+ throw new Exception('Power argument must be a real number');
+ }
+
+ if ($complex->getImaginary() == 0.0 && $complex->getReal() >= 0.0) {
+ return new Complex(\pow($complex->getReal(), $power));
+ }
+
+ $rValue = \sqrt(($complex->getReal() * $complex->getReal()) + ($complex->getImaginary() * $complex->getImaginary()));
+ $rPower = \pow($rValue, $power);
+ $theta = $complex->argument() * $power;
+ if ($theta == 0) {
+ return new Complex(1);
+ }
+
+ return new Complex($rPower * \cos($theta), $rPower * \sin($theta), $complex->getSuffix());
+ }
+
+ /**
+ * Returns the rho of a complex number.
+ * This is the distance/radius from the centrepoint to the representation of the number in polar coordinates.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return float The rho value of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function rho($complex): float
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return \sqrt(
+ ($complex->getReal() * $complex->getReal()) +
+ ($complex->getImaginary() * $complex->getImaginary())
+ );
+ }
+
+ /**
+ * Returns the secant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The secant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function sec($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return self::inverse(self::cos($complex));
+ }
+
+ /**
+ * Returns the hyperbolic secant of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The hyperbolic secant of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function sech($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ return self::inverse(self::cosh($complex));
+ }
+
+ /**
+ * Returns the sine of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The sine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function sin($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ return new Complex(\sin($complex->getReal()));
+ }
+
+ return new Complex(
+ \sin($complex->getReal()) * \cosh($complex->getImaginary()),
+ \cos($complex->getReal()) * \sinh($complex->getImaginary()),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the hyperbolic sine of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The hyperbolic sine of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function sinh($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ return new Complex(\sinh($complex->getReal()));
+ }
+
+ return new Complex(
+ \sinh($complex->getReal()) * \cos($complex->getImaginary()),
+ \cosh($complex->getReal()) * \sin($complex->getImaginary()),
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the square root of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The Square root of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function sqrt($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ $theta = self::theta($complex);
+ $delta1 = \cos($theta / 2);
+ $delta2 = \sin($theta / 2);
+ $rho = \sqrt(self::rho($complex));
+
+ return new Complex($delta1 * $rho, $delta2 * $rho, $complex->getSuffix());
+ }
+
+ /**
+ * Returns the tangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The tangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws InvalidArgumentException If function would result in a division by zero
+ */
+ public static function tan($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->isReal()) {
+ return new Complex(\tan($complex->getReal()));
+ }
+
+ $real = $complex->getReal();
+ $imaginary = $complex->getImaginary();
+ $divisor = 1 + \pow(\tan($real), 2) * \pow(\tanh($imaginary), 2);
+ if ($divisor == 0.0) {
+ throw new InvalidArgumentException('Division by zero');
+ }
+
+ return new Complex(
+ \pow(self::sech($imaginary)->getReal(), 2) * \tan($real) / $divisor,
+ \pow(self::sec($real)->getReal(), 2) * \tanh($imaginary) / $divisor,
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the hyperbolic tangent of a complex number.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return Complex The hyperbolic tangent of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ * @throws \InvalidArgumentException If function would result in a division by zero
+ */
+ public static function tanh($complex): Complex
+ {
+ $complex = Complex::validateComplexArgument($complex);
+ $real = $complex->getReal();
+ $imaginary = $complex->getImaginary();
+ $divisor = \cos($imaginary) * \cos($imaginary) + \sinh($real) * \sinh($real);
+ if ($divisor == 0.0) {
+ throw new InvalidArgumentException('Division by zero');
+ }
+
+ return new Complex(
+ \sinh($real) * \cosh($real) / $divisor,
+ 0.5 * \sin(2 * $imaginary) / $divisor,
+ $complex->getSuffix()
+ );
+ }
+
+ /**
+ * Returns the theta of a complex number.
+ * This is the angle in radians from the real axis to the representation of the number in polar coordinates.
+ *
+ * @param Complex|mixed $complex Complex number or a numeric value.
+ * @return float The theta value of the complex argument.
+ * @throws Exception If argument isn't a valid real or complex number.
+ */
+ public static function theta($complex): float
+ {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($complex->getReal() == 0.0) {
+ if ($complex->isReal()) {
+ return 0.0;
+ } elseif ($complex->getImaginary() < 0.0) {
+ return M_PI / -2;
+ }
+ return M_PI / 2;
+ } elseif ($complex->getReal() > 0.0) {
+ return \atan($complex->getImaginary() / $complex->getReal());
+ } elseif ($complex->getImaginary() < 0.0) {
+ return -(M_PI - \atan(\abs($complex->getImaginary()) / \abs($complex->getReal())));
+ }
+
+ return M_PI - \atan($complex->getImaginary() / \abs($complex->getReal()));
+ }
+}
diff --git a/vendor/markbaker/complex/classes/src/Operations.php b/vendor/markbaker/complex/classes/src/Operations.php
new file mode 100644
index 0000000..b13a873
--- /dev/null
+++ b/vendor/markbaker/complex/classes/src/Operations.php
@@ -0,0 +1,210 @@
+isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+
+ $real = $result->getReal() + $complex->getReal();
+ $imaginary = $result->getImaginary() + $complex->getImaginary();
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Divides two or more complex numbers
+ *
+ * @param array of string|integer|float|Complex $complexValues The numbers to divide
+ * @return Complex
+ */
+ public static function divideby(...$complexValues): Complex
+ {
+ if (count($complexValues) < 2) {
+ throw new \Exception('This function requires at least 2 arguments');
+ }
+
+ $base = array_shift($complexValues);
+ $result = clone Complex::validateComplexArgument($base);
+
+ foreach ($complexValues as $complex) {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($result->isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ throw new InvalidArgumentException('Division by zero');
+ }
+
+ $delta1 = ($result->getReal() * $complex->getReal()) +
+ ($result->getImaginary() * $complex->getImaginary());
+ $delta2 = ($result->getImaginary() * $complex->getReal()) -
+ ($result->getReal() * $complex->getImaginary());
+ $delta3 = ($complex->getReal() * $complex->getReal()) +
+ ($complex->getImaginary() * $complex->getImaginary());
+
+ $real = $delta1 / $delta3;
+ $imaginary = $delta2 / $delta3;
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Divides two or more complex numbers
+ *
+ * @param array of string|integer|float|Complex $complexValues The numbers to divide
+ * @return Complex
+ */
+ public static function divideinto(...$complexValues): Complex
+ {
+ if (count($complexValues) < 2) {
+ throw new \Exception('This function requires at least 2 arguments');
+ }
+
+ $base = array_shift($complexValues);
+ $result = clone Complex::validateComplexArgument($base);
+
+ foreach ($complexValues as $complex) {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($result->isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+ if ($result->getReal() == 0.0 && $result->getImaginary() == 0.0) {
+ throw new InvalidArgumentException('Division by zero');
+ }
+
+ $delta1 = ($complex->getReal() * $result->getReal()) +
+ ($complex->getImaginary() * $result->getImaginary());
+ $delta2 = ($complex->getImaginary() * $result->getReal()) -
+ ($complex->getReal() * $result->getImaginary());
+ $delta3 = ($result->getReal() * $result->getReal()) +
+ ($result->getImaginary() * $result->getImaginary());
+
+ $real = $delta1 / $delta3;
+ $imaginary = $delta2 / $delta3;
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Multiplies two or more complex numbers
+ *
+ * @param array of string|integer|float|Complex $complexValues The numbers to multiply
+ * @return Complex
+ */
+ public static function multiply(...$complexValues): Complex
+ {
+ if (count($complexValues) < 2) {
+ throw new \Exception('This function requires at least 2 arguments');
+ }
+
+ $base = array_shift($complexValues);
+ $result = clone Complex::validateComplexArgument($base);
+
+ foreach ($complexValues as $complex) {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($result->isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+
+ $real = ($result->getReal() * $complex->getReal()) -
+ ($result->getImaginary() * $complex->getImaginary());
+ $imaginary = ($result->getReal() * $complex->getImaginary()) +
+ ($result->getImaginary() * $complex->getReal());
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * Subtracts two or more complex numbers
+ *
+ * @param array of string|integer|float|Complex $complexValues The numbers to subtract
+ * @return Complex
+ */
+ public static function subtract(...$complexValues): Complex
+ {
+ if (count($complexValues) < 2) {
+ throw new \Exception('This function requires at least 2 arguments');
+ }
+
+ $base = array_shift($complexValues);
+ $result = clone Complex::validateComplexArgument($base);
+
+ foreach ($complexValues as $complex) {
+ $complex = Complex::validateComplexArgument($complex);
+
+ if ($result->isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+
+ $real = $result->getReal() - $complex->getReal();
+ $imaginary = $result->getImaginary() - $complex->getImaginary();
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+ }
+}
diff --git a/vendor/markbaker/complex/composer.json b/vendor/markbaker/complex/composer.json
new file mode 100644
index 0000000..246683c
--- /dev/null
+++ b/vendor/markbaker/complex/composer.json
@@ -0,0 +1,40 @@
+{
+ "name": "markbaker/complex",
+ "type": "library",
+ "description": "PHP Class for working with complex numbers",
+ "keywords": ["complex", "mathematics"],
+ "homepage": "https://github.com/MarkBaker/PHPComplex",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@lange.demon.co.uk"
+ }
+ ],
+ "config": {
+ "sort-packages": true,
+ "allow-plugins": {
+ "dealerdirect/phpcodesniffer-composer-installer": true,
+ "markbaker/ukraine": true
+ }
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
+ "squizlabs/php_codesniffer": "^3.7",
+ "phpcompatibility/php-compatibility": "^9.3",
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-master"
+ },
+ "autoload": {
+ "psr-4": {
+ "Complex\\": "classes/src/"
+ }
+ },
+ "scripts": {
+ "style": "phpcs --report-width=200 --standard=PSR2 --report=summary,full classes/src/ unitTests/classes/src -n",
+ "versions": "phpcs --report-width=200 --standard=PHPCompatibility --report=summary,full classes/src/ --runtime-set testVersion 7.2- -n"
+ },
+ "minimum-stability": "dev"
+}
diff --git a/vendor/markbaker/complex/examples/complexTest.php b/vendor/markbaker/complex/examples/complexTest.php
new file mode 100644
index 0000000..9a5e123
--- /dev/null
+++ b/vendor/markbaker/complex/examples/complexTest.php
@@ -0,0 +1,154 @@
+add(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->add(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->add(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->add(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->add(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->add(new Complex(0, -1));
+echo $x, PHP_EOL;
+
+
+echo PHP_EOL, 'Subtract', PHP_EOL;
+
+$x = new Complex(123);
+$x->subtract(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->subtract(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->subtract(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->subtract(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->subtract(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->subtract(new Complex(0, -1));
+echo $x, PHP_EOL;
+
+
+echo PHP_EOL, 'Multiply', PHP_EOL;
+
+$x = new Complex(123);
+$x->multiply(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->multiply(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->multiply(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->multiply(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->multiply(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->multiply(new Complex(0, -1));
+echo $x, PHP_EOL;
+
+
+echo PHP_EOL, 'Divide By', PHP_EOL;
+
+$x = new Complex(123);
+$x->divideBy(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->divideBy(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->divideBy(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->divideBy(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->divideBy(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->divideBy(new Complex(0, -1));
+echo $x, PHP_EOL;
+
+
+echo PHP_EOL, 'Divide Into', PHP_EOL;
+
+$x = new Complex(123);
+$x->divideInto(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->divideInto(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->divideInto(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->divideInto(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->divideInto(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->divideInto(new Complex(0, -1));
+echo $x, PHP_EOL;
diff --git a/vendor/markbaker/complex/examples/testFunctions.php b/vendor/markbaker/complex/examples/testFunctions.php
new file mode 100644
index 0000000..bad1c03
--- /dev/null
+++ b/vendor/markbaker/complex/examples/testFunctions.php
@@ -0,0 +1,52 @@
+getMessage(), PHP_EOL;
+ }
+ }
+ echo PHP_EOL;
+ }
+}
diff --git a/vendor/markbaker/complex/examples/testOperations.php b/vendor/markbaker/complex/examples/testOperations.php
new file mode 100644
index 0000000..2b7e0ba
--- /dev/null
+++ b/vendor/markbaker/complex/examples/testOperations.php
@@ -0,0 +1,35 @@
+ ', $result, PHP_EOL;
+
+echo PHP_EOL;
+
+echo 'Subtraction', PHP_EOL;
+
+$result = Operations::subtract(...$values);
+echo '=> ', $result, PHP_EOL;
+
+echo PHP_EOL;
+
+echo 'Multiplication', PHP_EOL;
+
+$result = Operations::multiply(...$values);
+echo '=> ', $result, PHP_EOL;
diff --git a/vendor/markbaker/complex/license.md b/vendor/markbaker/complex/license.md
new file mode 100644
index 0000000..5b4b156
--- /dev/null
+++ b/vendor/markbaker/complex/license.md
@@ -0,0 +1,25 @@
+The MIT License (MIT)
+=====================
+
+Copyright © `2017` `Mark Baker`
+
+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/markbaker/matrix/.github/workflows/main.yaml b/vendor/markbaker/matrix/.github/workflows/main.yaml
new file mode 100644
index 0000000..5fa1bdb
--- /dev/null
+++ b/vendor/markbaker/matrix/.github/workflows/main.yaml
@@ -0,0 +1,124 @@
+name: main
+on: [ push, pull_request ]
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ php-version:
+ - '7.1'
+ - '7.2'
+ - '7.3'
+ - '7.4'
+ - '8.0'
+ - '8.1'
+ - '8.2'
+
+ include:
+ - php-version: 'nightly'
+ experimental: true
+
+ name: PHP ${{ matrix.php-version }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Setup PHP, with composer and extensions
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: ${{ matrix.php-version }}
+ extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
+ coverage: none
+
+ - name: Get composer cache directory
+ id: composer-cache
+ run: echo "::set-output name=dir::$(composer config cache-files-dir)"
+
+ - name: Cache composer dependencies
+ uses: actions/cache@v3
+ with:
+ path: ${{ steps.composer-cache.outputs.dir }}
+ key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
+ restore-keys: ${{ runner.os }}-composer-
+
+ - name: Delete composer lock file
+ id: composer-lock
+ if: ${{ matrix.php-version == '8.0' || matrix.php-version == '8.1' || matrix.php-version == '8.2' || matrix.php-version == 'nightly' }}
+ run: |
+ rm composer.lock
+ echo "::set-output name=flags::--ignore-platform-reqs"
+
+ - name: Install dependencies
+ run: composer update --no-progress --prefer-dist --optimize-autoloader ${{ steps.composer-lock.outputs.flags }}
+
+ - name: Setup problem matchers for PHP
+ run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
+
+ - name: Setup problem matchers for PHPUnit
+ run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
+
+ - name: Test with PHPUnit
+ run: ./vendor/bin/phpunit
+
+ phpcs:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Setup PHP, with composer and extensions
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: 7.4
+ extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
+ coverage: none
+ tools: cs2pr
+
+ - name: Get composer cache directory
+ id: composer-cache
+ run: echo "::set-output name=dir::$(composer config cache-files-dir)"
+
+ - name: Cache composer dependencies
+ uses: actions/cache@v3
+ with:
+ path: ${{ steps.composer-cache.outputs.dir }}
+ key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
+ restore-keys: ${{ runner.os }}-composer-
+
+ - name: Install dependencies
+ run: composer install --no-progress --prefer-dist --optimize-autoloader
+
+ - name: Code style with PHP_CodeSniffer
+ run: ./vendor/bin/phpcs -q --report=checkstyle | cs2pr --graceful-warnings --colorize
+
+ coverage:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Setup PHP, with composer and extensions
+ uses: shivammathur/setup-php@v2
+ with:
+ php-version: 7.4
+ extensions: ctype, dom, gd, iconv, fileinfo, libxml, mbstring, simplexml, xml, xmlreader, xmlwriter, zip, zlib
+ coverage: pcov
+
+ - name: Get composer cache directory
+ id: composer-cache
+ run: echo "::set-output name=dir::$(composer config cache-files-dir)"
+
+ - name: Cache composer dependencies
+ uses: actions/cache@v3
+ with:
+ path: ${{ steps.composer-cache.outputs.dir }}
+ key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
+ restore-keys: ${{ runner.os }}-composer-
+
+ - name: Install dependencies
+ run: composer install --no-progress --prefer-dist --optimize-autoloader
+
+ - name: Coverage
+ run: |
+ ./vendor/bin/phpunit --coverage-text
diff --git a/vendor/markbaker/matrix/README.md b/vendor/markbaker/matrix/README.md
new file mode 100644
index 0000000..d0dc914
--- /dev/null
+++ b/vendor/markbaker/matrix/README.md
@@ -0,0 +1,215 @@
+PHPMatrix
+==========
+
+---
+
+PHP Class for handling Matrices
+
+[](https://github.com/MarkBaker/PHPMatrix/actions)
+[](https://packagist.org/packages/markbaker/matrix)
+[](https://packagist.org/packages/markbaker/matrix)
+[](https://packagist.org/packages/markbaker/matrix)
+
+
+[](https://xkcd.com/184/)
+
+Matrix Transform
+
+---
+
+This library currently provides the following operations:
+
+ - addition
+ - direct sum
+ - subtraction
+ - multiplication
+ - division (using [A].[B]-1)
+ - division by
+ - division into
+
+together with functions for
+
+ - adjoint
+ - antidiagonal
+ - cofactors
+ - determinant
+ - diagonal
+ - identity
+ - inverse
+ - minors
+ - trace
+ - transpose
+ - solve
+
+ Given Matrices A and B, calculate X for A.X = B
+
+and classes for
+
+ - Decomposition
+ - LU Decomposition with partial row pivoting,
+
+ such that [P].[A] = [L].[U] and [A] = [P]|.[L].[U]
+ - QR Decomposition
+
+ such that [A] = [Q].[R]
+
+## TO DO
+
+ - power() function
+ - Decomposition
+ - Cholesky Decomposition
+ - EigenValue Decomposition
+ - EigenValues
+ - EigenVectors
+
+---
+
+# Installation
+
+```shell
+composer require markbaker/matrix:^3.0
+```
+
+# Important BC Note
+
+If you've previously been using procedural calls to functions and operations using this library, then from version 3.0 you should use [MarkBaker/PHPMatrixFunctions](https://github.com/MarkBaker/PHPMatrixFunctions) instead (available on packagist as [markbaker/matrix-functions](https://packagist.org/packages/markbaker/matrix-functions)).
+
+You'll need to replace `markbaker/matrix`in your `composer.json` file with the new library, but otherwise there should be no difference in the namespacing, or in the way that you have called the Matrix functions in the past, so no actual code changes are required.
+
+```shell
+composer require markbaker/matrix-functions:^1.0
+```
+
+You should not reference this library (`markbaker/matrix`) in your `composer.json`, composer wil take care of that for you.
+
+# Usage
+
+To create a new Matrix object, provide an array as the constructor argument
+
+```php
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+$matrix = new Matrix\Matrix($grid);
+```
+The `Builder` class provides helper methods for creating specific matrices, specifically an identity matrix of a specified size; or a matrix of a specified dimensions, with every cell containing a set value.
+```php
+$matrix = Matrix\Builder::createFilledMatrix(1, 5, 3);
+```
+Will create a matrix of 5 rows and 3 columns, filled with a `1` in every cell; while
+```php
+$matrix = Matrix\Builder::createIdentityMatrix(3);
+```
+will create a 3x3 identity matrix.
+
+
+Matrix objects are immutable: whenever you call a method or pass a grid to a function that returns a matrix value, a new Matrix object will be returned, and the original will remain unchanged. This also allows you to chain multiple methods as you would for a fluent interface (as long as they are methods that will return a Matrix result).
+
+## Performing Mathematical Operations
+
+To perform mathematical operations with Matrices, you can call the appropriate method against a matrix value, passing other values as arguments
+
+```php
+$matrix1 = new Matrix\Matrix([
+ [2, 7, 6],
+ [9, 5, 1],
+ [4, 3, 8],
+]);
+$matrix2 = new Matrix\Matrix([
+ [1, 2, 3],
+ [4, 5, 6],
+ [7, 8, 9],
+]);
+
+var_dump($matrix1->multiply($matrix2)->toArray());
+```
+or pass all values to the appropriate static method
+```php
+$matrix1 = new Matrix\Matrix([
+ [2, 7, 6],
+ [9, 5, 1],
+ [4, 3, 8],
+]);
+$matrix2 = new Matrix\Matrix([
+ [1, 2, 3],
+ [4, 5, 6],
+ [7, 8, 9],
+]);
+
+var_dump(Matrix\Operations::multiply($matrix1, $matrix2)->toArray());
+```
+You can pass in the arguments as Matrix objects, or as arrays.
+
+If you want to perform the same operation against multiple values (e.g. to add three or more matrices), then you can pass multiple arguments to any of the operations.
+
+## Using functions
+
+When calling any of the available functions for a matrix value, you can either call the relevant method for the Matrix object
+```php
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+$matrix = new Matrix\Matrix($grid);
+
+echo $matrix->trace();
+```
+or you can call the static method, passing the Matrix object or array as an argument
+```php
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+$matrix = new Matrix\Matrix($grid);
+echo Matrix\Functions::trace($matrix);
+```
+```php
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+echo Matrix\Functions::trace($grid);
+```
+
+## Decomposition
+
+The library also provides classes for matrix decomposition. You can access these using
+```php
+$grid = [
+ [1, 2],
+ [3, 4],
+];
+
+$matrix = new Matrix\Matrix($grid);
+
+$decomposition = new Matrix\Decomposition\QR($matrix);
+$Q = $decomposition->getQ();
+$R = $decomposition->getR();
+```
+
+or alternatively us the `Decomposition` factory, identifying which form of decomposition you want to use
+```php
+$grid = [
+ [1, 2],
+ [3, 4],
+];
+
+$matrix = new Matrix\Matrix($grid);
+
+$decomposition = Matrix\Decomposition\Decomposition::decomposition(Matrix\Decomposition\Decomposition::QR, $matrix);
+$Q = $decomposition->getQ();
+$R = $decomposition->getR();
+```
diff --git a/vendor/markbaker/matrix/buildPhar.php b/vendor/markbaker/matrix/buildPhar.php
new file mode 100644
index 0000000..e1b8f96
--- /dev/null
+++ b/vendor/markbaker/matrix/buildPhar.php
@@ -0,0 +1,62 @@
+ 'Mark Baker ',
+ 'Description' => 'PHP Class for working with Matrix numbers',
+ 'Copyright' => 'Mark Baker (c) 2013-' . date('Y'),
+ 'Timestamp' => time(),
+ 'Version' => '0.1.0',
+ 'Date' => date('Y-m-d')
+);
+
+// cleanup
+if (file_exists($pharName)) {
+ echo "Removed: {$pharName}\n";
+ unlink($pharName);
+}
+
+echo "Building phar file...\n";
+
+// the phar object
+$phar = new Phar($pharName, null, 'Matrix');
+$phar->buildFromDirectory($sourceDir);
+$phar->setStub(
+<<<'EOT'
+getMessage());
+ exit(1);
+ }
+
+ include 'phar://functions/sqrt.php';
+
+ __HALT_COMPILER();
+EOT
+);
+$phar->setMetadata($metaData);
+$phar->compressFiles(Phar::GZ);
+
+echo "Complete.\n";
+
+exit();
diff --git a/vendor/markbaker/matrix/classes/src/Builder.php b/vendor/markbaker/matrix/classes/src/Builder.php
new file mode 100644
index 0000000..161bb68
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Builder.php
@@ -0,0 +1,70 @@
+toArray();
+
+ for ($x = 0; $x < $dimensions; ++$x) {
+ $grid[$x][$x] = 1;
+ }
+
+ return new Matrix($grid);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Decomposition/Decomposition.php b/vendor/markbaker/matrix/classes/src/Decomposition/Decomposition.php
new file mode 100644
index 0000000..f014448
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Decomposition/Decomposition.php
@@ -0,0 +1,27 @@
+luMatrix = $matrix->toArray();
+ $this->rows = $matrix->rows;
+ $this->columns = $matrix->columns;
+
+ $this->buildPivot();
+ }
+
+ /**
+ * Get lower triangular factor.
+ *
+ * @return Matrix Lower triangular factor
+ */
+ public function getL(): Matrix
+ {
+ $lower = [];
+
+ $columns = min($this->rows, $this->columns);
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $columns; ++$column) {
+ if ($row > $column) {
+ $lower[$row][$column] = $this->luMatrix[$row][$column];
+ } elseif ($row === $column) {
+ $lower[$row][$column] = 1.0;
+ } else {
+ $lower[$row][$column] = 0.0;
+ }
+ }
+ }
+
+ return new Matrix($lower);
+ }
+
+ /**
+ * Get upper triangular factor.
+ *
+ * @return Matrix Upper triangular factor
+ */
+ public function getU(): Matrix
+ {
+ $upper = [];
+
+ $rows = min($this->rows, $this->columns);
+ for ($row = 0; $row < $rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ if ($row <= $column) {
+ $upper[$row][$column] = $this->luMatrix[$row][$column];
+ } else {
+ $upper[$row][$column] = 0.0;
+ }
+ }
+ }
+
+ return new Matrix($upper);
+ }
+
+ /**
+ * Return pivot permutation vector.
+ *
+ * @return Matrix Pivot matrix
+ */
+ public function getP(): Matrix
+ {
+ $pMatrix = [];
+
+ $pivots = $this->pivot;
+ $pivotCount = count($pivots);
+ foreach ($pivots as $row => $pivot) {
+ $pMatrix[$row] = array_fill(0, $pivotCount, 0);
+ $pMatrix[$row][$pivot] = 1;
+ }
+
+ return new Matrix($pMatrix);
+ }
+
+ /**
+ * Return pivot permutation vector.
+ *
+ * @return array Pivot vector
+ */
+ public function getPivot(): array
+ {
+ return $this->pivot;
+ }
+
+ /**
+ * Is the matrix nonsingular?
+ *
+ * @return bool true if U, and hence A, is nonsingular
+ */
+ public function isNonsingular(): bool
+ {
+ for ($diagonal = 0; $diagonal < $this->columns; ++$diagonal) {
+ if ($this->luMatrix[$diagonal][$diagonal] === 0.0) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private function buildPivot(): void
+ {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ $this->pivot[$row] = $row;
+ }
+
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $luColumn = $this->localisedReferenceColumn($column);
+
+ $this->applyTransformations($column, $luColumn);
+
+ $pivot = $this->findPivot($column, $luColumn);
+ if ($pivot !== $column) {
+ $this->pivotExchange($pivot, $column);
+ }
+
+ $this->computeMultipliers($column);
+
+ unset($luColumn);
+ }
+ }
+
+ private function localisedReferenceColumn($column): array
+ {
+ $luColumn = [];
+
+ for ($row = 0; $row < $this->rows; ++$row) {
+ $luColumn[$row] = &$this->luMatrix[$row][$column];
+ }
+
+ return $luColumn;
+ }
+
+ private function applyTransformations($column, array $luColumn): void
+ {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ $luRow = $this->luMatrix[$row];
+ // Most of the time is spent in the following dot product.
+ $kmax = min($row, $column);
+ $sValue = 0.0;
+ for ($kValue = 0; $kValue < $kmax; ++$kValue) {
+ $sValue += $luRow[$kValue] * $luColumn[$kValue];
+ }
+ $luRow[$column] = $luColumn[$row] -= $sValue;
+ }
+ }
+
+ private function findPivot($column, array $luColumn): int
+ {
+ $pivot = $column;
+ for ($row = $column + 1; $row < $this->rows; ++$row) {
+ if (abs($luColumn[$row]) > abs($luColumn[$pivot])) {
+ $pivot = $row;
+ }
+ }
+
+ return $pivot;
+ }
+
+ private function pivotExchange($pivot, $column): void
+ {
+ for ($kValue = 0; $kValue < $this->columns; ++$kValue) {
+ $tValue = $this->luMatrix[$pivot][$kValue];
+ $this->luMatrix[$pivot][$kValue] = $this->luMatrix[$column][$kValue];
+ $this->luMatrix[$column][$kValue] = $tValue;
+ }
+
+ $lValue = $this->pivot[$pivot];
+ $this->pivot[$pivot] = $this->pivot[$column];
+ $this->pivot[$column] = $lValue;
+ }
+
+ private function computeMultipliers($diagonal): void
+ {
+ if (($diagonal < $this->rows) && ($this->luMatrix[$diagonal][$diagonal] != 0.0)) {
+ for ($row = $diagonal + 1; $row < $this->rows; ++$row) {
+ $this->luMatrix[$row][$diagonal] /= $this->luMatrix[$diagonal][$diagonal];
+ }
+ }
+ }
+
+ private function pivotB(Matrix $B): array
+ {
+ $X = [];
+ foreach ($this->pivot as $rowId) {
+ $row = $B->getRows($rowId + 1)->toArray();
+ $X[] = array_pop($row);
+ }
+
+ return $X;
+ }
+
+ /**
+ * Solve A*X = B.
+ *
+ * @param Matrix $B a Matrix with as many rows as A and any number of columns
+ *
+ * @throws Exception
+ *
+ * @return Matrix X so that L*U*X = B(piv,:)
+ */
+ public function solve(Matrix $B): Matrix
+ {
+ if ($B->rows !== $this->rows) {
+ throw new Exception('Matrix row dimensions are not equal');
+ }
+
+ if ($this->rows !== $this->columns) {
+ throw new Exception('LU solve() only works on square matrices');
+ }
+
+ if (!$this->isNonsingular()) {
+ throw new Exception('Can only perform operation on singular matrix');
+ }
+
+ // Copy right hand side with pivoting
+ $nx = $B->columns;
+ $X = $this->pivotB($B);
+
+ // Solve L*Y = B(piv,:)
+ for ($k = 0; $k < $this->columns; ++$k) {
+ for ($i = $k + 1; $i < $this->columns; ++$i) {
+ for ($j = 0; $j < $nx; ++$j) {
+ $X[$i][$j] -= $X[$k][$j] * $this->luMatrix[$i][$k];
+ }
+ }
+ }
+
+ // Solve U*X = Y;
+ for ($k = $this->columns - 1; $k >= 0; --$k) {
+ for ($j = 0; $j < $nx; ++$j) {
+ $X[$k][$j] /= $this->luMatrix[$k][$k];
+ }
+ for ($i = 0; $i < $k; ++$i) {
+ for ($j = 0; $j < $nx; ++$j) {
+ $X[$i][$j] -= $X[$k][$j] * $this->luMatrix[$i][$k];
+ }
+ }
+ }
+
+ return new Matrix($X);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Decomposition/QR.php b/vendor/markbaker/matrix/classes/src/Decomposition/QR.php
new file mode 100644
index 0000000..4b6106f
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Decomposition/QR.php
@@ -0,0 +1,191 @@
+qrMatrix = $matrix->toArray();
+ $this->rows = $matrix->rows;
+ $this->columns = $matrix->columns;
+
+ $this->decompose();
+ }
+
+ public function getHouseholdVectors(): Matrix
+ {
+ $householdVectors = [];
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ if ($row >= $column) {
+ $householdVectors[$row][$column] = $this->qrMatrix[$row][$column];
+ } else {
+ $householdVectors[$row][$column] = 0.0;
+ }
+ }
+ }
+
+ return new Matrix($householdVectors);
+ }
+
+ public function getQ(): Matrix
+ {
+ $qGrid = [];
+
+ $rowCount = $this->rows;
+ for ($k = $this->columns - 1; $k >= 0; --$k) {
+ for ($i = 0; $i < $this->rows; ++$i) {
+ $qGrid[$i][$k] = 0.0;
+ }
+ $qGrid[$k][$k] = 1.0;
+ if ($this->columns > $this->rows) {
+ $qGrid = array_slice($qGrid, 0, $this->rows);
+ }
+
+ for ($j = $k; $j < $this->columns; ++$j) {
+ if (isset($this->qrMatrix[$k], $this->qrMatrix[$k][$k]) && $this->qrMatrix[$k][$k] != 0.0) {
+ $s = 0.0;
+ for ($i = $k; $i < $this->rows; ++$i) {
+ $s += $this->qrMatrix[$i][$k] * $qGrid[$i][$j];
+ }
+ $s = -$s / $this->qrMatrix[$k][$k];
+ for ($i = $k; $i < $this->rows; ++$i) {
+ $qGrid[$i][$j] += $s * $this->qrMatrix[$i][$k];
+ }
+ }
+ }
+ }
+
+ array_walk(
+ $qGrid,
+ function (&$row) use ($rowCount) {
+ $row = array_reverse($row);
+ $row = array_slice($row, 0, $rowCount);
+ }
+ );
+
+ return new Matrix($qGrid);
+ }
+
+ public function getR(): Matrix
+ {
+ $rGrid = [];
+
+ for ($row = 0; $row < $this->columns; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ if ($row < $column) {
+ $rGrid[$row][$column] = $this->qrMatrix[$row][$column] ?? 0.0;
+ } elseif ($row === $column) {
+ $rGrid[$row][$column] = $this->rDiagonal[$row] ?? 0.0;
+ } else {
+ $rGrid[$row][$column] = 0.0;
+ }
+ }
+ }
+
+ if ($this->columns > $this->rows) {
+ $rGrid = array_slice($rGrid, 0, $this->rows);
+ }
+
+ return new Matrix($rGrid);
+ }
+
+ private function hypo($a, $b): float
+ {
+ if (abs($a) > abs($b)) {
+ $r = $b / $a;
+ $r = abs($a) * sqrt(1 + $r * $r);
+ } elseif ($b != 0.0) {
+ $r = $a / $b;
+ $r = abs($b) * sqrt(1 + $r * $r);
+ } else {
+ $r = 0.0;
+ }
+
+ return $r;
+ }
+
+ /**
+ * QR Decomposition computed by Householder reflections.
+ */
+ private function decompose(): void
+ {
+ for ($k = 0; $k < $this->columns; ++$k) {
+ // Compute 2-norm of k-th column without under/overflow.
+ $norm = 0.0;
+ for ($i = $k; $i < $this->rows; ++$i) {
+ $norm = $this->hypo($norm, $this->qrMatrix[$i][$k]);
+ }
+ if ($norm != 0.0) {
+ // Form k-th Householder vector.
+ if ($this->qrMatrix[$k][$k] < 0.0) {
+ $norm = -$norm;
+ }
+ for ($i = $k; $i < $this->rows; ++$i) {
+ $this->qrMatrix[$i][$k] /= $norm;
+ }
+ $this->qrMatrix[$k][$k] += 1.0;
+ // Apply transformation to remaining columns.
+ for ($j = $k + 1; $j < $this->columns; ++$j) {
+ $s = 0.0;
+ for ($i = $k; $i < $this->rows; ++$i) {
+ $s += $this->qrMatrix[$i][$k] * $this->qrMatrix[$i][$j];
+ }
+ $s = -$s / $this->qrMatrix[$k][$k];
+ for ($i = $k; $i < $this->rows; ++$i) {
+ $this->qrMatrix[$i][$j] += $s * $this->qrMatrix[$i][$k];
+ }
+ }
+ }
+ $this->rDiagonal[$k] = -$norm;
+ }
+ }
+
+ public function isFullRank(): bool
+ {
+ for ($j = 0; $j < $this->columns; ++$j) {
+ if ($this->rDiagonal[$j] == 0.0) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Least squares solution of A*X = B.
+ *
+ * @param Matrix $B a Matrix with as many rows as A and any number of columns
+ *
+ * @throws Exception
+ *
+ * @return Matrix matrix that minimizes the two norm of Q*R*X-B
+ */
+ public function solve(Matrix $B): Matrix
+ {
+ if ($B->rows !== $this->rows) {
+ throw new Exception('Matrix row dimensions are not equal');
+ }
+
+ if (!$this->isFullRank()) {
+ throw new Exception('Can only perform this operation on a full-rank matrix');
+ }
+
+ // Compute Y = transpose(Q)*B
+ $Y = $this->getQ()->transpose()
+ ->multiply($B);
+ // Solve R*X = Y;
+ return $this->getR()->inverse()
+ ->multiply($Y);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Div0Exception.php b/vendor/markbaker/matrix/classes/src/Div0Exception.php
new file mode 100644
index 0000000..eba28f8
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Div0Exception.php
@@ -0,0 +1,13 @@
+isSquare()) {
+ throw new Exception('Adjoint can only be calculated for a square matrix');
+ }
+
+ return self::getAdjoint($matrix);
+ }
+
+ /**
+ * Calculate the cofactors of the matrix
+ *
+ * @param Matrix $matrix The matrix whose cofactors we wish to calculate
+ * @return Matrix
+ *
+ * @throws Exception
+ */
+ private static function getCofactors(Matrix $matrix)
+ {
+ $cofactors = self::getMinors($matrix);
+ $dimensions = $matrix->rows;
+
+ $cof = 1;
+ for ($i = 0; $i < $dimensions; ++$i) {
+ $cofs = $cof;
+ for ($j = 0; $j < $dimensions; ++$j) {
+ $cofactors[$i][$j] *= $cofs;
+ $cofs = -$cofs;
+ }
+ $cof = -$cof;
+ }
+
+ return new Matrix($cofactors);
+ }
+
+ /**
+ * Return the cofactors of this matrix
+ *
+ * @param Matrix|array $matrix The matrix whose cofactors we wish to calculate
+ * @return Matrix
+ *
+ * @throws Exception
+ */
+ public static function cofactors($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Cofactors can only be calculated for a square matrix');
+ }
+
+ return self::getCofactors($matrix);
+ }
+
+ /**
+ * @param Matrix $matrix
+ * @param int $row
+ * @param int $column
+ * @return float
+ * @throws Exception
+ */
+ private static function getDeterminantSegment(Matrix $matrix, $row, $column)
+ {
+ $tmpMatrix = $matrix->toArray();
+ unset($tmpMatrix[$row]);
+ array_walk(
+ $tmpMatrix,
+ function (&$row) use ($column) {
+ unset($row[$column]);
+ }
+ );
+
+ return self::getDeterminant(new Matrix($tmpMatrix));
+ }
+
+ /**
+ * Calculate the determinant of the matrix
+ *
+ * @param Matrix $matrix The matrix whose determinant we wish to calculate
+ * @return float
+ *
+ * @throws Exception
+ */
+ private static function getDeterminant(Matrix $matrix)
+ {
+ $dimensions = $matrix->rows;
+ $determinant = 0;
+
+ switch ($dimensions) {
+ case 1:
+ $determinant = $matrix->getValue(1, 1);
+ break;
+ case 2:
+ $determinant = $matrix->getValue(1, 1) * $matrix->getValue(2, 2) -
+ $matrix->getValue(1, 2) * $matrix->getValue(2, 1);
+ break;
+ default:
+ for ($i = 1; $i <= $dimensions; ++$i) {
+ $det = $matrix->getValue(1, $i) * self::getDeterminantSegment($matrix, 0, $i - 1);
+ if (($i % 2) == 0) {
+ $determinant -= $det;
+ } else {
+ $determinant += $det;
+ }
+ }
+ break;
+ }
+
+ return $determinant;
+ }
+
+ /**
+ * Return the determinant of this matrix
+ *
+ * @param Matrix|array $matrix The matrix whose determinant we wish to calculate
+ * @return float
+ * @throws Exception
+ **/
+ public static function determinant($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Determinant can only be calculated for a square matrix');
+ }
+
+ return self::getDeterminant($matrix);
+ }
+
+ /**
+ * Return the diagonal of this matrix
+ *
+ * @param Matrix|array $matrix The matrix whose diagonal we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function diagonal($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Diagonal can only be extracted from a square matrix');
+ }
+
+ $dimensions = $matrix->rows;
+ $grid = Builder::createFilledMatrix(0, $dimensions, $dimensions)
+ ->toArray();
+
+ for ($i = 0; $i < $dimensions; ++$i) {
+ $grid[$i][$i] = $matrix->getValue($i + 1, $i + 1);
+ }
+
+ return new Matrix($grid);
+ }
+
+ /**
+ * Return the antidiagonal of this matrix
+ *
+ * @param Matrix|array $matrix The matrix whose antidiagonal we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function antidiagonal($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Anti-Diagonal can only be extracted from a square matrix');
+ }
+
+ $dimensions = $matrix->rows;
+ $grid = Builder::createFilledMatrix(0, $dimensions, $dimensions)
+ ->toArray();
+
+ for ($i = 0; $i < $dimensions; ++$i) {
+ $grid[$i][$dimensions - $i - 1] = $matrix->getValue($i + 1, $dimensions - $i);
+ }
+
+ return new Matrix($grid);
+ }
+
+ /**
+ * Return the identity matrix
+ * The identity matrix, or sometimes ambiguously called a unit matrix, of size n is the n × n square matrix
+ * with ones on the main diagonal and zeros elsewhere
+ *
+ * @param Matrix|array $matrix The matrix whose identity we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function identity($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Identity can only be created for a square matrix');
+ }
+
+ $dimensions = $matrix->rows;
+
+ return Builder::createIdentityMatrix($dimensions);
+ }
+
+ /**
+ * Return the inverse of this matrix
+ *
+ * @param Matrix|array $matrix The matrix whose inverse we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function inverse($matrix, string $type = 'inverse')
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception(ucfirst($type) . ' can only be calculated for a square matrix');
+ }
+
+ $determinant = self::getDeterminant($matrix);
+ if ($determinant == 0.0) {
+ throw new Div0Exception(ucfirst($type) . ' can only be calculated for a matrix with a non-zero determinant');
+ }
+
+ if ($matrix->rows == 1) {
+ return new Matrix([[1 / $matrix->getValue(1, 1)]]);
+ }
+
+ return self::getAdjoint($matrix)
+ ->multiply(1 / $determinant);
+ }
+
+ /**
+ * Calculate the minors of the matrix
+ *
+ * @param Matrix $matrix The matrix whose minors we wish to calculate
+ * @return array[]
+ *
+ * @throws Exception
+ */
+ protected static function getMinors(Matrix $matrix)
+ {
+ $minors = $matrix->toArray();
+ $dimensions = $matrix->rows;
+ if ($dimensions == 1) {
+ return $minors;
+ }
+
+ for ($i = 0; $i < $dimensions; ++$i) {
+ for ($j = 0; $j < $dimensions; ++$j) {
+ $minors[$i][$j] = self::getDeterminantSegment($matrix, $i, $j);
+ }
+ }
+
+ return $minors;
+ }
+
+ /**
+ * Return the minors of the matrix
+ * The minor of a matrix A is the determinant of some smaller square matrix, cut down from A by removing one or
+ * more of its rows or columns.
+ * Minors obtained by removing just one row and one column from square matrices (first minors) are required for
+ * calculating matrix cofactors, which in turn are useful for computing both the determinant and inverse of
+ * square matrices.
+ *
+ * @param Matrix|array $matrix The matrix whose minors we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function minors($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Minors can only be calculated for a square matrix');
+ }
+
+ return new Matrix(self::getMinors($matrix));
+ }
+
+ /**
+ * Return the trace of this matrix
+ * The trace is defined as the sum of the elements on the main diagonal (the diagonal from the upper left to the lower right)
+ * of the matrix
+ *
+ * @param Matrix|array $matrix The matrix whose trace we wish to calculate
+ * @return float
+ * @throws Exception
+ **/
+ public static function trace($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ if (!$matrix->isSquare()) {
+ throw new Exception('Trace can only be extracted from a square matrix');
+ }
+
+ $dimensions = $matrix->rows;
+ $result = 0;
+ for ($i = 1; $i <= $dimensions; ++$i) {
+ $result += $matrix->getValue($i, $i);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Return the transpose of this matrix
+ *
+ * @param Matrix|\a $matrix The matrix whose transpose we wish to calculate
+ * @return Matrix
+ **/
+ public static function transpose($matrix)
+ {
+ $matrix = self::validateMatrix($matrix);
+
+ $array = array_values(array_merge([null], $matrix->toArray()));
+ $grid = call_user_func_array(
+ 'array_map',
+ $array
+ );
+
+ return new Matrix($grid);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Matrix.php b/vendor/markbaker/matrix/classes/src/Matrix.php
new file mode 100644
index 0000000..95f55e7
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Matrix.php
@@ -0,0 +1,423 @@
+buildFromArray(array_values($grid));
+ }
+
+ /*
+ * Create a new Matrix object from an array of values
+ *
+ * @param array $grid
+ */
+ protected function buildFromArray(array $grid): void
+ {
+ $this->rows = count($grid);
+ $columns = array_reduce(
+ $grid,
+ function ($carry, $value) {
+ return max($carry, is_array($value) ? count($value) : 1);
+ }
+ );
+ $this->columns = $columns;
+
+ array_walk(
+ $grid,
+ function (&$value) use ($columns) {
+ if (!is_array($value)) {
+ $value = [$value];
+ }
+ $value = array_pad(array_values($value), $columns, null);
+ }
+ );
+
+ $this->grid = $grid;
+ }
+
+ /**
+ * Validate that a row number is a positive integer
+ *
+ * @param int $row
+ * @return int
+ * @throws Exception
+ */
+ public static function validateRow(int $row): int
+ {
+ if ((!is_numeric($row)) || (intval($row) < 1)) {
+ throw new Exception('Invalid Row');
+ }
+
+ return (int)$row;
+ }
+
+ /**
+ * Validate that a column number is a positive integer
+ *
+ * @param int $column
+ * @return int
+ * @throws Exception
+ */
+ public static function validateColumn(int $column): int
+ {
+ if ((!is_numeric($column)) || (intval($column) < 1)) {
+ throw new Exception('Invalid Column');
+ }
+
+ return (int)$column;
+ }
+
+ /**
+ * Validate that a row number falls within the set of rows for this matrix
+ *
+ * @param int $row
+ * @return int
+ * @throws Exception
+ */
+ protected function validateRowInRange(int $row): int
+ {
+ $row = static::validateRow($row);
+ if ($row > $this->rows) {
+ throw new Exception('Requested Row exceeds matrix size');
+ }
+
+ return $row;
+ }
+
+ /**
+ * Validate that a column number falls within the set of columns for this matrix
+ *
+ * @param int $column
+ * @return int
+ * @throws Exception
+ */
+ protected function validateColumnInRange(int $column): int
+ {
+ $column = static::validateColumn($column);
+ if ($column > $this->columns) {
+ throw new Exception('Requested Column exceeds matrix size');
+ }
+
+ return $column;
+ }
+
+ /**
+ * Return a new matrix as a subset of rows from this matrix, starting at row number $row, and $rowCount rows
+ * A $rowCount value of 0 will return all rows of the matrix from $row
+ * A negative $rowCount value will return rows until that many rows from the end of the matrix
+ *
+ * Note that row numbers start from 1, not from 0
+ *
+ * @param int $row
+ * @param int $rowCount
+ * @return static
+ * @throws Exception
+ */
+ public function getRows(int $row, int $rowCount = 1): Matrix
+ {
+ $row = $this->validateRowInRange($row);
+ if ($rowCount === 0) {
+ $rowCount = $this->rows - $row + 1;
+ }
+
+ return new static(array_slice($this->grid, $row - 1, (int)$rowCount));
+ }
+
+ /**
+ * Return a new matrix as a subset of columns from this matrix, starting at column number $column, and $columnCount columns
+ * A $columnCount value of 0 will return all columns of the matrix from $column
+ * A negative $columnCount value will return columns until that many columns from the end of the matrix
+ *
+ * Note that column numbers start from 1, not from 0
+ *
+ * @param int $column
+ * @param int $columnCount
+ * @return Matrix
+ * @throws Exception
+ */
+ public function getColumns(int $column, int $columnCount = 1): Matrix
+ {
+ $column = $this->validateColumnInRange($column);
+ if ($columnCount < 1) {
+ $columnCount = $this->columns + $columnCount - $column + 1;
+ }
+
+ $grid = [];
+ for ($i = $column - 1; $i < $column + $columnCount - 1; ++$i) {
+ $grid[] = array_column($this->grid, $i);
+ }
+
+ return (new static($grid))->transpose();
+ }
+
+ /**
+ * Return a new matrix as a subset of rows from this matrix, dropping rows starting at row number $row,
+ * and $rowCount rows
+ * A negative $rowCount value will drop rows until that many rows from the end of the matrix
+ * A $rowCount value of 0 will remove all rows of the matrix from $row
+ *
+ * Note that row numbers start from 1, not from 0
+ *
+ * @param int $row
+ * @param int $rowCount
+ * @return static
+ * @throws Exception
+ */
+ public function dropRows(int $row, int $rowCount = 1): Matrix
+ {
+ $this->validateRowInRange($row);
+ if ($rowCount === 0) {
+ $rowCount = $this->rows - $row + 1;
+ }
+
+ $grid = $this->grid;
+ array_splice($grid, $row - 1, (int)$rowCount);
+
+ return new static($grid);
+ }
+
+ /**
+ * Return a new matrix as a subset of columns from this matrix, dropping columns starting at column number $column,
+ * and $columnCount columns
+ * A negative $columnCount value will drop columns until that many columns from the end of the matrix
+ * A $columnCount value of 0 will remove all columns of the matrix from $column
+ *
+ * Note that column numbers start from 1, not from 0
+ *
+ * @param int $column
+ * @param int $columnCount
+ * @return static
+ * @throws Exception
+ */
+ public function dropColumns(int $column, int $columnCount = 1): Matrix
+ {
+ $this->validateColumnInRange($column);
+ if ($columnCount < 1) {
+ $columnCount = $this->columns + $columnCount - $column + 1;
+ }
+
+ $grid = $this->grid;
+ array_walk(
+ $grid,
+ function (&$row) use ($column, $columnCount) {
+ array_splice($row, $column - 1, (int)$columnCount);
+ }
+ );
+
+ return new static($grid);
+ }
+
+ /**
+ * Return a value from this matrix, from the "cell" identified by the row and column numbers
+ * Note that row and column numbers start from 1, not from 0
+ *
+ * @param int $row
+ * @param int $column
+ * @return mixed
+ * @throws Exception
+ */
+ public function getValue(int $row, int $column)
+ {
+ $row = $this->validateRowInRange($row);
+ $column = $this->validateColumnInRange($column);
+
+ return $this->grid[$row - 1][$column - 1];
+ }
+
+ /**
+ * Returns a Generator that will yield each row of the matrix in turn as a vector matrix
+ * or the value of each cell if the matrix is a column vector
+ *
+ * @return Generator|Matrix[]|mixed[]
+ */
+ public function rows(): Generator
+ {
+ foreach ($this->grid as $i => $row) {
+ yield $i + 1 => ($this->columns == 1)
+ ? $row[0]
+ : new static([$row]);
+ }
+ }
+
+ /**
+ * Returns a Generator that will yield each column of the matrix in turn as a vector matrix
+ * or the value of each cell if the matrix is a row vector
+ *
+ * @return Generator|Matrix[]|mixed[]
+ */
+ public function columns(): Generator
+ {
+ for ($i = 0; $i < $this->columns; ++$i) {
+ yield $i + 1 => ($this->rows == 1)
+ ? $this->grid[0][$i]
+ : new static(array_column($this->grid, $i));
+ }
+ }
+
+ /**
+ * Identify if the row and column dimensions of this matrix are equal,
+ * i.e. if it is a "square" matrix
+ *
+ * @return bool
+ */
+ public function isSquare(): bool
+ {
+ return $this->rows === $this->columns;
+ }
+
+ /**
+ * Identify if this matrix is a vector
+ * i.e. if it comprises only a single row or a single column
+ *
+ * @return bool
+ */
+ public function isVector(): bool
+ {
+ return $this->rows === 1 || $this->columns === 1;
+ }
+
+ /**
+ * Return the matrix as a 2-dimensional array
+ *
+ * @return array
+ */
+ public function toArray(): array
+ {
+ return $this->grid;
+ }
+
+ /**
+ * Solve A*X = B.
+ *
+ * @param Matrix $B Right hand side
+ *
+ * @throws Exception
+ *
+ * @return Matrix ... Solution if A is square, least squares solution otherwise
+ */
+ public function solve(Matrix $B): Matrix
+ {
+ if ($this->columns === $this->rows) {
+ return (new LU($this))->solve($B);
+ }
+
+ return (new QR($this))->solve($B);
+ }
+
+ protected static $getters = [
+ 'rows',
+ 'columns',
+ ];
+
+ /**
+ * Access specific properties as read-only (no setters)
+ *
+ * @param string $propertyName
+ * @return mixed
+ * @throws Exception
+ */
+ public function __get(string $propertyName)
+ {
+ $propertyName = strtolower($propertyName);
+
+ // Test for function calls
+ if (in_array($propertyName, self::$getters)) {
+ return $this->$propertyName;
+ }
+
+ throw new Exception('Property does not exist');
+ }
+
+ protected static $functions = [
+ 'adjoint',
+ 'antidiagonal',
+ 'cofactors',
+ 'determinant',
+ 'diagonal',
+ 'identity',
+ 'inverse',
+ 'minors',
+ 'trace',
+ 'transpose',
+ ];
+
+ protected static $operations = [
+ 'add',
+ 'subtract',
+ 'multiply',
+ 'divideby',
+ 'divideinto',
+ 'directsum',
+ ];
+
+ /**
+ * Returns the result of the function call or operation
+ *
+ * @param string $functionName
+ * @param mixed[] $arguments
+ * @return Matrix|float
+ * @throws Exception
+ */
+ public function __call(string $functionName, $arguments)
+ {
+ $functionName = strtolower(str_replace('_', '', $functionName));
+
+ // Test for function calls
+ if (in_array($functionName, self::$functions, true)) {
+ return Functions::$functionName($this, ...$arguments);
+ }
+ // Test for operation calls
+ if (in_array($functionName, self::$operations, true)) {
+ return Operations::$functionName($this, ...$arguments);
+ }
+ throw new Exception('Function or Operation does not exist');
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Operations.php b/vendor/markbaker/matrix/classes/src/Operations.php
new file mode 100644
index 0000000..e3d88d6
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Operations.php
@@ -0,0 +1,157 @@
+execute($matrix);
+ }
+
+ return $result->result();
+ }
+
+ public static function directsum(...$matrixValues): Matrix
+ {
+ if (count($matrixValues) < 2) {
+ throw new Exception('DirectSum operation requires at least 2 arguments');
+ }
+
+ $matrix = array_shift($matrixValues);
+
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('DirectSum arguments must be Matrix or array');
+ }
+
+ $result = new DirectSum($matrix);
+
+ foreach ($matrixValues as $matrix) {
+ $result->execute($matrix);
+ }
+
+ return $result->result();
+ }
+
+ public static function divideby(...$matrixValues): Matrix
+ {
+ if (count($matrixValues) < 2) {
+ throw new Exception('Division operation requires at least 2 arguments');
+ }
+
+ $matrix = array_shift($matrixValues);
+
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Division arguments must be Matrix or array');
+ }
+
+ $result = new Division($matrix);
+
+ foreach ($matrixValues as $matrix) {
+ $result->execute($matrix);
+ }
+
+ return $result->result();
+ }
+
+ public static function divideinto(...$matrixValues): Matrix
+ {
+ if (count($matrixValues) < 2) {
+ throw new Exception('Division operation requires at least 2 arguments');
+ }
+
+ $matrix = array_pop($matrixValues);
+ $matrixValues = array_reverse($matrixValues);
+
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Division arguments must be Matrix or array');
+ }
+
+ $result = new Division($matrix);
+
+ foreach ($matrixValues as $matrix) {
+ $result->execute($matrix);
+ }
+
+ return $result->result();
+ }
+
+ public static function multiply(...$matrixValues): Matrix
+ {
+ if (count($matrixValues) < 2) {
+ throw new Exception('Multiplication operation requires at least 2 arguments');
+ }
+
+ $matrix = array_shift($matrixValues);
+
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Multiplication arguments must be Matrix or array');
+ }
+
+ $result = new Multiplication($matrix);
+
+ foreach ($matrixValues as $matrix) {
+ $result->execute($matrix);
+ }
+
+ return $result->result();
+ }
+
+ public static function subtract(...$matrixValues): Matrix
+ {
+ if (count($matrixValues) < 2) {
+ throw new Exception('Subtraction operation requires at least 2 arguments');
+ }
+
+ $matrix = array_shift($matrixValues);
+
+ if (is_array($matrix)) {
+ $matrix = new Matrix($matrix);
+ }
+ if (!$matrix instanceof Matrix) {
+ throw new Exception('Subtraction arguments must be Matrix or array');
+ }
+
+ $result = new Subtraction($matrix);
+
+ foreach ($matrixValues as $matrix) {
+ $result->execute($matrix);
+ }
+
+ return $result->result();
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Operators/Addition.php b/vendor/markbaker/matrix/classes/src/Operators/Addition.php
new file mode 100644
index 0000000..543f56e
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Operators/Addition.php
@@ -0,0 +1,68 @@
+addMatrix($value);
+ } elseif (is_numeric($value)) {
+ return $this->addScalar($value);
+ }
+
+ throw new Exception('Invalid argument for addition');
+ }
+
+ /**
+ * Execute the addition for a scalar
+ *
+ * @param mixed $value The numeric value to add to the current base value
+ * @return $this The operation object, allowing multiple additions to be chained
+ **/
+ protected function addScalar($value): Operator
+ {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] += $value;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Execute the addition for a matrix
+ *
+ * @param Matrix $value The numeric value to add to the current base value
+ * @return $this The operation object, allowing multiple additions to be chained
+ * @throws Exception If the provided argument is not appropriate for the operation
+ **/
+ protected function addMatrix(Matrix $value): Operator
+ {
+ $this->validateMatchingDimensions($value);
+
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] += $value->getValue($row + 1, $column + 1);
+ }
+ }
+
+ return $this;
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Operators/DirectSum.php b/vendor/markbaker/matrix/classes/src/Operators/DirectSum.php
new file mode 100644
index 0000000..cc51ef9
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Operators/DirectSum.php
@@ -0,0 +1,64 @@
+directSumMatrix($value);
+ }
+
+ throw new Exception('Invalid argument for addition');
+ }
+
+ /**
+ * Execute the direct sum for a matrix
+ *
+ * @param Matrix $value The numeric value to concatenate/direct sum with the current base value
+ * @return $this The operation object, allowing multiple additions to be chained
+ **/
+ private function directSumMatrix($value): Operator
+ {
+ $originalColumnCount = count($this->matrix[0]);
+ $originalRowCount = count($this->matrix);
+ $valColumnCount = $value->columns;
+ $valRowCount = $value->rows;
+ $value = $value->toArray();
+
+ for ($row = 0; $row < $this->rows; ++$row) {
+ $this->matrix[$row] = array_merge($this->matrix[$row], array_fill(0, $valColumnCount, 0));
+ }
+
+ $this->matrix = array_merge(
+ $this->matrix,
+ array_fill(0, $valRowCount, array_fill(0, $originalColumnCount, 0))
+ );
+
+ for ($row = $originalRowCount; $row < $originalRowCount + $valRowCount; ++$row) {
+ array_splice(
+ $this->matrix[$row],
+ $originalColumnCount,
+ $valColumnCount,
+ $value[$row - $originalRowCount]
+ );
+ }
+
+ return $this;
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Operators/Division.php b/vendor/markbaker/matrix/classes/src/Operators/Division.php
new file mode 100644
index 0000000..dbfec9d
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Operators/Division.php
@@ -0,0 +1,35 @@
+multiplyMatrix($value, $type);
+ } elseif (is_numeric($value)) {
+ return $this->multiplyScalar(1 / $value, $type);
+ }
+
+ throw new Exception('Invalid argument for division');
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Operators/Multiplication.php b/vendor/markbaker/matrix/classes/src/Operators/Multiplication.php
new file mode 100644
index 0000000..0761e46
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Operators/Multiplication.php
@@ -0,0 +1,86 @@
+multiplyMatrix($value, $type);
+ } elseif (is_numeric($value)) {
+ return $this->multiplyScalar($value, $type);
+ }
+
+ throw new Exception("Invalid argument for $type");
+ }
+
+ /**
+ * Execute the multiplication for a scalar
+ *
+ * @param mixed $value The numeric value to multiply with the current base value
+ * @return $this The operation object, allowing multiple mutiplications to be chained
+ **/
+ protected function multiplyScalar($value, string $type = 'multiplication'): Operator
+ {
+ try {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] *= $value;
+ }
+ }
+ } catch (Throwable $e) {
+ throw new Exception("Invalid argument for $type");
+ }
+
+ return $this;
+ }
+
+ /**
+ * Execute the multiplication for a matrix
+ *
+ * @param Matrix $value The numeric value to multiply with the current base value
+ * @return $this The operation object, allowing multiple mutiplications to be chained
+ * @throws Exception If the provided argument is not appropriate for the operation
+ **/
+ protected function multiplyMatrix(Matrix $value, string $type = 'multiplication'): Operator
+ {
+ $this->validateReflectingDimensions($value);
+
+ $newRows = $this->rows;
+ $newColumns = $value->columns;
+ $matrix = Builder::createFilledMatrix(0, $newRows, $newColumns)
+ ->toArray();
+ try {
+ for ($row = 0; $row < $newRows; ++$row) {
+ for ($column = 0; $column < $newColumns; ++$column) {
+ $columnData = $value->getColumns($column + 1)->toArray();
+ foreach ($this->matrix[$row] as $key => $valueData) {
+ $matrix[$row][$column] += $valueData * $columnData[$key][0];
+ }
+ }
+ }
+ } catch (Throwable $e) {
+ throw new Exception("Invalid argument for $type");
+ }
+ $this->matrix = $matrix;
+
+ return $this;
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Operators/Operator.php b/vendor/markbaker/matrix/classes/src/Operators/Operator.php
new file mode 100644
index 0000000..39e36c6
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Operators/Operator.php
@@ -0,0 +1,78 @@
+rows = $matrix->rows;
+ $this->columns = $matrix->columns;
+ $this->matrix = $matrix->toArray();
+ }
+
+ /**
+ * Compare the dimensions of the matrices being operated on to see if they are valid for addition/subtraction
+ *
+ * @param Matrix $matrix The second Matrix object on which the operation will be performed
+ * @throws Exception
+ */
+ protected function validateMatchingDimensions(Matrix $matrix): void
+ {
+ if (($this->rows != $matrix->rows) || ($this->columns != $matrix->columns)) {
+ throw new Exception('Matrices have mismatched dimensions');
+ }
+ }
+
+ /**
+ * Compare the dimensions of the matrices being operated on to see if they are valid for multiplication/division
+ *
+ * @param Matrix $matrix The second Matrix object on which the operation will be performed
+ * @throws Exception
+ */
+ protected function validateReflectingDimensions(Matrix $matrix): void
+ {
+ if ($this->columns != $matrix->rows) {
+ throw new Exception('Matrices have mismatched dimensions');
+ }
+ }
+
+ /**
+ * Return the result of the operation
+ *
+ * @return Matrix
+ */
+ public function result(): Matrix
+ {
+ return new Matrix($this->matrix);
+ }
+}
diff --git a/vendor/markbaker/matrix/classes/src/Operators/Subtraction.php b/vendor/markbaker/matrix/classes/src/Operators/Subtraction.php
new file mode 100644
index 0000000..b7e14fa
--- /dev/null
+++ b/vendor/markbaker/matrix/classes/src/Operators/Subtraction.php
@@ -0,0 +1,68 @@
+subtractMatrix($value);
+ } elseif (is_numeric($value)) {
+ return $this->subtractScalar($value);
+ }
+
+ throw new Exception('Invalid argument for subtraction');
+ }
+
+ /**
+ * Execute the subtraction for a scalar
+ *
+ * @param mixed $value The numeric value to subtracted from the current base value
+ * @return $this The operation object, allowing multiple additions to be chained
+ **/
+ protected function subtractScalar($value): Operator
+ {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] -= $value;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Execute the subtraction for a matrix
+ *
+ * @param Matrix $value The numeric value to subtract from the current base value
+ * @return $this The operation object, allowing multiple subtractions to be chained
+ * @throws Exception If the provided argument is not appropriate for the operation
+ **/
+ protected function subtractMatrix(Matrix $value): Operator
+ {
+ $this->validateMatchingDimensions($value);
+
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] -= $value->getValue($row + 1, $column + 1);
+ }
+ }
+
+ return $this;
+ }
+}
diff --git a/vendor/markbaker/matrix/composer.json b/vendor/markbaker/matrix/composer.json
new file mode 100644
index 0000000..e86a1e0
--- /dev/null
+++ b/vendor/markbaker/matrix/composer.json
@@ -0,0 +1,52 @@
+{
+ "name": "markbaker/matrix",
+ "type": "library",
+ "description": "PHP Class for working with matrices",
+ "keywords": ["matrix", "vector", "mathematics"],
+ "homepage": "https://github.com/MarkBaker/PHPMatrix",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@demon-angel.eu"
+ }
+ ],
+ "require": {
+ "php": "^7.1 || ^8.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0",
+ "phpdocumentor/phpdocumentor": "2.*",
+ "phpmd/phpmd": "2.*",
+ "sebastian/phpcpd": "^4.0",
+ "phploc/phploc": "^4.0",
+ "squizlabs/php_codesniffer": "^3.7",
+ "phpcompatibility/php-compatibility": "^9.3",
+ "dealerdirect/phpcodesniffer-composer-installer": "dev-master"
+ },
+ "autoload": {
+ "psr-4": {
+ "Matrix\\": "classes/src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "MatrixTest\\": "unitTests/classes/src/"
+ }
+ },
+ "scripts": {
+ "style": "phpcs --report-width=200 --standard=PSR2 --report=summary,full classes/src/ unitTests/classes/src -n",
+ "test": "phpunit -c phpunit.xml.dist",
+ "mess": "phpmd classes/src/ xml codesize,unusedcode,design,naming -n",
+ "lines": "phploc classes/src/ -n",
+ "cpd": "phpcpd classes/src/ -n",
+ "versions": "phpcs --report-width=200 --standard=PHPCompatibility --report=summary,full classes/src/ --runtime-set testVersion 7.2- -n",
+ "coverage": "phpunit -c phpunit.xml.dist --coverage-text --coverage-html ./build/coverage"
+ },
+ "minimum-stability": "dev",
+ "config": {
+ "allow-plugins": {
+ "dealerdirect/phpcodesniffer-composer-installer": true
+ }
+ }
+}
diff --git a/vendor/markbaker/matrix/examples/test.php b/vendor/markbaker/matrix/examples/test.php
new file mode 100644
index 0000000..071dae9
--- /dev/null
+++ b/vendor/markbaker/matrix/examples/test.php
@@ -0,0 +1,33 @@
+solve($target);
+
+echo 'X', PHP_EOL;
+var_export($X->toArray());
+echo PHP_EOL;
+
+$resolve = $matrix->multiply($X);
+
+echo 'Resolve', PHP_EOL;
+var_export($resolve->toArray());
+echo PHP_EOL;
diff --git a/vendor/markbaker/matrix/infection.json.dist b/vendor/markbaker/matrix/infection.json.dist
new file mode 100644
index 0000000..eddaa70
--- /dev/null
+++ b/vendor/markbaker/matrix/infection.json.dist
@@ -0,0 +1,17 @@
+{
+ "timeout": 1,
+ "source": {
+ "directories": [
+ "classes\/src"
+ ]
+ },
+ "logs": {
+ "text": "build/infection/text.log",
+ "summary": "build/infection/summary.log",
+ "debug": "build/infection/debug.log",
+ "perMutator": "build/infection/perMutator.md"
+ },
+ "mutators": {
+ "@default": true
+ }
+}
diff --git a/vendor/markbaker/matrix/license.md b/vendor/markbaker/matrix/license.md
new file mode 100644
index 0000000..7329058
--- /dev/null
+++ b/vendor/markbaker/matrix/license.md
@@ -0,0 +1,25 @@
+The MIT License (MIT)
+=====================
+
+Copyright © `2018` `Mark Baker`
+
+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/markbaker/matrix/phpstan.neon b/vendor/markbaker/matrix/phpstan.neon
new file mode 100644
index 0000000..3d90d49
--- /dev/null
+++ b/vendor/markbaker/matrix/phpstan.neon
@@ -0,0 +1,6 @@
+parameters:
+ ignoreErrors:
+ - '#Property [A-Za-z\\]+::\$[A-Za-z]+ has no typehint specified#'
+ - '#Method [A-Za-z\\]+::[A-Za-z]+\(\) has no return typehint specified#'
+ - '#Method [A-Za-z\\]+::[A-Za-z]+\(\) has parameter \$[A-Za-z0-9]+ with no typehint specified#'
+ checkMissingIterableValueType: false
diff --git a/vendor/phpmailer/phpmailer/COMMITMENT b/vendor/phpmailer/phpmailer/COMMITMENT
new file mode 100644
index 0000000..a687e0d
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/COMMITMENT
@@ -0,0 +1,46 @@
+GPL Cooperation Commitment
+Version 1.0
+
+Before filing or continuing to prosecute any legal proceeding or claim
+(other than a Defensive Action) arising from termination of a Covered
+License, we commit to extend to the person or entity ('you') accused
+of violating the Covered License the following provisions regarding
+cure and reinstatement, taken from GPL version 3. As used here, the
+term 'this License' refers to the specific Covered License being
+enforced.
+
+ However, if you cease all violation of this License, then your
+ license from a particular copyright holder is reinstated (a)
+ provisionally, unless and until the copyright holder explicitly
+ and finally terminates your license, and (b) permanently, if the
+ copyright holder fails to notify you of the violation by some
+ reasonable means prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+ reinstated permanently if the copyright holder notifies you of the
+ violation by some reasonable means, this is the first time you
+ have received notice of violation of this License (for any work)
+ from that copyright holder, and you cure the violation prior to 30
+ days after your receipt of the notice.
+
+We intend this Commitment to be irrevocable, and binding and
+enforceable against us and assignees of or successors to our
+copyrights.
+
+Definitions
+
+'Covered License' means the GNU General Public License, version 2
+(GPLv2), the GNU Lesser General Public License, version 2.1
+(LGPLv2.1), or the GNU Library General Public License, version 2
+(LGPLv2), all as published by the Free Software Foundation.
+
+'Defensive Action' means a legal proceeding or claim that We bring
+against you in response to a prior proceeding or claim initiated by
+you or your affiliate.
+
+'We' means each contributor to this repository as of the date of
+inclusion of this file, including subsidiaries of a corporate
+contributor.
+
+This work is available under a Creative Commons Attribution-ShareAlike
+4.0 International license (https://creativecommons.org/licenses/by-sa/4.0/).
diff --git a/vendor/phpmailer/phpmailer/LICENSE b/vendor/phpmailer/phpmailer/LICENSE
new file mode 100644
index 0000000..f166cc5
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/LICENSE
@@ -0,0 +1,502 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ , 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
\ No newline at end of file
diff --git a/vendor/phpmailer/phpmailer/README.md b/vendor/phpmailer/phpmailer/README.md
new file mode 100644
index 0000000..6535487
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/README.md
@@ -0,0 +1,232 @@
+[](https://supportukrainenow.org/)
+
+
+
+# PHPMailer – A full-featured email creation and transfer class for PHP
+
+[](https://github.com/PHPMailer/PHPMailer/actions)
+[](https://codecov.io/gh/PHPMailer/PHPMailer)
+[](https://packagist.org/packages/phpmailer/phpmailer)
+[](https://packagist.org/packages/phpmailer/phpmailer)
+[](https://packagist.org/packages/phpmailer/phpmailer)
+[](https://phpmailer.github.io/PHPMailer/)
+[](https://api.securityscorecards.dev/projects/github.com/PHPMailer/PHPMailer)
+
+## Features
+- Probably the world's most popular code for sending email from PHP!
+- Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more
+- Integrated SMTP support – send without a local mail server
+- Send emails with multiple To, CC, BCC, and Reply-to addresses
+- Multipart/alternative emails for mail clients that do not read HTML email
+- Add attachments, including inline
+- Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings
+- Full UTF-8 support when using servers that support `SMTPUTF8`.
+- Support for iCal events in multiparts and attachments
+- SMTP authentication with `LOGIN`, `PLAIN`, `CRAM-MD5`, and `XOAUTH2` mechanisms over SMTPS and SMTP+STARTTLS transports
+- Validates email addresses automatically
+- Protects against header injection attacks
+- Error messages in over 50 languages!
+- DKIM and S/MIME signing support
+- Compatible with PHP 5.5 and later, including PHP 8.4
+- Namespaced to prevent name clashes
+- Much more!
+
+## Why you might need it
+Many PHP developers need to send email from their code. The only PHP function that supports this directly is [`mail()`](https://www.php.net/manual/en/function.mail.php). However, it does not provide any assistance for making use of popular features such as authentication, HTML messages, and attachments.
+
+Formatting email correctly is surprisingly difficult. There are myriad overlapping (and conflicting) standards, requiring tight adherence to horribly complicated formatting and encoding rules – the vast majority of code that you'll find online that uses the `mail()` function directly is just plain wrong, if not unsafe!
+
+The PHP `mail()` function usually sends via a local mail server, typically fronted by a `sendmail` binary on Linux, BSD, and macOS platforms, however, Windows usually doesn't include a local mail server; PHPMailer's integrated SMTP client allows email sending on all platforms without needing a local mail server. Be aware though, that the `mail()` function should be avoided when possible; it's both faster and [safer](https://exploitbox.io/paper/Pwning-PHP-Mail-Function-For-Fun-And-RCE.html) to use SMTP to localhost.
+
+*Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that
+you should look at before rolling your own. Try [Symfony Mailer](https://symfony.com/doc/current/mailer.html), [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc.
+
+## License
+This software is distributed under the [LGPL 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution.
+
+## Installation & loading
+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": "^7.0.0"
+```
+
+or run
+
+```sh
+composer require phpmailer/phpmailer
+```
+
+Note that the `vendor` folder and the `vendor/autoload.php` script are generated by Composer; they are not part of PHPMailer.
+
+If you want to use XOAUTH2 authentication, you will also need to add a dependency on the `league/oauth2-client` and appropriate service adapters package in your `composer.json`, or take a look at
+by @decomplexity's [SendOauth2 wrapper](https://github.com/decomplexity/SendOauth2), especially if you're using Microsoft services.
+
+Alternatively, if you're not using Composer, you
+can [download PHPMailer as a zip file](https://github.com/PHPMailer/PHPMailer/archive/master.zip), (note that docs and examples are not included in the zip file), then copy the contents of the PHPMailer folder into one of the `include_path` directories specified in your PHP configuration and load each class file manually:
+
+```php
+SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
+ $mail->isSMTP(); //Send using SMTP
+ $mail->Host = 'smtp.example.com'; //Set the SMTP server to send through
+ $mail->SMTPAuth = true; //Enable SMTP authentication
+ $mail->Username = 'user@example.com'; //SMTP username
+ $mail->Password = 'secret'; //SMTP password
+ $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption
+ $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
+
+ //Recipients
+ $mail->setFrom('from@example.com', 'Mailer');
+ $mail->addAddress('joe@example.net', 'Joe User'); //Add a recipient
+ $mail->addAddress('ellen@example.com'); //Name is optional
+ $mail->addReplyTo('info@example.com', 'Information');
+ $mail->addCC('cc@example.com');
+ $mail->addBCC('bcc@example.com');
+
+ //Attachments
+ $mail->addAttachment('/var/tmp/file.tar.gz'); //Add attachments
+ $mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name
+
+ //Content
+ $mail->isHTML(true); //Set email format to HTML
+ $mail->Subject = 'Here is the subject';
+ $mail->Body = 'This is the HTML message body in bold!';
+ $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
+
+ $mail->send();
+ echo 'Message has been sent';
+} catch (Exception $e) {
+ echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
+}
+```
+
+You'll find plenty to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder, which covers many common scenarios including sending through Gmail, building contact forms, sending to mailing lists, and more.
+
+If you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to avoid sending duplicate messages. See [the mailing list example](https://github.com/PHPMailer/PHPMailer/blob/master/examples/mailing_list.phps) for further guidance.
+
+That's it. You should now be ready to use PHPMailer!
+
+## Localization
+PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder, you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this:
+
+```php
+//To load the French version
+$mail->setLanguage('fr', '/optional/path/to/language/directory/');
+```
+
+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.
+
+Examples of how to use PHPMailer for common scenarios can be found in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder. If you're looking for a good starting point, we recommend you start with [the Gmail example](https://github.com/PHPMailer/PHPMailer/tree/master/examples/gmail.phps).
+
+To reduce PHPMailer's deployed code footprint, examples are not included if you load PHPMailer via Composer or via [GitHub's zip file download](https://github.com/PHPMailer/PHPMailer/archive/master.zip), so you'll need to either clone the git repository or use the above links to get to the examples directly.
+
+Complete generated API documentation is [available online](https://phpmailer.github.io/PHPMailer/).
+
+You can generate complete API-level documentation by running `phpdoc` in the top-level folder, and documentation will appear in the `docs` folder, though you'll need to have [PHPDocumentor](https://www.phpdoc.org) installed. You may find [the unit tests](https://github.com/PHPMailer/PHPMailer/blob/master/test/PHPMailer/PHPMailerTest.php) a good reference for how to do various operations such as encryption.
+
+If the documentation doesn't cover what you need, search the [many questions on Stack Overflow](https://stackoverflow.com/questions/tagged/phpmailer), and before you ask a question about "SMTP Error: Could not connect to SMTP host.", [read the troubleshooting guide](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting).
+
+## Tests
+[PHPMailer tests](https://github.com/PHPMailer/PHPMailer/tree/master/test/) use PHPUnit 9, with [a polyfill](https://github.com/Yoast/PHPUnit-Polyfills) to let 9-style tests run on older PHPUnit and PHP versions.
+
+[](https://github.com/PHPMailer/PHPMailer/actions)
+
+If this isn't passing, is there something you can do to help?
+
+## Security
+Please disclose any vulnerabilities found responsibly – report security issues to the maintainers privately.
+
+See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) and [PHPMailer's security advisories on GitHub](https://github.com/PHPMailer/PHPMailer/security).
+
+## Contributing
+Please submit bug reports, suggestions, and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues).
+
+We're particularly interested in fixing edge cases, expanding test coverage, and updating translations.
+
+If you found a mistake in the docs, or want to add something, go ahead and amend the wiki – anyone can edit it.
+
+If you have git clones from prior to the move to the PHPMailer GitHub organisation, you'll need to update any remote URLs referencing the old GitHub location with a command like this from within your clone:
+
+```sh
+git remote set-url upstream https://github.com/PHPMailer/PHPMailer.git
+```
+
+Please *don't* use the SourceForge or Google Code projects any more; they are obsolete and no longer maintained.
+
+## Sponsorship
+Development time and resources for PHPMailer are provided by [Smartmessages.net](https://info.smartmessages.net/), the world's only privacy-first email marketing system.
+
+
+
+Donations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard cash 💰. Sponsorship through GitHub is a simple and convenient way to say "thank you" to PHPMailer's maintainers and contributors – just click the "Sponsor" button [on the project page](https://github.com/PHPMailer/PHPMailer). If your company uses PHPMailer, consider taking part in Tidelift's enterprise support programme.
+
+## PHPMailer For Enterprise
+
+Available as part of the Tidelift Subscription.
+
+The maintainers of PHPMailer and thousands of other packages are working with Tidelift to deliver commercial
+support and maintenance for the open-source packages you use to build your applications. Save time, reduce risk, and
+improve code health, while paying the maintainers of the exact packages you
+use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-phpmailer?utm_source=packagist-phpmailer-phpmailer&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
+
+## Changelog
+See [changelog](changelog.md).
+
+## History
+- PHPMailer was originally written in 2001 by Brent R. Matzelle as a [SourceForge project](https://sourceforge.net/projects/phpmailer/).
+- [Marcus Bointon](https://github.com/Synchro) (`coolbru` on SF) and Andy Prevost (`codeworxtech`) took over the project in 2004.
+- Became an Apache incubator project on Google Code in 2010, managed by Jim Jagielski.
+- Marcus created [his fork on GitHub](https://github.com/Synchro/PHPMailer) in 2008.
+- Jim and Marcus decide to join forces and use GitHub as the canonical and official repo for PHPMailer in 2013.
+- PHPMailer moves to [the PHPMailer organisation](https://github.com/PHPMailer) on GitHub in 2013.
+
+### What's changed since moving from SourceForge?
+- Official successor to the SourceForge and Google Code projects.
+- Test suite.
+- Continuous integration with GitHub Actions.
+- Composer support.
+- Public development.
+- Additional languages and language strings.
+- CRAM-MD5 authentication support.
+- Preserves full repo history of authors, commits, and branches from the original SourceForge project.
diff --git a/vendor/phpmailer/phpmailer/SECURITY.md b/vendor/phpmailer/phpmailer/SECURITY.md
new file mode 100644
index 0000000..4f34026
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/SECURITY.md
@@ -0,0 +1,37 @@
+# Security notices relating to PHPMailer
+
+Please disclose any security issues or vulnerabilities found through [Tidelift's coordinated disclosure system](https://tidelift.com/security) or to the maintainers privately.
+
+PHPMailer 6.4.1 and earlier contain a vulnerability that can result in untrusted code being called (if such code is injected into the host project's scope by other means). If the `$patternselect` parameter to `validateAddress()` is set to `'php'` (the default, defined by `PHPMailer::$validator`), and the global namespace contains a function called `php`, it will be called in preference to the built-in validator of the same name. Mitigated in PHPMailer 6.5.0 by denying the use of simple strings as validator function names. Recorded as [CVE-2021-3603](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-3603). Reported by [Vikrant Singh Chauhan](mailto:vi@hackberry.xyz) via [huntr.dev](https://www.huntr.dev/).
+
+PHPMailer versions 6.4.1 and earlier contain a possible remote code execution vulnerability through the `$lang_path` parameter of the `setLanguage()` method. If the `$lang_path` parameter is passed unfiltered from user input, it can be set to [a UNC path](https://docs.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths), and if an attacker is also able to persuade the server to load a file from that UNC path, a script file under their control may be executed. This vulnerability only applies to systems that resolve UNC paths, typically only Microsoft Windows.
+PHPMailer 6.5.0 mitigates this by no longer treating translation files as PHP code, but by parsing their text content directly. This approach avoids the possibility of executing unknown code while retaining backward compatibility. This isn't ideal, so the current translation format is deprecated and will be replaced in the next major release. Recorded as [CVE-2021-34551](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2021-34551). Reported by [Jilin Diting Information Technology Co., Ltd](https://listensec.com) via Tidelift.
+
+PHPMailer versions between 6.1.8 and 6.4.0 contain a regression of the earlier CVE-2018-19296 object injection vulnerability as a result of [a fix for Windows UNC paths in 6.1.8](https://github.com/PHPMailer/PHPMailer/commit/e2e07a355ee8ff36aba21d0242c5950c56e4c6f9). Recorded as [CVE-2020-36326](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-36326). Reported by Fariskhi Vidyan via Tidelift. 6.4.1 fixes this issue, and also enforces stricter checks for URL schemes in local path contexts.
+
+PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security.
+
+PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr.
+
+PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it is not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project.
+
+PHPMailer versions prior to 5.2.22 (released January 9th 2017) have a local file disclosure vulnerability, [CVE-2017-5223](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5223). If content passed into `msgHTML()` is sourced from unfiltered user input, relative paths can map to absolute local file paths and added as attachments. Also note that `addAttachment` (just like `file_get_contents`, `passthru`, `unlink`, etc) should not be passed user-sourced params either! Reported by Yongxiang Li of Asiasecurity.
+
+PHPMailer versions prior to 5.2.20 (released December 28th 2016) are vulnerable to [CVE-2016-10045](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10045) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10045-Vuln-Patch-Bypass.html), and patched by Paul Buonopane (@Zenexer).
+
+PHPMailer versions prior to 5.2.18 (released December 2016) are vulnerable to [CVE-2016-10033](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-10033) a remote code execution vulnerability, responsibly reported by [Dawid Golunski](https://legalhackers.com/advisories/PHPMailer-Exploit-Remote-Code-Exec-CVE-2016-10033-Vuln.html).
+
+PHPMailer versions prior to 5.2.14 (released November 2015) are vulnerable to [CVE-2015-8476](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8476) an SMTP CRLF injection bug permitting arbitrary message sending.
+
+PHPMailer versions prior to 5.2.10 (released May 2015) are vulnerable to [CVE-2008-5619](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-5619), a remote code execution vulnerability in the bundled html2text library. This file was removed in 5.2.10, so if you are using a version prior to that and make use of the html2text function, it's vitally important that you upgrade and remove this file.
+
+PHPMailer versions prior to 2.0.7 and 2.2.1 are vulnerable to [CVE-2012-0796](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-0796), an email header injection attack.
+
+Joomla 1.6.0 uses PHPMailer in an unsafe way, allowing it to reveal local file paths, reported in [CVE-2011-3747](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-3747).
+
+PHPMailer didn't sanitise the `$lang_path` parameter in `SetLanguage`. This wasn't a problem in itself, but some apps (PHPClassifieds, ATutor) also failed to sanitise user-provided parameters passed to it, permitting semi-arbitrary local file inclusion, reported in [CVE-2010-4914](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-4914), [CVE-2007-2021](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-2021) and [CVE-2006-5734](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-5734).
+
+PHPMailer 1.7.2 and earlier contained a possible DDoS vulnerability reported in [CVE-2005-1807](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2005-1807).
+
+PHPMailer 1.7 and earlier (June 2003) have a possible vulnerability in the `SendmailSend` method where shell commands may not be sanitised. Reported in [CVE-2007-3215](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-3215).
+
diff --git a/vendor/phpmailer/phpmailer/SMTPUTF8.md b/vendor/phpmailer/phpmailer/SMTPUTF8.md
new file mode 100644
index 0000000..ca284ee
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/SMTPUTF8.md
@@ -0,0 +1,48 @@
+# A short history of UTF-8 in email
+
+## Background
+
+For most of its existence, SMTP has been a 7-bit channel, only supporting US-ASCII characters. This has been a problem for many languages, especially those that use non-Latin scripts, and has led to the development of various workarounds.
+
+The first major improvement, introduced in 1994 in [RFC 1652](https://www.rfc-editor.org/rfc/rfc1652) and extended in 2011 in [RFC 6152](https://www.rfc-editor.org/rfc/rfc6152), was the addition of the `8BITMIME` SMTP extension, which allowed raw 8-bit data to be included in message bodies sent over SMTP.
+This allowed the message *contents* to contain 8-bit data, including things like UTF-8 text, even though the SMTP protocol itself was still firmly 7-bit. This worked by having the server switch to 8-bit after the headers, and then back to 7-bit after the completion of a `DATA` command.
+
+From 1996, messages could support [RFC 2047 encoding](https://www.rfc-editor.org/rfc/rfc2047), which permitted inserting characters from any character set into header *values* (but not names), but only by encoding them in somewhat unreadable ways to allow them to survive passage through a 7-bit channel. An example with a subject of "Schrödinger's cat" would be:
+
+```
+Subject: =?utf-8?Q=Schr=C3=B6dinger=92s_Cat?=
+```
+
+Here the accented `ö` is encoded as `=C3=B6`, which is the UTF-8 encoding of the 2-byte character, and the whole thing is wrapped in `=?utf-8?Q?` to indicate that it uses the UTF-8 charset and `quoted-printable` encoding. This is a bit of a hack, and not very human-friendly, but it works.
+
+Similarly, 8-bit message bodies could be encoded using the same `quoted-printable` and `base64` content transfer encoding (CTE) schemes, which preserved the 8-bit content while encoding it in a format that could survive transmission through a 7-bit channel.
+
+Domain names were originally also stuck in a 7-bit world, actually even more constrained to only a subset of the US-ASCII character set. But of course, many people want to have domains in their own language/script. Internationalized domain name (IDN) permitted this, using yet another complex encoding scheme called punycode, defined for domain names in 2003 in [RFC 3492](https://www.rfc-editor.org/rfc/rfc3492). This finally allowed the domain part (after the `@`) of email addresses to contain UTF-8, though it was actually an illusion preserved by email client applications. For example, an address of
+`user@café.example.com` translates to
+`user@xn--caf-dma.example.com` in punycode, rendering it mostly unreadable, but 7-bit friendly, and remaining compatible with email clients that don't know about IDN.
+
+The one remaining part of email that could not handle UTF-8 is the local part of email addresses (the part before the `@`).
+
+I've only mentioned UTF-8 here, but most of these approaches also allowed other character sets that were popular, such as [the ISO-8859 family](https://en.wikipedia.org/wiki/ISO/IEC_8859). However, UTF-8 solves so many problems that these other character sets are gradually falling out of favour, as UTF-8 can support all languages.
+
+This patchwork of overlapping approaches has served us well, but we have to admit that it's a mess.
+
+## SMTPUTF8
+
+`SMTPUTF8` is another SMTP extension, defined in [RFC 6531](https://www.rfc-editor.org/rfc/rfc6531) in 2012. This essentially solves the whole problem, allowing the entire SMTP conversation — commands, headers, and message bodies — to be sent in raw, unencoded UTF-8.
+
+But there's a problem with this approach: adoption. If you send a UTF-8 message to a recipient whose mail server doesn't support this format, the sender has to somehow downgrade the message to make it survive a transition to 7-bit. This is a hard problem to solve, especially since there is no way to make a 7-bit system support UTF-8 in the local parts of addresses. This downgrade problem is what held up the adoption of `SMTPUTF8` in PHPMailer for many years, but in that time the *de facto* approach has become to simply fail in that situation, and tell the recipient it's time they upgraded their mail server 😅.
+
+The vast majority of large email providers (gmail, Yahoo, Microsoft, etc), mail servers (postfix, exim, IIS, etc), and mail clients (Apple Mail, Outlook, Thunderbird, etc) now all support SMTPUTF8, so the need for backward compatibility is no longer what it was.
+
+## SMTPUTF8 in PHPMailer
+
+Several other PHP email libraries have implemented a halfway solution to `SMTPUTF8`, adding only the ability to support UTF-8 in email addresses, not elsewhere in the protocol. I wanted PHPMailer to do it "the right way", and this has taken much longer. PHPMailer now supports UTF-8 everywhere, and does not need to use transfer or header encodings for UTF-8 text when connecting to an `SMTPUTF8`-capable mail server.
+
+This support is handled automatically: if you add an email address that requires UTF-8, PHPMailer will use UTF-8 for everything. If not, it will fall back to 7-bit and encode the message as necessary.
+
+The one place you will need to be careful is in the selection of the address validator. By default, PHPMailer uses PHP's built-in `filter_var` validator, which does not allow UTF-8 email addresses. When PHPMailer spots that you have submitted a UTF-8 address, but have not altered the default validator, it will automatically switch to using a UTF-8-compatible validator. As soon as you do this, any SMTP connection you make will *require* that the server you connect to supports `SMTPUTF8`. You can select this validator explicitly by setting `PHPMailer::$validator = 'eai'` (an acronym for Email Address Internationalization).
+
+### Postfix gotcha
+
+Postfix has supported `SMTPUTF8` for a long time, but it has a peculiarity that it does not always advertise that it does so. However, rather surprisingly, if you use UTF-8 in the conversation, it will work anyway.
diff --git a/vendor/phpmailer/phpmailer/VERSION b/vendor/phpmailer/phpmailer/VERSION
new file mode 100644
index 0000000..66ce77b
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/VERSION
@@ -0,0 +1 @@
+7.0.0
diff --git a/vendor/phpmailer/phpmailer/composer.json b/vendor/phpmailer/phpmailer/composer.json
new file mode 100644
index 0000000..e762d59
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/composer.json
@@ -0,0 +1,82 @@
+{
+ "name": "phpmailer/phpmailer",
+ "type": "library",
+ "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
+ "authors": [
+ {
+ "name": "Marcus Bointon",
+ "email": "phpmailer@synchromedia.co.uk"
+ },
+ {
+ "name": "Jim Jagielski",
+ "email": "jimjag@gmail.com"
+ },
+ {
+ "name": "Andy Prevost",
+ "email": "codeworxtech@users.sourceforge.net"
+ },
+ {
+ "name": "Brent R. Matzelle"
+ }
+ ],
+ "funding": [
+ {
+ "url": "https://github.com/Synchro",
+ "type": "github"
+ }
+ ],
+ "config": {
+ "allow-plugins": {
+ "dealerdirect/phpcodesniffer-composer-installer": true
+ },
+ "lock": false
+ },
+ "require": {
+ "php": ">=5.5.0",
+ "ext-ctype": "*",
+ "ext-filter": "*",
+ "ext-hash": "*"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^1.0",
+ "doctrine/annotations": "^1.2.6 || ^1.13.3",
+ "php-parallel-lint/php-console-highlighter": "^1.0.0",
+ "php-parallel-lint/php-parallel-lint": "^1.3.2",
+ "phpcompatibility/php-compatibility": "^9.3.5",
+ "roave/security-advisories": "dev-latest",
+ "squizlabs/php_codesniffer": "^3.7.2",
+ "yoast/phpunit-polyfills": "^1.0.4"
+ },
+ "suggest": {
+ "decomplexity/SendOauth2": "Adapter for using XOAUTH2 authentication",
+ "ext-imap": "Needed to support advanced email address parsing according to RFC822",
+ "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
+ "ext-openssl": "Needed for secure SMTP sending and DKIM signing",
+ "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
+ "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
+ "league/oauth2-google": "Needed for Google XOAUTH2 authentication",
+ "psr/log": "For optional PSR-3 debug logging",
+ "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"
+ },
+ "autoload": {
+ "psr-4": {
+ "PHPMailer\\PHPMailer\\": "src/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "PHPMailer\\Test\\": "test/"
+ }
+ },
+ "license": "LGPL-2.1-only",
+ "scripts": {
+ "check": "./vendor/bin/phpcs",
+ "style": "./vendor/bin/phpcbf",
+ "test": "./vendor/bin/phpunit --no-coverage",
+ "coverage": "./vendor/bin/phpunit",
+ "lint": [
+ "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . --show-deprecated -e php,phps --exclude vendor --exclude .git --exclude build"
+ ]
+ }
+}
diff --git a/vendor/phpmailer/phpmailer/get_oauth_token.php b/vendor/phpmailer/phpmailer/get_oauth_token.php
new file mode 100644
index 0000000..0e54a00
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/get_oauth_token.php
@@ -0,0 +1,182 @@
+
+ * @author Jim Jagielski (jimjag)
+ * @author Andy Prevost (codeworxtech)
+ * @author Brent R. Matzelle (original founder)
+ * @copyright 2012 - 2020 Marcus Bointon
+ * @copyright 2010 - 2012 Jim Jagielski
+ * @copyright 2004 - 2009 Andy Prevost
+ * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
+ * @note This program is distributed in the hope that it will be useful - WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+/**
+ * Get an OAuth2 token from an OAuth2 provider.
+ * * Install this script on your server so that it's accessible
+ * as [https/http]:////get_oauth_token.php
+ * e.g.: http://localhost/phpmailer/get_oauth_token.php
+ * * Ensure dependencies are installed with 'composer install'
+ * * Set up an app in your Google/Yahoo/Microsoft account
+ * * Set the script address as the app's redirect URL
+ * If no refresh token is obtained when running this file,
+ * revoke access to your app and run the script again.
+ */
+
+namespace PHPMailer\PHPMailer;
+
+/**
+ * Aliases for League Provider Classes
+ * Make sure you have added these to your composer.json and run `composer install`
+ * Plenty to choose from here:
+ * @see https://oauth2-client.thephpleague.com/providers/thirdparty/
+ */
+//@see https://github.com/thephpleague/oauth2-google
+use League\OAuth2\Client\Provider\Google;
+//@see https://packagist.org/packages/hayageek/oauth2-yahoo
+use Hayageek\OAuth2\Client\Provider\Yahoo;
+//@see https://github.com/stevenmaguire/oauth2-microsoft
+use Stevenmaguire\OAuth2\Client\Provider\Microsoft;
+//@see https://github.com/greew/oauth2-azure-provider
+use Greew\OAuth2\Client\Provider\Azure;
+
+if (!isset($_GET['code']) && !isset($_POST['provider'])) {
+ ?>
+
+
+
+
+
+ $clientId,
+ 'clientSecret' => $clientSecret,
+ 'redirectUri' => $redirectUri,
+ 'accessType' => 'offline'
+];
+
+$options = [];
+$provider = null;
+
+switch ($providerName) {
+ case 'Google':
+ $provider = new Google($params);
+ $options = [
+ 'scope' => [
+ 'https://mail.google.com/'
+ ]
+ ];
+ break;
+ case 'Yahoo':
+ $provider = new Yahoo($params);
+ break;
+ case 'Microsoft':
+ $provider = new Microsoft($params);
+ $options = [
+ 'scope' => [
+ 'wl.imap',
+ 'wl.offline_access'
+ ]
+ ];
+ break;
+ case 'Azure':
+ $params['tenantId'] = $tenantId;
+
+ $provider = new Azure($params);
+ $options = [
+ 'scope' => [
+ 'https://outlook.office.com/SMTP.Send',
+ 'offline_access'
+ ]
+ ];
+ break;
+}
+
+if (null === $provider) {
+ exit('Provider missing');
+}
+
+if (!isset($_GET['code'])) {
+ //If we don't have an authorization code then get one
+ $authUrl = $provider->getAuthorizationUrl($options);
+ $_SESSION['oauth2state'] = $provider->getState();
+ header('Location: ' . $authUrl);
+ exit;
+ //Check given state against previously stored one to mitigate CSRF attack
+} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {
+ unset($_SESSION['oauth2state']);
+ unset($_SESSION['provider']);
+ exit('Invalid state');
+} else {
+ unset($_SESSION['provider']);
+ //Try to get an access token (using the authorization code grant)
+ $token = $provider->getAccessToken(
+ 'authorization_code',
+ [
+ 'code' => $_GET['code']
+ ]
+ );
+ //Use this to interact with an API on the users behalf
+ //Use this to get a new access token if the old one expires
+ echo 'Refresh Token: ', htmlspecialchars($token->getRefreshToken());
+}
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php
new file mode 100644
index 0000000..0b2a72d
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php
@@ -0,0 +1,26 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'خطأ SMTP : لا يمكن تأكيد الهوية.';
+$PHPMAILER_LANG['connect_host'] = 'خطأ SMTP: لا يمكن الاتصال بالخادم SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'خطأ SMTP: لم يتم قبول المعلومات .';
+$PHPMAILER_LANG['empty_message'] = 'نص الرسالة فارغ';
+$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: ';
+$PHPMAILER_LANG['execute'] = 'لا يمكن تنفيذ : ';
+$PHPMAILER_LANG['file_access'] = 'لا يمكن الوصول للملف: ';
+$PHPMAILER_LANG['file_open'] = 'خطأ في الملف: لا يمكن فتحه: ';
+$PHPMAILER_LANG['from_failed'] = 'خطأ على مستوى عنوان المرسل : ';
+$PHPMAILER_LANG['instantiate'] = 'لا يمكن توفير خدمة البريد.';
+$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 Connect() غير ممكن.';
+$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'لا يمكن تعيين أو إعادة تعيين متغير: ';
+$PHPMAILER_LANG['extension_missing'] = 'الإضافة غير موجودة: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php
new file mode 100644
index 0000000..327dfba
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-as.php
@@ -0,0 +1,35 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP ত্ৰুটি: প্ৰমাণীকৰণ কৰিব নোৱাৰি';
+$PHPMAILER_LANG['buggy_php'] = 'আপোনাৰ PHP সংস্কৰণ এটা বাগৰ দ্বাৰা প্ৰভাৱিত হয় যাৰ ফলত নষ্ট বাৰ্তা হব পাৰে । ইয়াক সমাধান কৰিবলে, প্ৰেৰণ কৰিবলে SMTP ব্যৱহাৰ কৰক, আপোনাৰ php.ini ত mail.add_x_header বিকল্প নিষ্ক্ৰিয় কৰক, MacOS বা Linux লৈ সলনি কৰক, বা আপোনাৰ PHP সংস্কৰণ 7.0.17+ বা 7.1.3+ লৈ সলনি কৰক ।';
+$PHPMAILER_LANG['connect_host'] = 'SMTP ত্ৰুটি: SMTP চাৰ্ভাৰৰ সৈতে সংযোগ কৰিবলে অক্ষম';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP ত্ৰুটি: তথ্য গ্ৰহণ কৰা হোৱা নাই';
+$PHPMAILER_LANG['empty_message'] = 'বাৰ্তাৰ মূখ্য অংশ খালী।';
+$PHPMAILER_LANG['encoding'] = 'অজ্ঞাত এনকোডিং: ';
+$PHPMAILER_LANG['execute'] = 'এক্সিকিউট কৰিব নোৱাৰি: ';
+$PHPMAILER_LANG['extension_missing'] = 'সম্প্ৰসাৰণ নোহোৱা হৈছে: ';
+$PHPMAILER_LANG['file_access'] = 'ফাইল অভিগম কৰিবলে অক্ষম: ';
+$PHPMAILER_LANG['file_open'] = 'ফাইল ত্ৰুটি: ফাইল খোলিবলৈ অক্ষম: ';
+$PHPMAILER_LANG['from_failed'] = 'নিম্নলিখিত প্ৰেৰকৰ ঠিকনা(সমূহ) ব্যৰ্থ: ';
+$PHPMAILER_LANG['instantiate'] = 'মেইল ফাংচনৰ এটা উদাহৰণ সৃষ্টি কৰিবলে অক্ষম';
+$PHPMAILER_LANG['invalid_address'] = 'প্ৰেৰণ কৰিব নোৱাৰি: অবৈধ ইমেইল ঠিকনা: ';
+$PHPMAILER_LANG['invalid_header'] = 'অবৈধ হেডাৰৰ নাম বা মান';
+$PHPMAILER_LANG['invalid_hostentry'] = 'অবৈধ হোষ্টেন্ট্ৰি: ';
+$PHPMAILER_LANG['invalid_host'] = 'অবৈধ হস্ট:';
+$PHPMAILER_LANG['mailer_not_supported'] = 'মেইলাৰ সমৰ্থিত নহয়।';
+$PHPMAILER_LANG['provide_address'] = 'আপুনি অন্ততঃ এটা গন্তব্য ইমেইল ঠিকনা দিব লাগিব';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP ত্ৰুটি: নিম্নলিখিত গন্তব্যস্থানসমূহ ব্যৰ্থ: ';
+$PHPMAILER_LANG['signing'] = 'স্বাক্ষৰ কৰাত ব্যৰ্থ: ';
+$PHPMAILER_LANG['smtp_code'] = 'SMTP কড: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'অতিৰিক্ত SMTP তথ্য: ';
+$PHPMAILER_LANG['smtp_detail'] = 'বিৱৰণ:';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP সংযোগ() ব্যৰ্থ';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP চাৰ্ভাৰৰ ত্ৰুটি: ';
+$PHPMAILER_LANG['variable_set'] = 'চলক নিৰ্ধাৰণ কৰিব পৰা নগল: ';
+$PHPMAILER_LANG['extension_missing'] = 'অনুপস্থিত সম্প্ৰসাৰণ: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php
new file mode 100644
index 0000000..552167e
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela prijava.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Nije moguće spojiti se sa SMTP serverom.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.';
+$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.';
+$PHPMAILER_LANG['encoding'] = 'Nepoznata kriptografija: ';
+$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: ';
+$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: ';
+$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: ';
+$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje sa navedenih e-mail adresa nije uspjelo: ';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedene e-mail adrese nije uspjelo: ';
+$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.';
+$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.';
+$PHPMAILER_LANG['provide_address'] = 'Definišite barem jednu adresu primaoca.';
+$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP server nije uspjelo.';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP greška: ';
+$PHPMAILER_LANG['variable_set'] = 'Nije moguće postaviti varijablu ili je vratiti nazad: ';
+$PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php
new file mode 100644
index 0000000..9e92dda
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'Памылка SMTP: памылка ідэнтыфікацыі.';
+$PHPMAILER_LANG['connect_host'] = 'Памылка SMTP: нельга ўстанавіць сувязь з SMTP-серверам.';
+$PHPMAILER_LANG['data_not_accepted'] = 'Памылка SMTP: звесткі непрынятыя.';
+$PHPMAILER_LANG['empty_message'] = 'Пустое паведамленне.';
+$PHPMAILER_LANG['encoding'] = 'Невядомая кадыроўка тэксту: ';
+$PHPMAILER_LANG['execute'] = 'Нельга выканаць каманду: ';
+$PHPMAILER_LANG['file_access'] = 'Няма доступу да файла: ';
+$PHPMAILER_LANG['file_open'] = 'Нельга адкрыць файл: ';
+$PHPMAILER_LANG['from_failed'] = 'Няправільны адрас адпраўніка: ';
+$PHPMAILER_LANG['instantiate'] = 'Нельга прымяніць функцыю mail().';
+$PHPMAILER_LANG['invalid_address'] = 'Нельга даслаць паведамленне, няправільны email атрымальніка: ';
+$PHPMAILER_LANG['provide_address'] = 'Запоўніце, калі ласка, правільны email атрымальніка.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' - паштовы сервер не падтрымліваецца.';
+$PHPMAILER_LANG['recipients_failed'] = 'Памылка SMTP: няправільныя атрымальнікі: ';
+$PHPMAILER_LANG['signing'] = 'Памылка подпісу паведамлення: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Памылка сувязі з SMTP-серверам.';
+$PHPMAILER_LANG['smtp_error'] = 'Памылка SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'Нельга ўстанавіць або перамяніць значэнне пераменнай: ';
+//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php
new file mode 100644
index 0000000..c41f675
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: Не може да се удостовери пред сървъра.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: Не може да се свърже с SMTP хоста.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: данните не са приети.';
+$PHPMAILER_LANG['empty_message'] = 'Съдържанието на съобщението е празно';
+$PHPMAILER_LANG['encoding'] = 'Неизвестно кодиране: ';
+$PHPMAILER_LANG['execute'] = 'Не може да се изпълни: ';
+$PHPMAILER_LANG['file_access'] = 'Няма достъп до файл: ';
+$PHPMAILER_LANG['file_open'] = 'Файлова грешка: Не може да се отвори файл: ';
+$PHPMAILER_LANG['from_failed'] = 'Следните адреси за подател са невалидни: ';
+$PHPMAILER_LANG['instantiate'] = 'Не може да се инстанцира функцията mail.';
+$PHPMAILER_LANG['invalid_address'] = 'Невалиден адрес: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенски сървър не се поддържа.';
+$PHPMAILER_LANG['provide_address'] = 'Трябва да предоставите поне един email адрес за получател.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: Следните адреси за Получател са невалидни: ';
+$PHPMAILER_LANG['signing'] = 'Грешка при подписване: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP провален connect().';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP сървърна грешка: ';
+$PHPMAILER_LANG['variable_set'] = 'Не може да се установи или възстанови променлива: ';
+$PHPMAILER_LANG['extension_missing'] = 'Липсва разширение: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php
new file mode 100644
index 0000000..4736510
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-bn.php
@@ -0,0 +1,35 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP ত্রুটি: প্রমাণীকরণ করতে অক্ষম৷';
+$PHPMAILER_LANG['buggy_php'] = 'আপনার PHP সংস্করণ একটি বাগ দ্বারা প্রভাবিত হয় যার ফলে দূষিত বার্তা হতে পারে। এটি ঠিক করতে, পাঠাতে SMTP ব্যবহার করুন, আপনার php.ini এ mail.add_x_header বিকল্পটি নিষ্ক্রিয় করুন, MacOS বা Linux-এ স্যুইচ করুন, অথবা আপনার PHP সংস্করণকে 7.0.17+ বা 7.1.3+ এ পরিবর্তন করুন।';
+$PHPMAILER_LANG['connect_host'] = 'SMTP ত্রুটি: SMTP সার্ভারের সাথে সংযোগ করতে অক্ষম৷';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP ত্রুটি: ডেটা গ্রহণ করা হয়নি৷';
+$PHPMAILER_LANG['empty_message'] = 'বার্তার অংশটি খালি।';
+$PHPMAILER_LANG['encoding'] = 'অজানা এনকোডিং: ';
+$PHPMAILER_LANG['execute'] = 'নির্বাহ করতে অক্ষম: ';
+$PHPMAILER_LANG['extension_missing'] = 'এক্সটেনশন অনুপস্থিত:';
+$PHPMAILER_LANG['file_access'] = 'ফাইল অ্যাক্সেস করতে অক্ষম: ';
+$PHPMAILER_LANG['file_open'] = 'ফাইল ত্রুটি: ফাইল খুলতে অক্ষম: ';
+$PHPMAILER_LANG['from_failed'] = 'নিম্নলিখিত প্রেরকের ঠিকানা(গুলি) ব্যর্থ হয়েছে: ';
+$PHPMAILER_LANG['instantiate'] = 'মেল ফাংশনের একটি উদাহরণ তৈরি করতে অক্ষম৷';
+$PHPMAILER_LANG['invalid_address'] = 'পাঠাতে অক্ষম: অবৈধ ইমেল ঠিকানা: ';
+$PHPMAILER_LANG['invalid_header'] = 'অবৈধ হেডার নাম বা মান';
+$PHPMAILER_LANG['invalid_hostentry'] = 'অবৈধ হোস্টেন্ট্রি: ';
+$PHPMAILER_LANG['invalid_host'] = 'অবৈধ হোস্ট:';
+$PHPMAILER_LANG['mailer_not_supported'] = 'মেইলার সমর্থিত নয়।';
+$PHPMAILER_LANG['provide_address'] = 'আপনাকে অবশ্যই অন্তত একটি গন্তব্য ইমেল ঠিকানা প্রদান করতে হবে৷';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP ত্রুটি: নিম্নলিখিত গন্তব্যগুলি ব্যর্থ হয়েছে: ';
+$PHPMAILER_LANG['signing'] = 'স্বাক্ষর করতে ব্যর্থ হয়েছে: ';
+$PHPMAILER_LANG['smtp_code'] = 'SMTP কোড: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'অতিরিক্ত SMTP তথ্য:';
+$PHPMAILER_LANG['smtp_detail'] = 'বর্ণনা: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP সংযোগ() ব্যর্থ হয়েছে৷';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP সার্ভার ত্রুটি: ';
+$PHPMAILER_LANG['variable_set'] = 'পরিবর্তনশীল সেট করা যায়নি: ';
+$PHPMAILER_LANG['extension_missing'] = 'অনুপস্থিত এক্সটেনশন: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php
new file mode 100644
index 0000000..3468485
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No s’ha pogut autenticar.';
+$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al servidor SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Dades no acceptades.';
+$PHPMAILER_LANG['empty_message'] = 'El cos del missatge està buit.';
+$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: ';
+$PHPMAILER_LANG['execute'] = 'No es pot executar: ';
+$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l’arxiu: ';
+$PHPMAILER_LANG['file_open'] = 'Error d’Arxiu: No es pot obrir l’arxiu: ';
+$PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: ';
+$PHPMAILER_LANG['instantiate'] = 'No s’ha pogut crear una instància de la funció Mail.';
+$PHPMAILER_LANG['invalid_address'] = 'Adreça d’email invalida: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat';
+$PHPMAILER_LANG['provide_address'] = 'S’ha de proveir almenys una adreça d’email com a destinatari.';
+$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: ';
+$PHPMAILER_LANG['signing'] = 'Error al signar: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Ha fallat el SMTP Connect().';
+$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'No s’ha pogut establir o restablir la variable: ';
+//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php
new file mode 100644
index 0000000..e770a1a
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php
@@ -0,0 +1,28 @@
+
+ * Rewrite and extension of the work by Mikael Stokkebro
+ *
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP fejl: Login mislykkedes.';
+$PHPMAILER_LANG['buggy_php'] = 'Din version af PHP er berørt af en fejl, som gør at dine beskeder muligvis vises forkert. For at rette dette kan du skifte til SMTP, slå mail.add_x_header headeren i din php.ini fil fra, skifte til MacOS eller Linux eller opgradere din version af PHP til 7.0.17+ eller 7.1.3+.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP fejl: Forbindelse til SMTP serveren kunne ikke oprettes.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret.';
+$PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold';
+$PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: ';
+$PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: ';
+$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: ';
+$PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: ';
+$PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: ';
+$PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: ';
+$PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.';
+$PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: ';
+$PHPMAILER_LANG['invalid_header'] = 'Ugyldig header navn eller værdi';
+$PHPMAILER_LANG['invalid_hostentry'] = 'Ugyldig hostentry: ';
+$PHPMAILER_LANG['invalid_host'] = 'Ugyldig vært: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.';
+$PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere fejlede: ';
+$PHPMAILER_LANG['signing'] = 'Signeringsfejl: ';
+$PHPMAILER_LANG['smtp_code'] = 'SMTP kode: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'Yderligere SMTP info: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.';
+$PHPMAILER_LANG['smtp_detail'] = 'Detalje: ';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: ';
+$PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php
new file mode 100644
index 0000000..e7e59d2
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php
@@ -0,0 +1,28 @@
+
+ * @author Crystopher Glodzienski Cardoso
+ * @author Daniel Cruz
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.';
+$PHPMAILER_LANG['buggy_php'] = 'Tu versión de PHP ha sido afectada por un bug que puede resultar en mensajes corruptos. Para arreglarlo, cambia a enviar usando SMTP, deshabilita la opción mail.add_x_header en tu php.ini, cambia a MacOS o Linux, o actualiza tu PHP a la versión 7.0.17+ o 7.1.3+.';
+$PHPMAILER_LANG['connect_host'] = 'Error SMTP: Imposible conectar al servidor SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Datos no aceptados.';
+$PHPMAILER_LANG['empty_message'] = 'El cuerpo del mensaje está vacío.';
+$PHPMAILER_LANG['encoding'] = 'Codificación desconocida: ';
+$PHPMAILER_LANG['execute'] = 'Imposible ejecutar: ';
+$PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: ';
+$PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: ';
+$PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: ';
+$PHPMAILER_LANG['from_failed'] = 'La siguiente dirección de remitente falló: ';
+$PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.';
+$PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: ';
+$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido';
+$PHPMAILER_LANG['invalid_hostentry'] = 'Hostentry inválido: ';
+$PHPMAILER_LANG['invalid_host'] = 'Host inválido: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.';
+$PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.';
+$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: ';
+$PHPMAILER_LANG['signing'] = 'Error al firmar: ';
+$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.';
+$PHPMAILER_LANG['smtp_detail'] = 'Detalle: ';
+$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: ';
+$PHPMAILER_LANG['imap_recommended'] = 'No se recomienda usar el analizador de direcciones simplificado. Instala la extensión IMAP de PHP para un análisis RFC822 más completo.';
+$PHPMAILER_LANG['deprecated_argument'] = 'El argumento $useimap ha quedado obsoleto';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php
new file mode 100644
index 0000000..93addc9
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php
@@ -0,0 +1,28 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.';
+$PHPMAILER_LANG['empty_message'] = 'Tühi kirja sisu';
+$PHPMAILER_LANG["encoding"] = 'Tundmatu kodeering: ';
+$PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: ';
+$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: ';
+$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: ';
+$PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: ';
+$PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.';
+$PHPMAILER_LANG['invalid_address'] = 'Saatmine peatatud, e-posti address vigane: ';
+$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: ';
+$PHPMAILER_LANG["signing"] = 'Viga allkirjastamisel: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() ebaõnnestus.';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP serveri viga: ';
+$PHPMAILER_LANG['variable_set'] = 'Ei õnnestunud määrata või lähtestada muutujat: ';
+$PHPMAILER_LANG['extension_missing'] = 'Nõutud laiendus on puudu: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php
new file mode 100644
index 0000000..295a47f
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php
@@ -0,0 +1,28 @@
+
+ * @author Mohammad Hossein Mojtahedi
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'خطای SMTP: احراز هویت با شکست مواجه شد.';
+$PHPMAILER_LANG['connect_host'] = 'خطای SMTP: اتصال به سرور SMTP برقرار نشد.';
+$PHPMAILER_LANG['data_not_accepted'] = 'خطای SMTP: دادهها نادرست هستند.';
+$PHPMAILER_LANG['empty_message'] = 'بخش متن پیام خالی است.';
+$PHPMAILER_LANG['encoding'] = 'کدگذاری ناشناخته: ';
+$PHPMAILER_LANG['execute'] = 'امکان اجرا وجود ندارد: ';
+$PHPMAILER_LANG['file_access'] = 'امکان دسترسی به فایل وجود ندارد: ';
+$PHPMAILER_LANG['file_open'] = 'خطای File: امکان بازکردن فایل وجود ندارد: ';
+$PHPMAILER_LANG['from_failed'] = 'آدرس فرستنده اشتباه است: ';
+$PHPMAILER_LANG['instantiate'] = 'امکان معرفی تابع ایمیل وجود ندارد.';
+$PHPMAILER_LANG['invalid_address'] = 'آدرس ایمیل معتبر نیست: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمیشود.';
+$PHPMAILER_LANG['provide_address'] = 'باید حداقل یک آدرس گیرنده وارد کنید.';
+$PHPMAILER_LANG['recipients_failed'] = 'خطای SMTP: ارسال به آدرس گیرنده با خطا مواجه شد: ';
+$PHPMAILER_LANG['signing'] = 'خطا در امضا: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'خطا در اتصال به SMTP.';
+$PHPMAILER_LANG['smtp_error'] = 'خطا در SMTP Server: ';
+$PHPMAILER_LANG['variable_set'] = 'امکان ارسال یا ارسال مجدد متغیرها وجود ندارد: ';
+$PHPMAILER_LANG['extension_missing'] = 'افزونه موجود نیست: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php
new file mode 100644
index 0000000..6d1e637
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP feilur: Kundi ikki góðkenna.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP feilur: Data ikki góðkent.';
+//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
+$PHPMAILER_LANG['encoding'] = 'Ókend encoding: ';
+$PHPMAILER_LANG['execute'] = 'Kundi ikki útføra: ';
+$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: ';
+$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: ';
+$PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: ';
+$PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.';
+//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.';
+$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: ';
+//$PHPMAILER_LANG['signing'] = 'Signing Error: ';
+//$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
+//$PHPMAILER_LANG['smtp_error'] = 'SMTP server error: ';
+//$PHPMAILER_LANG['variable_set'] = 'Cannot set or reset variable: ';
+//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php
new file mode 100644
index 0000000..a6d582d
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php
@@ -0,0 +1,36 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Non puido ser autentificado.';
+$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Non puido conectar co servidor SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Datos non aceptados.';
+$PHPMAILER_LANG['empty_message'] = 'Corpo da mensaxe vacía';
+$PHPMAILER_LANG['encoding'] = 'Codificación descoñecida: ';
+$PHPMAILER_LANG['execute'] = 'Non puido ser executado: ';
+$PHPMAILER_LANG['file_access'] = 'Nob puido acceder ó arquivo: ';
+$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: No puido abrir o arquivo: ';
+$PHPMAILER_LANG['from_failed'] = 'A(s) seguinte(s) dirección(s) de remitente(s) deron erro: ';
+$PHPMAILER_LANG['instantiate'] = 'Non puido crear unha instancia da función Mail.';
+$PHPMAILER_LANG['invalid_address'] = 'Non puido envia-lo correo: dirección de email inválida: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer non está soportado.';
+$PHPMAILER_LANG['provide_address'] = 'Debe engadir polo menos unha dirección de email coma destino.';
+$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Os seguintes destinos fallaron: ';
+$PHPMAILER_LANG['signing'] = 'Erro ó firmar: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallou.';
+$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'Non puidemos axustar ou reaxustar a variábel: ';
+//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php
new file mode 100644
index 0000000..b123aa5
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'שגיאת SMTP: פעולת האימות נכשלה.';
+$PHPMAILER_LANG['connect_host'] = 'שגיאת SMTP: לא הצלחתי להתחבר לשרת SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'שגיאת SMTP: מידע לא התקבל.';
+$PHPMAILER_LANG['empty_message'] = 'גוף ההודעה ריק';
+$PHPMAILER_LANG['invalid_address'] = 'כתובת שגויה: ';
+$PHPMAILER_LANG['encoding'] = 'קידוד לא מוכר: ';
+$PHPMAILER_LANG['execute'] = 'לא הצלחתי להפעיל את: ';
+$PHPMAILER_LANG['file_access'] = 'לא ניתן לגשת לקובץ: ';
+$PHPMAILER_LANG['file_open'] = 'שגיאת קובץ: לא ניתן לגשת לקובץ: ';
+$PHPMAILER_LANG['from_failed'] = 'כתובות הנמענים הבאות נכשלו: ';
+$PHPMAILER_LANG['instantiate'] = 'לא הצלחתי להפעיל את פונקציית המייל.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' אינה נתמכת.';
+$PHPMAILER_LANG['provide_address'] = 'חובה לספק לפחות כתובת אחת של מקבל המייל.';
+$PHPMAILER_LANG['recipients_failed'] = 'שגיאת SMTP: הנמענים הבאים נכשלו: ';
+$PHPMAILER_LANG['signing'] = 'שגיאת חתימה: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.';
+$PHPMAILER_LANG['smtp_error'] = 'שגיאת שרת SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'לא ניתן לקבוע או לשנות את המשתנה: ';
+//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php
new file mode 100644
index 0000000..d2856e0
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php
@@ -0,0 +1,35 @@
+
+ * Rewrite and extension of the work by Jayanti Suthar
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। ';
+$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संस्करण एक बग से प्रभावित है जिसके परिणामस्वरूप संदेश दूषित हो सकते हैं. इसे ठीक करने हेतु, भेजने के लिए SMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकल्प को अक्षम करें, MacOS या Linux पर जाए, या अपने PHP संस्करण को 7.0.17+ या 7.1.3+ बदले.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। ';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। ';
+$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। ';
+$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। ';
+$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। ';
+$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: ';
+$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। ';
+$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। ';
+$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। ';
+$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।';
+$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। ';
+$PHPMAILER_LANG['invalid_header'] = 'अमान्य हेडर नाम या मान';
+$PHPMAILER_LANG['invalid_hostentry'] = 'अमान्य hostentry: ';
+$PHPMAILER_LANG['invalid_host'] = 'अमान्य होस्ट: ';
+$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। ';
+$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। ';
+$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि: ';
+$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। ';
+$PHPMAILER_LANG['smtp_detail'] = 'विवरण: ';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। ';
+$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php
new file mode 100644
index 0000000..cacb6c3
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela autentikacija.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Ne mogu se spojiti na SMTP poslužitelj.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.';
+$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.';
+$PHPMAILER_LANG['encoding'] = 'Nepoznati encoding: ';
+$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: ';
+$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: ';
+$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: ';
+$PHPMAILER_LANG['from_failed'] = 'SMTP Greška: Slanje s navedenih e-mail adresa nije uspjelo: ';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedenih e-mail adresa nije uspjelo: ';
+$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.';
+$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.';
+$PHPMAILER_LANG['provide_address'] = 'Definirajte barem jednu adresu primatelja.';
+$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP poslužitelj nije uspjelo.';
+$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP poslužitelja: ';
+$PHPMAILER_LANG['variable_set'] = 'Ne mogu postaviti varijablu niti ju vratiti nazad: ';
+$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php
new file mode 100644
index 0000000..e6b58b0
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.';
+$PHPMAILER_LANG['empty_message'] = 'Հաղորդագրությունը դատարկ է';
+$PHPMAILER_LANG['encoding'] = 'Կոդավորման անհայտ տեսակ: ';
+$PHPMAILER_LANG['execute'] = 'Չհաջողվեց իրականացնել հրամանը: ';
+$PHPMAILER_LANG['file_access'] = 'Ֆայլը հասանելի չէ: ';
+$PHPMAILER_LANG['file_open'] = 'Ֆայլի սխալ: ֆայլը չհաջողվեց բացել: ';
+$PHPMAILER_LANG['from_failed'] = 'Ուղարկողի հետևյալ հասցեն սխալ է: ';
+$PHPMAILER_LANG['instantiate'] = 'Հնարավոր չէ կանչել mail ֆունկցիան.';
+$PHPMAILER_LANG['invalid_address'] = 'Հասցեն սխալ է: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' փոստային սերվերի հետ չի աշխատում.';
+$PHPMAILER_LANG['provide_address'] = 'Անհրաժեշտ է տրամադրել գոնե մեկ ստացողի e-mail հասցե.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP -ի սխալ: չի հաջողվել ուղարկել հետևյալ ստացողների հասցեներին: ';
+$PHPMAILER_LANG['signing'] = 'Ստորագրման սխալ: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP -ի connect() ֆունկցիան չի հաջողվել';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP սերվերի սխալ: ';
+$PHPMAILER_LANG['variable_set'] = 'Չի հաջողվում ստեղծել կամ վերափոխել փոփոխականը: ';
+$PHPMAILER_LANG['extension_missing'] = 'Հավելվածը բացակայում է: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php
new file mode 100644
index 0000000..212a11f
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php
@@ -0,0 +1,31 @@
+
+ * @author @januridp
+ * @author Ian Mustafa
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'Kesalahan SMTP: Tidak dapat mengotentikasi.';
+$PHPMAILER_LANG['connect_host'] = 'Kesalahan SMTP: Tidak dapat terhubung ke host SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'Kesalahan SMTP: Data tidak diterima.';
+$PHPMAILER_LANG['empty_message'] = 'Isi pesan kosong';
+$PHPMAILER_LANG['encoding'] = 'Pengkodean karakter tidak dikenali: ';
+$PHPMAILER_LANG['execute'] = 'Tidak dapat menjalankan proses: ';
+$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses berkas: ';
+$PHPMAILER_LANG['file_open'] = 'Kesalahan Berkas: Berkas tidak dapat dibuka: ';
+$PHPMAILER_LANG['from_failed'] = 'Alamat pengirim berikut mengakibatkan kesalahan: ';
+$PHPMAILER_LANG['instantiate'] = 'Tidak dapat menginisialisasi fungsi surel.';
+$PHPMAILER_LANG['invalid_address'] = 'Gagal terkirim, alamat surel tidak sesuai: ';
+$PHPMAILER_LANG['invalid_hostentry'] = 'Gagal terkirim, entri host tidak sesuai: ';
+$PHPMAILER_LANG['invalid_host'] = 'Gagal terkirim, host tidak sesuai: ';
+$PHPMAILER_LANG['provide_address'] = 'Harus tersedia minimal satu alamat tujuan';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tidak didukung';
+$PHPMAILER_LANG['recipients_failed'] = 'Kesalahan SMTP: Alamat tujuan berikut menyebabkan kesalahan: ';
+$PHPMAILER_LANG['signing'] = 'Kesalahan dalam penandatangan SSL: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() gagal.';
+$PHPMAILER_LANG['smtp_error'] = 'Kesalahan pada pelayan SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'Tidak dapat mengatur atau mengatur ulang variabel: ';
+$PHPMAILER_LANG['extension_missing'] = 'Ekstensi PHP tidak tersedia: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php
new file mode 100644
index 0000000..08a6b73
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php
@@ -0,0 +1,28 @@
+
+ * @author Stefano Sabatini
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dati non accettati dal server.';
+$PHPMAILER_LANG['empty_message'] = 'Il corpo del messaggio è vuoto';
+$PHPMAILER_LANG['encoding'] = 'Codifica dei caratteri sconosciuta: ';
+$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: ';
+$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: ';
+$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: ';
+$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: ';
+$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail';
+$PHPMAILER_LANG['invalid_address'] = 'Impossibile inviare, l\'indirizzo email non è valido: ';
+$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente';
+$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato un errore: ';
+$PHPMAILER_LANG['signing'] = 'Errore nella firma: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallita.';
+$PHPMAILER_LANG['smtp_error'] = 'Errore del server SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'Impossibile impostare o resettare la variabile: ';
+$PHPMAILER_LANG['extension_missing'] = 'Estensione mancante: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php
new file mode 100644
index 0000000..d01869c
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php
@@ -0,0 +1,37 @@
+
+ * @author Yoshi Sakai
+ * @author Arisophy
+ * @author ARAKI Musashi
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTPエラー: 認証できませんでした。';
+$PHPMAILER_LANG['buggy_php'] = 'ご利用のバージョンのPHPには不具合があり、メッセージが破損するおそれがあります。問題の解決は以下のいずれかを行ってください。SMTPでの送信に切り替える。php.iniのmail.add_x_headerをoffにする。MacOSまたはLinuxに切り替える。PHPバージョン7.0.17以降または7.1.3以降にアップグレードする。';
+$PHPMAILER_LANG['connect_host'] = 'SMTPエラー: SMTPホストに接続できませんでした。';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTPエラー: データが受け付けられませんでした。';
+$PHPMAILER_LANG['empty_message'] = 'メール本文が空です。';
+$PHPMAILER_LANG['encoding'] = '不明なエンコーディング: ';
+$PHPMAILER_LANG['execute'] = '実行できませんでした: ';
+$PHPMAILER_LANG['extension_missing'] = '拡張機能が見つかりません: ';
+$PHPMAILER_LANG['file_access'] = 'ファイルにアクセスできません: ';
+$PHPMAILER_LANG['file_open'] = 'ファイルエラー: ファイルを開けません: ';
+$PHPMAILER_LANG['from_failed'] = 'Fromアドレスを登録する際にエラーが発生しました: ';
+$PHPMAILER_LANG['instantiate'] = 'メール関数が正常に動作しませんでした。';
+$PHPMAILER_LANG['invalid_address'] = '不正なメールアドレス: ';
+$PHPMAILER_LANG['invalid_header'] = '不正なヘッダー名またはその内容';
+$PHPMAILER_LANG['invalid_hostentry'] = '不正なホストエントリー: ';
+$PHPMAILER_LANG['invalid_host'] = '不正なホスト: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' メーラーがサポートされていません。';
+$PHPMAILER_LANG['provide_address'] = '少なくとも1つメールアドレスを 指定する必要があります。';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTPエラー: 次の受信者アドレスに 間違いがあります: ';
+$PHPMAILER_LANG['signing'] = '署名エラー: ';
+$PHPMAILER_LANG['smtp_code'] = 'SMTPコード: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'SMTP追加情報: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP接続に失敗しました。';
+$PHPMAILER_LANG['smtp_detail'] = '詳細: ';
+$PHPMAILER_LANG['smtp_error'] = 'SMTPサーバーエラー: ';
+$PHPMAILER_LANG['variable_set'] = '変数が存在しません: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php
new file mode 100644
index 0000000..51fe403
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.';
+$PHPMAILER_LANG['encoding'] = 'კოდირების უცნობი ტიპი: ';
+$PHPMAILER_LANG['execute'] = 'შეუძლებელია შემდეგი ბრძანების შესრულება: ';
+$PHPMAILER_LANG['file_access'] = 'შეუძლებელია წვდომა ფაილთან: ';
+$PHPMAILER_LANG['file_open'] = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: ';
+$PHPMAILER_LANG['from_failed'] = 'გამგზავნის არასწორი მისამართი: ';
+$PHPMAILER_LANG['instantiate'] = 'mail ფუნქციის გაშვება ვერ ხერხდება.';
+$PHPMAILER_LANG['provide_address'] = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: ';
+$PHPMAILER_LANG['empty_message'] = 'შეტყობინება ცარიელია';
+$PHPMAILER_LANG['invalid_address'] = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: ';
+$PHPMAILER_LANG['signing'] = 'ხელმოწერის შეცდომა: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'შეცდომა SMTP სერვერთან დაკავშირებისას';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP სერვერის შეცდომა: ';
+$PHPMAILER_LANG['variable_set'] = 'შეუძლებელია შემდეგი ცვლადის შექმნა ან შეცვლა: ';
+$PHPMAILER_LANG['extension_missing'] = 'ბიბლიოთეკა არ არსებობს: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php
new file mode 100644
index 0000000..8c97dd9
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP 오류: 인증할 수 없습니다.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP 오류: SMTP 호스트에 접속할 수 없습니다.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 오류: 데이터가 받아들여지지 않았습니다.';
+$PHPMAILER_LANG['empty_message'] = '메세지 내용이 없습니다';
+$PHPMAILER_LANG['encoding'] = '알 수 없는 인코딩: ';
+$PHPMAILER_LANG['execute'] = '실행 불가: ';
+$PHPMAILER_LANG['file_access'] = '파일 접근 불가: ';
+$PHPMAILER_LANG['file_open'] = '파일 오류: 파일을 열 수 없습니다: ';
+$PHPMAILER_LANG['from_failed'] = '다음 From 주소에서 오류가 발생했습니다: ';
+$PHPMAILER_LANG['instantiate'] = 'mail 함수를 인스턴스화할 수 없습니다';
+$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'] = '변수 설정 및 초기화 불가: ';
+$PHPMAILER_LANG['extension_missing'] = '확장자 없음: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php
new file mode 100644
index 0000000..cf3bda6
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ku.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'هەڵەی SMTP : نەتوانرا کۆدەکە پشتڕاست بکرێتەوە ';
+$PHPMAILER_LANG['connect_host'] = 'هەڵەی SMTP: نەتوانرا پەیوەندی بە سێرڤەرەوە بکات SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'هەڵەی SMTP: ئەو زانیاریانە قبوڵ نەکرا.';
+$PHPMAILER_LANG['empty_message'] = 'پەیامەکە بەتاڵە';
+$PHPMAILER_LANG['encoding'] = 'کۆدکردنی نەزانراو : ';
+$PHPMAILER_LANG['execute'] = 'ناتوانرێت جێبەجێ بکرێت: ';
+$PHPMAILER_LANG['file_access'] = 'ناتوانرێت دەستت بگات بە فایلەکە: ';
+$PHPMAILER_LANG['file_open'] = 'هەڵەی پەڕگە(فایل): ناتوانرێت بکرێتەوە: ';
+$PHPMAILER_LANG['from_failed'] = 'هەڵە لە ئاستی ناونیشانی نێرەر: ';
+$PHPMAILER_LANG['instantiate'] = 'ناتوانرێت خزمەتگوزاری پۆستە پێشکەش بکرێت.';
+$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 Connect()پەیوەندی شکستی هێنا .';
+$PHPMAILER_LANG['smtp_error'] = 'هەڵەی ئاستی سێرڤەری SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'ناتوانرێت بیگۆڕیت یان دوبارە بینێریتەوە: ';
+$PHPMAILER_LANG['extension_missing'] = 'درێژکراوە نەماوە: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php
new file mode 100644
index 0000000..4f115b1
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP klaida: autentifikacija nepavyko.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP klaida: nepavyksta prisijungti prie SMTP stoties.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP klaida: duomenys nepriimti.';
+$PHPMAILER_LANG['empty_message'] = 'Laiško turinys tuščias';
+$PHPMAILER_LANG['encoding'] = 'Neatpažinta koduotė: ';
+$PHPMAILER_LANG['execute'] = 'Nepavyko įvykdyti komandos: ';
+$PHPMAILER_LANG['file_access'] = 'Byla nepasiekiama: ';
+$PHPMAILER_LANG['file_open'] = 'Bylos klaida: Nepavyksta atidaryti: ';
+$PHPMAILER_LANG['from_failed'] = 'Neteisingas siuntėjo adresas: ';
+$PHPMAILER_LANG['instantiate'] = 'Nepavyko paleisti mail funkcijos.';
+$PHPMAILER_LANG['invalid_address'] = 'Neteisingas adresas: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' pašto stotis nepalaikoma.';
+$PHPMAILER_LANG['provide_address'] = 'Nurodykite bent vieną gavėjo adresą.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP klaida: nepavyko išsiųsti šiems gavėjams: ';
+$PHPMAILER_LANG['signing'] = 'Prisijungimo klaida: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP susijungimo klaida';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP stoties klaida: ';
+$PHPMAILER_LANG['variable_set'] = 'Nepavyko priskirti reikšmės kintamajam: ';
+//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php
new file mode 100644
index 0000000..679b18c
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP kļūda: Autorizācija neizdevās.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP Kļūda: Nevar izveidot savienojumu ar SMTP serveri.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Kļūda: Nepieņem informāciju.';
+$PHPMAILER_LANG['empty_message'] = 'Ziņojuma teksts ir tukšs';
+$PHPMAILER_LANG['encoding'] = 'Neatpazīts kodējums: ';
+$PHPMAILER_LANG['execute'] = 'Neizdevās izpildīt komandu: ';
+$PHPMAILER_LANG['file_access'] = 'Fails nav pieejams: ';
+$PHPMAILER_LANG['file_open'] = 'Faila kļūda: Nevar atvērt failu: ';
+$PHPMAILER_LANG['from_failed'] = 'Nepareiza sūtītāja adrese: ';
+$PHPMAILER_LANG['instantiate'] = 'Nevar palaist sūtīšanas funkciju.';
+$PHPMAILER_LANG['invalid_address'] = 'Nepareiza adrese: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' sūtītājs netiek atbalstīts.';
+$PHPMAILER_LANG['provide_address'] = 'Lūdzu, norādiet vismaz vienu adresātu.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP kļūda: neizdevās nosūtīt šādiem saņēmējiem: ';
+$PHPMAILER_LANG['signing'] = 'Autorizācijas kļūda: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP savienojuma kļūda';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP servera kļūda: ';
+$PHPMAILER_LANG['variable_set'] = 'Nevar piešķirt mainīgā vērtību: ';
+//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php
new file mode 100644
index 0000000..8a94f6a
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'Hadisoana SMTP: Tsy nahomby ny fanamarinana.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Tsy afaka mampifandray amin\'ny mpampiantrano SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP diso: tsy voarakitra ny angona.';
+$PHPMAILER_LANG['empty_message'] = 'Tsy misy ny votoaty mailaka.';
+$PHPMAILER_LANG['encoding'] = 'Tsy fantatra encoding: ';
+$PHPMAILER_LANG['execute'] = 'Tsy afaka manatanteraka ity baiko manaraka ity: ';
+$PHPMAILER_LANG['file_access'] = 'Tsy nahomby ny fidirana amin\'ity rakitra ity: ';
+$PHPMAILER_LANG['file_open'] = 'Hadisoana diso: Tsy afaka nanokatra ity file manaraka ity: ';
+$PHPMAILER_LANG['from_failed'] = 'Ny adiresy iraka manaraka dia diso: ';
+$PHPMAILER_LANG['instantiate'] = 'Tsy afaka nanomboka ny hetsika mail.';
+$PHPMAILER_LANG['invalid_address'] = 'Tsy mety ny adiresy: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer tsy manohana.';
+$PHPMAILER_LANG['provide_address'] = 'Alefaso azafady iray adiresy iray farafahakeliny.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Tsy mety ireo mpanaraka ireto: ';
+$PHPMAILER_LANG['signing'] = 'Error nandritra ny sonia:';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Tsy nahomby ny fifandraisana tamin\'ny server SMTP.';
+$PHPMAILER_LANG['smtp_error'] = 'Fahadisoana tamin\'ny server SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'Tsy azo atao ny mametraka na mamerina ny variable: ';
+$PHPMAILER_LANG['extension_missing'] = 'Tsy hita ny ampahany: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php
new file mode 100644
index 0000000..04d262c
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-mn.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'Ralat SMTP: Tidak dapat pengesahan.';
+$PHPMAILER_LANG['connect_host'] = 'Ralat SMTP: Tidak dapat menghubungi hos pelayan SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'Ralat SMTP: Data tidak diterima oleh pelayan.';
+$PHPMAILER_LANG['empty_message'] = 'Tiada isi untuk mesej';
+$PHPMAILER_LANG['encoding'] = 'Pengekodan tidak diketahui: ';
+$PHPMAILER_LANG['execute'] = 'Tidak dapat melaksanakan: ';
+$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses fail: ';
+$PHPMAILER_LANG['file_open'] = 'Ralat Fail: Tidak dapat membuka fail: ';
+$PHPMAILER_LANG['from_failed'] = 'Berikut merupakan ralat dari alamat e-mel: ';
+$PHPMAILER_LANG['instantiate'] = 'Tidak dapat memberi contoh fungsi e-mel.';
+$PHPMAILER_LANG['invalid_address'] = 'Alamat emel tidak sah: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' jenis penghantar emel tidak disokong.';
+$PHPMAILER_LANG['provide_address'] = 'Anda perlu menyediakan sekurang-kurangnya satu alamat e-mel penerima.';
+$PHPMAILER_LANG['recipients_failed'] = 'Ralat SMTP: Penerima e-mel berikut telah gagal: ';
+$PHPMAILER_LANG['signing'] = 'Ralat pada tanda tangan: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() telah gagal.';
+$PHPMAILER_LANG['smtp_error'] = 'Ralat pada pelayan SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'Tidak boleh menetapkan atau menetapkan semula pembolehubah: ';
+$PHPMAILER_LANG['extension_missing'] = 'Sambungan hilang: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php
new file mode 100644
index 0000000..c9621a1
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php
@@ -0,0 +1,33 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.';
+$PHPMAILER_LANG['buggy_php'] = 'PHP versie gededecteerd die onderhavig is aan een bug die kan resulteren in gecorrumpeerde berichten. Om dit te voorkomen, gebruik SMTP voor het verzenden van berichten, zet de mail.add_x_header optie in uw php.ini file uit, gebruik MacOS of Linux, of pas de gebruikte PHP versie aan naar versie 7.0.17+ or 7.1.3+.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP-fout: kon niet verbinden met SMTP-host.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP-fout: data niet geaccepteerd.';
+$PHPMAILER_LANG['empty_message'] = 'Berichttekst is leeg';
+$PHPMAILER_LANG['encoding'] = 'Onbekende codering: ';
+$PHPMAILER_LANG['execute'] = 'Kon niet uitvoeren: ';
+$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: ';
+$PHPMAILER_LANG['file_access'] = 'Kreeg geen toegang tot bestand: ';
+$PHPMAILER_LANG['file_open'] = 'Bestandsfout: kon bestand niet openen: ';
+$PHPMAILER_LANG['from_failed'] = 'Het volgende afzendersadres is mislukt: ';
+$PHPMAILER_LANG['instantiate'] = 'Kon mailfunctie niet initialiseren.';
+$PHPMAILER_LANG['invalid_address'] = 'Ongeldig adres: ';
+$PHPMAILER_LANG['invalid_header'] = 'Ongeldige header naam of waarde';
+$PHPMAILER_LANG['invalid_hostentry'] = 'Ongeldige hostentry: ';
+$PHPMAILER_LANG['invalid_host'] = 'Ongeldige host: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer wordt niet ondersteund.';
+$PHPMAILER_LANG['provide_address'] = 'Er moet minstens één ontvanger worden opgegeven.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP-fout: de volgende ontvangers zijn mislukt: ';
+$PHPMAILER_LANG['signing'] = 'Signeerfout: ';
+$PHPMAILER_LANG['smtp_code'] = 'SMTP code: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'Aanvullende SMTP informatie: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Verbinding mislukt.';
+$PHPMAILER_LANG['smtp_detail'] = 'Detail: ';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: ';
+$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php
new file mode 100644
index 0000000..cb7b2c2
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php
@@ -0,0 +1,33 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Falha na autenticação.';
+$PHPMAILER_LANG['buggy_php'] = 'A sua versão do PHP tem um bug que pode causar mensagens corrompidas. Para resolver, utilize o envio por SMTP, desative a opção mail.add_x_header no ficheiro php.ini, mude para MacOS ou Linux, ou atualize o PHP para a versão 7.0.17+ ou 7.1.3+.';
+$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Não foi possível ligar ao servidor SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Dados não aceites.';
+$PHPMAILER_LANG['empty_message'] = 'A mensagem de e-mail está vazia.';
+$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
+$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
+$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: ';
+$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder ao ficheiro: ';
+$PHPMAILER_LANG['file_open'] = 'Erro ao abrir o ficheiro: ';
+$PHPMAILER_LANG['from_failed'] = 'O envio falhou para o seguinte endereço do remetente: ';
+$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.';
+$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: ';
+$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor do cabeçalho inválido.';
+$PHPMAILER_LANG['invalid_hostentry'] = 'Entrada de host inválida: ';
+$PHPMAILER_LANG['invalid_host'] = 'Host inválido: ';
+$PHPMAILER_LANG['mailer_not_supported'] = 'O cliente de e-mail não é suportado.';
+$PHPMAILER_LANG['provide_address'] = 'Deve fornecer pelo menos um endereço de destinatário.';
+$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Falha no envio para os seguintes destinatários: ';
+$PHPMAILER_LANG['signing'] = 'Erro ao assinar: ';
+$PHPMAILER_LANG['smtp_code'] = 'Código SMTP: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais SMTP: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Falha na função SMTP connect().';
+$PHPMAILER_LANG['smtp_detail'] = 'Detalhes: ';
+$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php
new file mode 100644
index 0000000..5239865
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php
@@ -0,0 +1,38 @@
+
+ * @author Lucas Guimarães
+ * @author Phelipe Alves
+ * @author Fabio Beneditto
+ * @author Geidson Benício Coelho
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.';
+$PHPMAILER_LANG['buggy_php'] = 'Sua versão do PHP é afetada por um bug que por resultar em messagens corrompidas. Para corrigir, mude para enviar usando SMTP, desative a opção mail.add_x_header em seu php.ini, mude para MacOS ou Linux, ou atualize seu PHP para versão 7.0.17+ ou 7.1.3+ ';
+$PHPMAILER_LANG['connect_host'] = 'Erro de SMTP: Não foi possível conectar ao servidor SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'Erro de SMTP: Dados rejeitados.';
+$PHPMAILER_LANG['empty_message'] = 'Mensagem vazia';
+$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: ';
+$PHPMAILER_LANG['execute'] = 'Não foi possível executar: ';
+$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: ';
+$PHPMAILER_LANG['file_access'] = 'Não foi possível acessar o arquivo: ';
+$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: Não foi possível abrir o arquivo: ';
+$PHPMAILER_LANG['from_failed'] = 'Os seguintes remetentes falharam: ';
+$PHPMAILER_LANG['instantiate'] = 'Não foi possível instanciar a função mail.';
+$PHPMAILER_LANG['invalid_address'] = 'Endereço de e-mail inválido: ';
+$PHPMAILER_LANG['invalid_header'] = 'Nome ou valor de cabeçalho inválido';
+$PHPMAILER_LANG['invalid_hostentry'] = 'hostentry inválido: ';
+$PHPMAILER_LANG['invalid_host'] = 'host inválido: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.';
+$PHPMAILER_LANG['provide_address'] = 'Você deve informar pelo menos um destinatário.';
+$PHPMAILER_LANG['recipients_failed'] = 'Erro de SMTP: Os seguintes destinatários falharam: ';
+$PHPMAILER_LANG['signing'] = 'Erro de Assinatura: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.';
+$PHPMAILER_LANG['smtp_code'] = 'Código do servidor SMTP: ';
+$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'Informações adicionais do servidor SMTP: ';
+$PHPMAILER_LANG['smtp_detail'] = 'Detalhes do servidor SMTP: ';
+$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php
new file mode 100644
index 0000000..45bef91
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php
@@ -0,0 +1,33 @@
+
+ * @author Foster Snowhill
+ * @author ProjectSoft
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: не удалось пройти аутентификацию.';
+$PHPMAILER_LANG['buggy_php'] = 'В вашей версии PHP есть ошибка, которая может привести к повреждению сообщений. Чтобы исправить, переключитесь на отправку по SMTP, отключите опцию mail.add_x_header в ваш php.ini, переключитесь на MacOS или Linux или обновите PHP до версии 7.0.17+ или 7.1.3+.';
+$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.';
+$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.';
+$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение';
+$PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: ';
+$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: ';
+$PHPMAILER_LANG['extension_missing'] = 'Расширение отсутствует: ';
+$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: ';
+$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: ';
+$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: ';
+$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().';
+$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: ';
+$PHPMAILER_LANG['invalid_header'] = 'Неверное имя или значение заголовка';
+$PHPMAILER_LANG['invalid_hostentry'] = 'Неверная запись хоста: ';
+$PHPMAILER_LANG['invalid_host'] = 'Неверный хост: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.';
+$PHPMAILER_LANG['provide_address'] = 'Вы должны указать хотя бы один адрес электронной почты получателя.';
+$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: Ошибка следующих получателей: ';
+$PHPMAILER_LANG['signing'] = 'Ошибка подписи: ';
+$PHPMAILER_LANG['smtp_code'] = 'Код SMTP: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'Дополнительная информация SMTP: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Ошибка соединения с SMTP-сервером.';
+$PHPMAILER_LANG['smtp_detail'] = 'Детали: ';
+$PHPMAILER_LANG['smtp_error'] = 'Ошибка SMTP-сервера: ';
+$PHPMAILER_LANG['variable_set'] = 'Невозможно установить или сбросить переменную: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php
new file mode 100644
index 0000000..dce502a
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-si.php
@@ -0,0 +1,34 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP දෝෂය: සත්යාපනය අසාර්ථක විය.';
+$PHPMAILER_LANG['buggy_php'] = 'ඔබගේ PHP version එකෙහි පවතින දෝෂයක් නිසා email පණිවිඩ දෝෂ සහගත වීමේ හැකියාවක් ඇත. මෙය විසදීම සදහා SMTP භාවිතා කිරීම, mail.add_x_header INI setting එක අක්රීය කිරීම, MacOS හෝ Linux වලට මාරු වීම, හෝ ඔබගේ PHP version එක 7.0.17+ හෝ 7.1.3+ වලට අලුත් කිරීම කරගන්න.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP දෝෂය: සම්බන්ධ වීමට නොහැකි විය.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP දෝෂය: දත්ත පිළිගනු නොලැබේ.';
+$PHPMAILER_LANG['empty_message'] = 'පණිවිඩ අන්තර්ගතය හිස්';
+$PHPMAILER_LANG['encoding'] = 'නොදන්නා කේතනය: ';
+$PHPMAILER_LANG['execute'] = 'ක්රියාත්මක කළ නොහැකි විය: ';
+$PHPMAILER_LANG['extension_missing'] = 'Extension එක නොමැත: ';
+$PHPMAILER_LANG['file_access'] = 'File එකට ප්රවේශ විය නොහැකි විය: ';
+$PHPMAILER_LANG['file_open'] = 'File දෝෂය: File එක විවෘත කළ නොහැක: ';
+$PHPMAILER_LANG['from_failed'] = 'පහත From ලිපිනයන් අසාර්ථක විය: ';
+$PHPMAILER_LANG['instantiate'] = 'mail function එක ක්රියාත්මක කළ නොහැක.';
+$PHPMAILER_LANG['invalid_address'] = 'වලංගු නොවන ලිපිනය: ';
+$PHPMAILER_LANG['invalid_header'] = 'වලංගු නොවන header නාමයක් හෝ අගයක්';
+$PHPMAILER_LANG['invalid_hostentry'] = 'වලංගු නොවන hostentry එකක්: ';
+$PHPMAILER_LANG['invalid_host'] = 'වලංගු නොවන host එකක්: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer සහාය නොදක්වයි.';
+$PHPMAILER_LANG['provide_address'] = 'ඔබ අවම වශයෙන් එක් ලබන්නෙකුගේ ඊමේල් ලිපිනයක් සැපයිය යුතුය.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP දෝෂය: පහත ලබන්නන් අසමත් විය: ';
+$PHPMAILER_LANG['signing'] = 'Sign කිරීමේ දෝෂය: ';
+$PHPMAILER_LANG['smtp_code'] = 'SMTP කේතය: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'අමතර SMTP තොරතුරු: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP සම්බන්ධය අසාර්ථක විය.';
+$PHPMAILER_LANG['smtp_detail'] = 'තොරතුරු: ';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP දෝෂය: ';
+$PHPMAILER_LANG['variable_set'] = 'Variable එක සැකසීමට හෝ නැවත සැකසීමට නොහැක: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php
new file mode 100644
index 0000000..028f5bc
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php
@@ -0,0 +1,30 @@
+
+ * @author Peter Orlický
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentifikácie.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nebolo možné nadviazať spojenie so SMTP serverom.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dáta neboli prijaté';
+$PHPMAILER_LANG['empty_message'] = 'Prázdne telo správy.';
+$PHPMAILER_LANG['encoding'] = 'Neznáme kódovanie: ';
+$PHPMAILER_LANG['execute'] = 'Nedá sa vykonať: ';
+$PHPMAILER_LANG['file_access'] = 'Súbor nebol nájdený: ';
+$PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre čítanie: ';
+$PHPMAILER_LANG['from_failed'] = 'Následujúca adresa From je nesprávna: ';
+$PHPMAILER_LANG['instantiate'] = 'Nedá sa vytvoriť inštancia emailovej funkcie.';
+$PHPMAILER_LANG['invalid_address'] = 'Neodoslané, emailová adresa je nesprávna: ';
+$PHPMAILER_LANG['invalid_hostentry'] = 'Záznam hostiteľa je nesprávny: ';
+$PHPMAILER_LANG['invalid_host'] = 'Hostiteľ je nesprávny: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' emailový klient nieje podporovaný.';
+$PHPMAILER_LANG['provide_address'] = 'Musíte zadať aspoň jednu emailovú adresu príjemcu.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Adresy príjemcov niesu správne ';
+$PHPMAILER_LANG['signing'] = 'Chyba prihlasovania: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zlyhalo.';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP chyba serveru: ';
+$PHPMAILER_LANG['variable_set'] = 'Nemožno nastaviť alebo resetovať premennú: ';
+$PHPMAILER_LANG['extension_missing'] = 'Chýba rozšírenie: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php
new file mode 100644
index 0000000..3e00c25
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php
@@ -0,0 +1,36 @@
+
+ * @author Filip Š
+ * @author Blaž Oražem
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.';
+$PHPMAILER_LANG['buggy_php'] = 'Na vašo PHP različico vpliva napaka, ki lahko povzroči poškodovana sporočila. Če želite težavo odpraviti, preklopite na pošiljanje prek SMTP, onemogočite možnost mail.add_x_header v vaši php.ini datoteki, preklopite na MacOS ali Linux, ali nadgradite vašo PHP zaličico na 7.0.17+ ali 7.1.3+.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP napaka: Vzpostavljanje povezave s SMTP gostiteljem ni uspelo.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP napaka: Strežnik zavrača podatke.';
+$PHPMAILER_LANG['empty_message'] = 'E-poštno sporočilo nima vsebine.';
+$PHPMAILER_LANG['encoding'] = 'Nepoznan tip kodiranja: ';
+$PHPMAILER_LANG['execute'] = 'Operacija ni uspela: ';
+$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: ';
+$PHPMAILER_LANG['file_access'] = 'Nimam dostopa do datoteke: ';
+$PHPMAILER_LANG['file_open'] = 'Ne morem odpreti datoteke: ';
+$PHPMAILER_LANG['from_failed'] = 'Neveljaven e-naslov pošiljatelja: ';
+$PHPMAILER_LANG['instantiate'] = 'Ne morem inicializirati mail funkcije.';
+$PHPMAILER_LANG['invalid_address'] = 'E-poštno sporočilo ni bilo poslano. E-naslov je neveljaven: ';
+$PHPMAILER_LANG['invalid_header'] = 'Neveljavno ime ali vrednost glave';
+$PHPMAILER_LANG['invalid_hostentry'] = 'Neveljaven vnos gostitelja: ';
+$PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.';
+$PHPMAILER_LANG['provide_address'] = 'Prosimo, vnesite vsaj enega naslovnika.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP napaka: Sledeči naslovniki so neveljavni: ';
+$PHPMAILER_LANG['signing'] = 'Napaka pri podpisovanju: ';
+$PHPMAILER_LANG['smtp_code'] = 'SMTP koda: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'Dodatne informacije o SMTP: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.';
+$PHPMAILER_LANG['smtp_detail'] = 'Podrobnosti: ';
+$PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: ';
+$PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php
new file mode 100644
index 0000000..0b5280f
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php
@@ -0,0 +1,28 @@
+
+ * @author Miloš Milanović
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: аутентификација није успела.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: повезивање са SMTP сервером није успело.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: подаци нису прихваћени.';
+$PHPMAILER_LANG['empty_message'] = 'Садржај поруке је празан.';
+$PHPMAILER_LANG['encoding'] = 'Непознато кодирање: ';
+$PHPMAILER_LANG['execute'] = 'Није могуће извршити наредбу: ';
+$PHPMAILER_LANG['file_access'] = 'Није могуће приступити датотеци: ';
+$PHPMAILER_LANG['file_open'] = 'Није могуће отворити датотеку: ';
+$PHPMAILER_LANG['from_failed'] = 'SMTP грешка: слање са следећих адреса није успело: ';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: слање на следеће адресе није успело: ';
+$PHPMAILER_LANG['instantiate'] = 'Није могуће покренути mail функцију.';
+$PHPMAILER_LANG['invalid_address'] = 'Порука није послата. Неисправна адреса: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' мејлер није подржан.';
+$PHPMAILER_LANG['provide_address'] = 'Дефинишите бар једну адресу примаоца.';
+$PHPMAILER_LANG['signing'] = 'Грешка приликом пријаве: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Повезивање са SMTP сервером није успело.';
+$PHPMAILER_LANG['smtp_error'] = 'Грешка SMTP сервера: ';
+$PHPMAILER_LANG['variable_set'] = 'Није могуће задати нити ресетовати променљиву: ';
+$PHPMAILER_LANG['extension_missing'] = 'Недостаје проширење: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php
new file mode 100644
index 0000000..6213832
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php
@@ -0,0 +1,28 @@
+
+ * @author Miloš Milanović
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP greška: autentifikacija nije uspela.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP greška: povezivanje sa SMTP serverom nije uspelo.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP greška: podaci nisu prihvaćeni.';
+$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.';
+$PHPMAILER_LANG['encoding'] = 'Nepoznato kodiranje: ';
+$PHPMAILER_LANG['execute'] = 'Nije moguće izvršiti naredbu: ';
+$PHPMAILER_LANG['file_access'] = 'Nije moguće pristupiti datoteci: ';
+$PHPMAILER_LANG['file_open'] = 'Nije moguće otvoriti datoteku: ';
+$PHPMAILER_LANG['from_failed'] = 'SMTP greška: slanje sa sledećih adresa nije uspelo: ';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP greška: slanje na sledeće adrese nije uspelo: ';
+$PHPMAILER_LANG['instantiate'] = 'Nije moguće pokrenuti mail funkciju.';
+$PHPMAILER_LANG['invalid_address'] = 'Poruka nije poslata. Neispravna adresa: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' majler nije podržan.';
+$PHPMAILER_LANG['provide_address'] = 'Definišite bar jednu adresu primaoca.';
+$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Povezivanje sa SMTP serverom nije uspelo.';
+$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP servera: ';
+$PHPMAILER_LANG['variable_set'] = 'Nije moguće zadati niti resetovati promenljivu: ';
+$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php
new file mode 100644
index 0000000..9872c19
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.';
+//$PHPMAILER_LANG['empty_message'] = 'Message body empty';
+$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: ';
+$PHPMAILER_LANG['execute'] = 'Kunde inte köra: ';
+$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: ';
+$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: ';
+$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: ';
+$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.';
+$PHPMAILER_LANG['invalid_address'] = 'Felaktig adress: ';
+$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: ';
+$PHPMAILER_LANG['signing'] = 'Signeringsfel: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP serverfel: ';
+$PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller återställa variabel: ';
+$PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php
new file mode 100644
index 0000000..d15bed1
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php
@@ -0,0 +1,28 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Hindi mapatotohanan.';
+$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Hindi makakonekta sa SMTP host.';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Ang datos ay hindi naitanggap.';
+$PHPMAILER_LANG['empty_message'] = 'Walang laman ang mensahe';
+$PHPMAILER_LANG['encoding'] = 'Hindi alam ang encoding: ';
+$PHPMAILER_LANG['execute'] = 'Hindi maisasagawa: ';
+$PHPMAILER_LANG['file_access'] = 'Hindi ma-access ang file: ';
+$PHPMAILER_LANG['file_open'] = 'File Error: Hindi mabuksan ang file: ';
+$PHPMAILER_LANG['from_failed'] = 'Ang sumusunod na address ay nabigo: ';
+$PHPMAILER_LANG['instantiate'] = 'Hindi maisimulan ang instance ng mail function.';
+$PHPMAILER_LANG['invalid_address'] = 'Hindi wasto ang address na naibigay: ';
+$PHPMAILER_LANG['mailer_not_supported'] = 'Ang mailer ay hindi suportado.';
+$PHPMAILER_LANG['provide_address'] = 'Kailangan mong magbigay ng kahit isang email address na tatanggap.';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: Ang mga sumusunod na tatanggap ay nabigo: ';
+$PHPMAILER_LANG['signing'] = 'Hindi ma-sign: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Ang SMTP connect() ay nabigo.';
+$PHPMAILER_LANG['smtp_error'] = 'Ang server ng SMTP ay nabigo: ';
+$PHPMAILER_LANG['variable_set'] = 'Hindi matatakda o ma-reset ang mga variables: ';
+$PHPMAILER_LANG['extension_missing'] = 'Nawawala ang extension: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php
new file mode 100644
index 0000000..3c45bc1
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php
@@ -0,0 +1,38 @@
+
+ * @fixed by Boris Yurchenko
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'Помилка SMTP: помилка авторизації.';
+$PHPMAILER_LANG['connect_host'] = 'Помилка SMTP: не вдається під\'єднатися до SMTP-серверу.';
+$PHPMAILER_LANG['data_not_accepted'] = 'Помилка SMTP: дані не прийнято.';
+$PHPMAILER_LANG['encoding'] = 'Невідоме кодування: ';
+$PHPMAILER_LANG['execute'] = 'Неможливо виконати команду: ';
+$PHPMAILER_LANG['file_access'] = 'Немає доступу до файлу: ';
+$PHPMAILER_LANG['file_open'] = 'Помилка файлової системи: не вдається відкрити файл: ';
+$PHPMAILER_LANG['from_failed'] = 'Невірна адреса відправника: ';
+$PHPMAILER_LANG['instantiate'] = 'Неможливо запустити функцію mail().';
+$PHPMAILER_LANG['provide_address'] = 'Будь ласка, введіть хоча б одну email-адресу отримувача.';
+$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.';
+$PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: не вдалося відправлення для таких отримувачів: ';
+$PHPMAILER_LANG['empty_message'] = 'Пусте повідомлення';
+$PHPMAILER_LANG['invalid_address'] = 'Не відправлено через неправильний формат email-адреси: ';
+$PHPMAILER_LANG['signing'] = 'Помилка підпису: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Помилка з\'єднання з SMTP-сервером';
+$PHPMAILER_LANG['smtp_error'] = 'Помилка SMTP-сервера: ';
+$PHPMAILER_LANG['variable_set'] = 'Неможливо встановити або скинути змінну: ';
+$PHPMAILER_LANG['extension_missing'] = 'Розширення відсутнє: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php
new file mode 100644
index 0000000..0b9de0f
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-ur.php
@@ -0,0 +1,30 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP خرابی: تصدیق کرنے سے قاصر۔';
+$PHPMAILER_LANG['connect_host'] = 'SMTP خرابی: سرور سے منسلک ہونے سے قاصر۔';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP خرابی: ڈیٹا قبول نہیں کیا گیا۔';
+$PHPMAILER_LANG['empty_message'] = 'پیغام کی باڈی خالی ہے۔';
+$PHPMAILER_LANG['encoding'] = 'نامعلوم انکوڈنگ: ';
+$PHPMAILER_LANG['execute'] = 'عمل کرنے کے قابل نہیں ';
+$PHPMAILER_LANG['file_access'] = 'فائل تک رسائی سے قاصر:';
+$PHPMAILER_LANG['file_open'] = 'فائل کی خرابی: فائل کو کھولنے سے قاصر:';
+$PHPMAILER_LANG['from_failed'] = 'درج ذیل بھیجنے والے کا پتہ ناکام ہو گیا:';
+$PHPMAILER_LANG['instantiate'] = 'میل فنکشن کی مثال بنانے سے قاصر۔';
+$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'] = 'متغیر سیٹ نہیں کیا جا سکا: ';
+$PHPMAILER_LANG['extension_missing'] = 'ایکٹینشن موجود نہیں ہے۔ ';
+$PHPMAILER_LANG['smtp_code'] = 'SMTP سرور کوڈ: ';
+$PHPMAILER_LANG['smtp_code_ex'] = 'اضافی SMTP سرور کی معلومات:';
+$PHPMAILER_LANG['invalid_header'] = 'غلط ہیڈر کا نام یا قدر';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php
new file mode 100644
index 0000000..d65576e
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php
@@ -0,0 +1,27 @@
+
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.';
+$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.';
+$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.';
+$PHPMAILER_LANG['empty_message'] = 'Không có nội dung';
+$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: ';
+$PHPMAILER_LANG['execute'] = 'Không thực hiện được: ';
+$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin ';
+$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: ';
+$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: ';
+$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.';
+$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng: ';
+$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.';
+$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.';
+$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: ';
+$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: ';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP';
+$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp ';
+$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: ';
+//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php
new file mode 100644
index 0000000..35e4e70
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php
@@ -0,0 +1,29 @@
+
+ * @author Peter Dave Hello <@PeterDaveHello/>
+ * @author Jason Chiang
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。';
+$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接受的資料。';
+$PHPMAILER_LANG['empty_message'] = '郵件內容為空';
+$PHPMAILER_LANG['encoding'] = '未知編碼: ';
+$PHPMAILER_LANG['execute'] = '無法執行:';
+$PHPMAILER_LANG['file_access'] = '無法存取檔案:';
+$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:';
+$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:';
+$PHPMAILER_LANG['instantiate'] = '未知函數呼叫。';
+$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'] = '無法設定或重設變數: ';
+$PHPMAILER_LANG['extension_missing'] = '遺失模組 Extension: ';
diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php
new file mode 100644
index 0000000..03d4911
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php
@@ -0,0 +1,36 @@
+
+ * @author young
+ * @author Teddysun
+ */
+
+$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。';
+$PHPMAILER_LANG['buggy_php'] = '您的 PHP 版本存在漏洞,可能会导致消息损坏。为修复此问题,请切换到使用 SMTP 发送,在您的 php.ini 中禁用 mail.add_x_header 选项。切换到 MacOS 或 Linux,或将您的 PHP 升级到 7.0.17+ 或 7.1.3+ 版本。';
+$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。';
+$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。';
+$PHPMAILER_LANG['empty_message'] = '邮件正文为空。';
+$PHPMAILER_LANG['encoding'] = '未知编码:';
+$PHPMAILER_LANG['execute'] = '无法执行:';
+$PHPMAILER_LANG['extension_missing'] = '缺少扩展名:';
+$PHPMAILER_LANG['file_access'] = '无法访问文件:';
+$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:';
+$PHPMAILER_LANG['from_failed'] = '发送地址错误:';
+$PHPMAILER_LANG['instantiate'] = '未知函数调用。';
+$PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是无效的:';
+$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。';
+$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。';
+$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:';
+$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。';
+$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:';
+$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:';
+$PHPMAILER_LANG['invalid_header'] = '无效的标题名称或值';
+$PHPMAILER_LANG['invalid_hostentry'] = '无效的hostentry: ';
+$PHPMAILER_LANG['invalid_host'] = '无效的主机:';
+$PHPMAILER_LANG['signing'] = '签名错误:';
+$PHPMAILER_LANG['smtp_code'] = 'SMTP代码: ';
+$PHPMAILER_LANG['smtp_code_ex'] = '附加SMTP信息: ';
+$PHPMAILER_LANG['smtp_detail'] = '详情:';
diff --git a/vendor/phpmailer/phpmailer/src/DSNConfigurator.php b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php
new file mode 100644
index 0000000..7058c1f
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/src/DSNConfigurator.php
@@ -0,0 +1,245 @@
+
+ * @author Jim Jagielski (jimjag)
+ * @author Andy Prevost (codeworxtech)
+ * @author Brent R. Matzelle (original founder)
+ * @copyright 2012 - 2023 Marcus Bointon
+ * @copyright 2010 - 2012 Jim Jagielski
+ * @copyright 2004 - 2009 Andy Prevost
+ * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
+ * @note This program is distributed in the hope that it will be useful - WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+namespace PHPMailer\PHPMailer;
+
+/**
+ * Configure PHPMailer with DSN string.
+ *
+ * @see https://en.wikipedia.org/wiki/Data_source_name
+ *
+ * @author Oleg Voronkovich
+ */
+class DSNConfigurator
+{
+ /**
+ * Create new PHPMailer instance configured by DSN.
+ *
+ * @param string $dsn DSN
+ * @param bool $exceptions Should we throw external exceptions?
+ *
+ * @return PHPMailer
+ */
+ public static function mailer($dsn, $exceptions = null)
+ {
+ static $configurator = null;
+
+ if (null === $configurator) {
+ $configurator = new DSNConfigurator();
+ }
+
+ return $configurator->configure(new PHPMailer($exceptions), $dsn);
+ }
+
+ /**
+ * Configure PHPMailer instance with DSN string.
+ *
+ * @param PHPMailer $mailer PHPMailer instance
+ * @param string $dsn DSN
+ *
+ * @return PHPMailer
+ */
+ public function configure(PHPMailer $mailer, $dsn)
+ {
+ $config = $this->parseDSN($dsn);
+
+ $this->applyConfig($mailer, $config);
+
+ return $mailer;
+ }
+
+ /**
+ * Parse DSN string.
+ *
+ * @param string $dsn DSN
+ *
+ * @throws Exception If DSN is malformed
+ *
+ * @return array Configuration
+ */
+ private function parseDSN($dsn)
+ {
+ $config = $this->parseUrl($dsn);
+
+ if (false === $config || !isset($config['scheme']) || !isset($config['host'])) {
+ throw new Exception('Malformed DSN');
+ }
+
+ if (isset($config['query'])) {
+ parse_str($config['query'], $config['query']);
+ }
+
+ return $config;
+ }
+
+ /**
+ * Apply configuration to mailer.
+ *
+ * @param PHPMailer $mailer PHPMailer instance
+ * @param array $config Configuration
+ *
+ * @throws Exception If scheme is invalid
+ */
+ private function applyConfig(PHPMailer $mailer, $config)
+ {
+ switch ($config['scheme']) {
+ case 'mail':
+ $mailer->isMail();
+ break;
+ case 'sendmail':
+ $mailer->isSendmail();
+ break;
+ case 'qmail':
+ $mailer->isQmail();
+ break;
+ case 'smtp':
+ case 'smtps':
+ $mailer->isSMTP();
+ $this->configureSMTP($mailer, $config);
+ break;
+ default:
+ throw new Exception(
+ sprintf(
+ 'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".',
+ $config['scheme']
+ )
+ );
+ }
+
+ if (isset($config['query'])) {
+ $this->configureOptions($mailer, $config['query']);
+ }
+ }
+
+ /**
+ * Configure SMTP.
+ *
+ * @param PHPMailer $mailer PHPMailer instance
+ * @param array $config Configuration
+ */
+ private function configureSMTP($mailer, $config)
+ {
+ $isSMTPS = 'smtps' === $config['scheme'];
+
+ if ($isSMTPS) {
+ $mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
+ }
+
+ $mailer->Host = $config['host'];
+
+ if (isset($config['port'])) {
+ $mailer->Port = $config['port'];
+ } elseif ($isSMTPS) {
+ $mailer->Port = SMTP::DEFAULT_SECURE_PORT;
+ }
+
+ $mailer->SMTPAuth = isset($config['user']) || isset($config['pass']);
+
+ if (isset($config['user'])) {
+ $mailer->Username = $config['user'];
+ }
+
+ if (isset($config['pass'])) {
+ $mailer->Password = $config['pass'];
+ }
+ }
+
+ /**
+ * Configure options.
+ *
+ * @param PHPMailer $mailer PHPMailer instance
+ * @param array $options Options
+ *
+ * @throws Exception If option is unknown
+ */
+ private function configureOptions(PHPMailer $mailer, $options)
+ {
+ $allowedOptions = get_object_vars($mailer);
+
+ unset($allowedOptions['Mailer']);
+ unset($allowedOptions['SMTPAuth']);
+ unset($allowedOptions['Username']);
+ unset($allowedOptions['Password']);
+ unset($allowedOptions['Hostname']);
+ unset($allowedOptions['Port']);
+ unset($allowedOptions['ErrorInfo']);
+
+ $allowedOptions = \array_keys($allowedOptions);
+
+ foreach ($options as $key => $value) {
+ if (!in_array($key, $allowedOptions)) {
+ throw new Exception(
+ sprintf(
+ 'Unknown option: "%s". Allowed values: "%s"',
+ $key,
+ implode('", "', $allowedOptions)
+ )
+ );
+ }
+
+ switch ($key) {
+ case 'AllowEmpty':
+ case 'SMTPAutoTLS':
+ case 'SMTPKeepAlive':
+ case 'SingleTo':
+ case 'UseSendmailOptions':
+ case 'do_verp':
+ case 'DKIM_copyHeaderFields':
+ $mailer->$key = (bool) $value;
+ break;
+ case 'Priority':
+ case 'SMTPDebug':
+ case 'WordWrap':
+ $mailer->$key = (int) $value;
+ break;
+ default:
+ $mailer->$key = $value;
+ break;
+ }
+ }
+ }
+
+ /**
+ * Parse a URL.
+ * Wrapper for the built-in parse_url function to work around a bug in PHP 5.5.
+ *
+ * @param string $url URL
+ *
+ * @return array|false
+ */
+ protected function parseUrl($url)
+ {
+ if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) {
+ return parse_url($url);
+ }
+
+ $chunks = explode('?', $url);
+ if (is_array($chunks)) {
+ $result = parse_url($chunks[0]);
+ if (is_array($result)) {
+ $result['query'] = $chunks[1];
+ }
+ return $result;
+ }
+
+ return false;
+ }
+}
diff --git a/vendor/phpmailer/phpmailer/src/Exception.php b/vendor/phpmailer/phpmailer/src/Exception.php
new file mode 100644
index 0000000..09c1a2c
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/src/Exception.php
@@ -0,0 +1,40 @@
+
+ * @author Jim Jagielski (jimjag)
+ * @author Andy Prevost (codeworxtech)
+ * @author Brent R. Matzelle (original founder)
+ * @copyright 2012 - 2020 Marcus Bointon
+ * @copyright 2010 - 2012 Jim Jagielski
+ * @copyright 2004 - 2009 Andy Prevost
+ * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
+ * @note This program is distributed in the hope that it will be useful - WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+namespace PHPMailer\PHPMailer;
+
+/**
+ * PHPMailer exception handler.
+ *
+ * @author Marcus Bointon
+ */
+class Exception extends \Exception
+{
+ /**
+ * Prettify error message output.
+ *
+ * @return string
+ */
+ public function errorMessage()
+ {
+ return '' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "
\n";
+ }
+}
diff --git a/vendor/phpmailer/phpmailer/src/OAuth.php b/vendor/phpmailer/phpmailer/src/OAuth.php
new file mode 100644
index 0000000..a7e9588
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/src/OAuth.php
@@ -0,0 +1,139 @@
+
+ * @author Jim Jagielski (jimjag)
+ * @author Andy Prevost (codeworxtech)
+ * @author Brent R. Matzelle (original founder)
+ * @copyright 2012 - 2020 Marcus Bointon
+ * @copyright 2010 - 2012 Jim Jagielski
+ * @copyright 2004 - 2009 Andy Prevost
+ * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
+ * @note This program is distributed in the hope that it will be useful - WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+namespace PHPMailer\PHPMailer;
+
+use League\OAuth2\Client\Grant\RefreshToken;
+use League\OAuth2\Client\Provider\AbstractProvider;
+use League\OAuth2\Client\Token\AccessToken;
+
+/**
+ * OAuth - OAuth2 authentication wrapper class.
+ * Uses the oauth2-client package from the League of Extraordinary Packages.
+ *
+ * @see https://oauth2-client.thephpleague.com
+ *
+ * @author Marcus Bointon (Synchro/coolbru)
+ */
+class OAuth implements OAuthTokenProvider
+{
+ /**
+ * An instance of the League OAuth Client Provider.
+ *
+ * @var AbstractProvider
+ */
+ protected $provider;
+
+ /**
+ * The current OAuth access token.
+ *
+ * @var AccessToken
+ */
+ protected $oauthToken;
+
+ /**
+ * The user's email address, usually used as the login ID
+ * and also the from address when sending email.
+ *
+ * @var string
+ */
+ protected $oauthUserEmail = '';
+
+ /**
+ * The client secret, generated in the app definition of the service you're connecting to.
+ *
+ * @var string
+ */
+ protected $oauthClientSecret = '';
+
+ /**
+ * The client ID, generated in the app definition of the service you're connecting to.
+ *
+ * @var string
+ */
+ protected $oauthClientId = '';
+
+ /**
+ * The refresh token, used to obtain new AccessTokens.
+ *
+ * @var string
+ */
+ protected $oauthRefreshToken = '';
+
+ /**
+ * OAuth constructor.
+ *
+ * @param array $options Associative array containing
+ * `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements
+ */
+ public function __construct($options)
+ {
+ $this->provider = $options['provider'];
+ $this->oauthUserEmail = $options['userName'];
+ $this->oauthClientSecret = $options['clientSecret'];
+ $this->oauthClientId = $options['clientId'];
+ $this->oauthRefreshToken = $options['refreshToken'];
+ }
+
+ /**
+ * Get a new RefreshToken.
+ *
+ * @return RefreshToken
+ */
+ protected function getGrant()
+ {
+ return new RefreshToken();
+ }
+
+ /**
+ * Get a new AccessToken.
+ *
+ * @return AccessToken
+ */
+ protected function getToken()
+ {
+ return $this->provider->getAccessToken(
+ $this->getGrant(),
+ ['refresh_token' => $this->oauthRefreshToken]
+ );
+ }
+
+ /**
+ * Generate a base64-encoded OAuth token.
+ *
+ * @return string
+ */
+ public function getOauth64()
+ {
+ //Get a new token if it's not available or has expired
+ if (null === $this->oauthToken || $this->oauthToken->hasExpired()) {
+ $this->oauthToken = $this->getToken();
+ }
+
+ return base64_encode(
+ 'user=' .
+ $this->oauthUserEmail .
+ "\001auth=Bearer " .
+ $this->oauthToken .
+ "\001\001"
+ );
+ }
+}
diff --git a/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php
new file mode 100644
index 0000000..cbda1a1
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/src/OAuthTokenProvider.php
@@ -0,0 +1,44 @@
+
+ * @author Jim Jagielski (jimjag)
+ * @author Andy Prevost (codeworxtech)
+ * @author Brent R. Matzelle (original founder)
+ * @copyright 2012 - 2020 Marcus Bointon
+ * @copyright 2010 - 2012 Jim Jagielski
+ * @copyright 2004 - 2009 Andy Prevost
+ * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
+ * @note This program is distributed in the hope that it will be useful - WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+namespace PHPMailer\PHPMailer;
+
+/**
+ * OAuthTokenProvider - OAuth2 token provider interface.
+ * Provides base64 encoded OAuth2 auth strings for SMTP authentication.
+ *
+ * @see OAuth
+ * @see SMTP::authenticate()
+ *
+ * @author Peter Scopes (pdscopes)
+ * @author Marcus Bointon (Synchro/coolbru)
+ */
+interface OAuthTokenProvider
+{
+ /**
+ * Generate a base64-encoded OAuth token ensuring that the access token has not expired.
+ * The string to be base 64 encoded should be in the form:
+ * "user=\001auth=Bearer \001\001"
+ *
+ * @return string
+ */
+ public function getOauth64();
+}
diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php
new file mode 100644
index 0000000..ff3b84b
--- /dev/null
+++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php
@@ -0,0 +1,5460 @@
+
+ * @author Jim Jagielski (jimjag)
+ * @author Andy Prevost (codeworxtech)
+ * @author Brent R. Matzelle (original founder)
+ * @copyright 2012 - 2020 Marcus Bointon
+ * @copyright 2010 - 2012 Jim Jagielski
+ * @copyright 2004 - 2009 Andy Prevost
+ * @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
+ * @note This program is distributed in the hope that it will be useful - WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+namespace PHPMailer\PHPMailer;
+
+/**
+ * PHPMailer - PHP email creation and transport class.
+ *
+ * @author Marcus Bointon (Synchro/coolbru)
+ * @author Jim Jagielski (jimjag)
+ * @author Andy Prevost (codeworxtech)
+ * @author Brent R. Matzelle (original founder)
+ */
+class PHPMailer
+{
+ const CHARSET_ASCII = 'us-ascii';
+ const CHARSET_ISO88591 = 'iso-8859-1';
+ const CHARSET_UTF8 = 'utf-8';
+
+ const CONTENT_TYPE_PLAINTEXT = 'text/plain';
+ const CONTENT_TYPE_TEXT_CALENDAR = 'text/calendar';
+ const CONTENT_TYPE_TEXT_HTML = 'text/html';
+ const CONTENT_TYPE_MULTIPART_ALTERNATIVE = 'multipart/alternative';
+ const CONTENT_TYPE_MULTIPART_MIXED = 'multipart/mixed';
+ const CONTENT_TYPE_MULTIPART_RELATED = 'multipart/related';
+
+ const ENCODING_7BIT = '7bit';
+ const ENCODING_8BIT = '8bit';
+ const ENCODING_BASE64 = 'base64';
+ const ENCODING_BINARY = 'binary';
+ const ENCODING_QUOTED_PRINTABLE = 'quoted-printable';
+
+ const ENCRYPTION_STARTTLS = 'tls';
+ const ENCRYPTION_SMTPS = 'ssl';
+
+ const ICAL_METHOD_REQUEST = 'REQUEST';
+ const ICAL_METHOD_PUBLISH = 'PUBLISH';
+ const ICAL_METHOD_REPLY = 'REPLY';
+ const ICAL_METHOD_ADD = 'ADD';
+ const ICAL_METHOD_CANCEL = 'CANCEL';
+ const ICAL_METHOD_REFRESH = 'REFRESH';
+ const ICAL_METHOD_COUNTER = 'COUNTER';
+ const ICAL_METHOD_DECLINECOUNTER = 'DECLINECOUNTER';
+
+ /**
+ * Email priority.
+ * Options: null (default), 1 = High, 3 = Normal, 5 = low.
+ * When null, the header is not set at all.
+ *
+ * @var int|null
+ */
+ public $Priority;
+
+ /**
+ * The character set of the message.
+ *
+ * @var string
+ */
+ public $CharSet = self::CHARSET_ISO88591;
+
+ /**
+ * The MIME Content-type of the message.
+ *
+ * @var string
+ */
+ public $ContentType = self::CONTENT_TYPE_PLAINTEXT;
+
+ /**
+ * The message encoding.
+ * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable".
+ *
+ * @var string
+ */
+ public $Encoding = self::ENCODING_8BIT;
+
+ /**
+ * Holds the most recent mailer error message.
+ *
+ * @var string
+ */
+ public $ErrorInfo = '';
+
+ /**
+ * The From email address for the message.
+ *
+ * @var string
+ */
+ public $From = '';
+
+ /**
+ * The From name of the message.
+ *
+ * @var string
+ */
+ public $FromName = '';
+
+ /**
+ * The envelope sender of the message.
+ * This will usually be turned into a Return-Path header by the receiver,
+ * and is the address that bounces will be sent to.
+ * If not empty, will be passed via `-f` to sendmail or as the 'MAIL FROM' value over SMTP.
+ *
+ * @var string
+ */
+ public $Sender = '';
+
+ /**
+ * The Subject of the message.
+ *
+ * @var string
+ */
+ public $Subject = '';
+
+ /**
+ * An HTML or plain text message body.
+ * If HTML then call isHTML(true).
+ *
+ * @var string
+ */
+ public $Body = '';
+
+ /**
+ * The plain-text message body.
+ * This body can be read by mail clients that do not have HTML email
+ * capability such as mutt & Eudora.
+ * Clients that can read HTML will view the normal Body.
+ *
+ * @var string
+ */
+ public $AltBody = '';
+
+ /**
+ * An iCal message part body.
+ * Only supported in simple alt or alt_inline message types
+ * To generate iCal event structures, use classes like EasyPeasyICS or iCalcreator.
+ *
+ * @see https://kigkonsult.se/iCalcreator/
+ *
+ * @var string
+ */
+ public $Ical = '';
+
+ /**
+ * Value-array of "method" in Contenttype header "text/calendar"
+ *
+ * @var string[]
+ */
+ protected static $IcalMethods = [
+ self::ICAL_METHOD_REQUEST,
+ self::ICAL_METHOD_PUBLISH,
+ self::ICAL_METHOD_REPLY,
+ self::ICAL_METHOD_ADD,
+ self::ICAL_METHOD_CANCEL,
+ self::ICAL_METHOD_REFRESH,
+ self::ICAL_METHOD_COUNTER,
+ self::ICAL_METHOD_DECLINECOUNTER,
+ ];
+
+ /**
+ * The complete compiled MIME message body.
+ *
+ * @var string
+ */
+ protected $MIMEBody = '';
+
+ /**
+ * The complete compiled MIME message headers.
+ *
+ * @var string
+ */
+ protected $MIMEHeader = '';
+
+ /**
+ * Extra headers that createHeader() doesn't fold in.
+ *
+ * @var string
+ */
+ protected $mailHeader = '';
+
+ /**
+ * Word-wrap the message body to this number of chars.
+ * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance.
+ *
+ * @see static::STD_LINE_LENGTH
+ *
+ * @var int
+ */
+ public $WordWrap = 0;
+
+ /**
+ * Which method to use to send mail.
+ * Options: "mail", "sendmail", or "smtp".
+ *
+ * @var string
+ */
+ public $Mailer = 'mail';
+
+ /**
+ * The path to the sendmail program.
+ *
+ * @var string
+ */
+ public $Sendmail = '/usr/sbin/sendmail';
+
+ /**
+ * Whether mail() uses a fully sendmail-compatible MTA.
+ * One which supports sendmail's "-oi -f" options.
+ *
+ * @var bool
+ */
+ public $UseSendmailOptions = true;
+
+ /**
+ * The email address that a reading confirmation should be sent to, also known as read receipt.
+ *
+ * @var string
+ */
+ public $ConfirmReadingTo = '';
+
+ /**
+ * The hostname to use in the Message-ID header and as default HELO string.
+ * If empty, PHPMailer attempts to find one with, in order,
+ * $_SERVER['SERVER_NAME'], gethostname(), php_uname('n'), or the value
+ * 'localhost.localdomain'.
+ *
+ * @see PHPMailer::$Helo
+ *
+ * @var string
+ */
+ public $Hostname = '';
+
+ /**
+ * An ID to be used in the Message-ID header.
+ * If empty, a unique id will be generated.
+ * You can set your own, but it must be in the format "",
+ * as defined in RFC5322 section 3.6.4 or it will be ignored.
+ *
+ * @see https://www.rfc-editor.org/rfc/rfc5322#section-3.6.4
+ *
+ * @var string
+ */
+ public $MessageID = '';
+
+ /**
+ * The message Date to be used in the Date header.
+ * If empty, the current date will be added.
+ *
+ * @var string
+ */
+ public $MessageDate = '';
+
+ /**
+ * SMTP hosts.
+ * Either a single hostname or multiple semicolon-delimited hostnames.
+ * You can also specify a different port
+ * for each host by using this format: [hostname:port]
+ * (e.g. "smtp1.example.com:25;smtp2.example.com").
+ * You can also specify encryption type, for example:
+ * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465").
+ * Hosts will be tried in order.
+ *
+ * @var string
+ */
+ public $Host = 'localhost';
+
+ /**
+ * The default SMTP server port.
+ *
+ * @var int
+ */
+ public $Port = 25;
+
+ /**
+ * The SMTP HELO/EHLO name used for the SMTP connection.
+ * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find
+ * one with the same method described above for $Hostname.
+ *
+ * @see PHPMailer::$Hostname
+ *
+ * @var string
+ */
+ public $Helo = '';
+
+ /**
+ * What kind of encryption to use on the SMTP connection.
+ * Options: '', static::ENCRYPTION_STARTTLS, or static::ENCRYPTION_SMTPS.
+ *
+ * @var string
+ */
+ public $SMTPSecure = '';
+
+ /**
+ * Whether to enable TLS encryption automatically if a server supports it,
+ * even if `SMTPSecure` is not set to 'tls'.
+ * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.
+ *
+ * @var bool
+ */
+ public $SMTPAutoTLS = true;
+
+ /**
+ * Whether to use SMTP authentication.
+ * Uses the Username and Password properties.
+ *
+ * @see PHPMailer::$Username
+ * @see PHPMailer::$Password
+ *
+ * @var bool
+ */
+ public $SMTPAuth = false;
+
+ /**
+ * Options array passed to stream_context_create when connecting via SMTP.
+ *
+ * @var array
+ */
+ public $SMTPOptions = [];
+
+ /**
+ * SMTP username.
+ *
+ * @var string
+ */
+ public $Username = '';
+
+ /**
+ * SMTP password.
+ *
+ * @var string
+ */
+ public $Password = '';
+
+ /**
+ * SMTP authentication type. Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2.
+ * If not specified, the first one from that list that the server supports will be selected.
+ *
+ * @var string
+ */
+ public $AuthType = '';
+
+ /**
+ * SMTP SMTPXClient command attributes
+ *
+ * @var array
+ */
+ protected $SMTPXClient = [];
+
+ /**
+ * An implementation of the PHPMailer OAuthTokenProvider interface.
+ *
+ * @var OAuthTokenProvider
+ */
+ protected $oauth;
+
+ /**
+ * The SMTP server timeout in seconds.
+ * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2.
+ *
+ * @var int
+ */
+ public $Timeout = 300;
+
+ /**
+ * Comma separated list of DSN notifications
+ * 'NEVER' under no circumstances a DSN must be returned to the sender.
+ * If you use NEVER all other notifications will be ignored.
+ * 'SUCCESS' will notify you when your mail has arrived at its destination.
+ * 'FAILURE' will arrive if an error occurred during delivery.
+ * 'DELAY' will notify you if there is an unusual delay in delivery, but the actual
+ * delivery's outcome (success or failure) is not yet decided.
+ *
+ * @see https://www.rfc-editor.org/rfc/rfc3461.html#section-4.1 for more information about NOTIFY
+ */
+ public $dsn = '';
+
+ /**
+ * SMTP class debug output mode.
+ * Debug output level.
+ * Options:
+ * @see SMTP::DEBUG_OFF: No output
+ * @see SMTP::DEBUG_CLIENT: Client messages
+ * @see SMTP::DEBUG_SERVER: Client and server messages
+ * @see SMTP::DEBUG_CONNECTION: As SERVER plus connection status
+ * @see SMTP::DEBUG_LOWLEVEL: Noisy, low-level data output, rarely needed
+ *
+ * @see SMTP::$do_debug
+ *
+ * @var int
+ */
+ public $SMTPDebug = 0;
+
+ /**
+ * How to handle debug output.
+ * Options:
+ * * `echo` Output plain-text as-is, appropriate for CLI
+ * * `html` Output escaped, line breaks converted to `
`, appropriate for browser output
+ * * `error_log` Output to error log as configured in php.ini
+ * By default PHPMailer will use `echo` if run from a `cli` or `cli-server` SAPI, `html` otherwise.
+ * Alternatively, you can provide a callable expecting two params: a message string and the debug level:
+ *
+ * ```php
+ * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
+ * ```
+ *
+ * Alternatively, you can pass in an instance of a PSR-3 compatible logger, though only `debug`
+ * level output is used:
+ *
+ * ```php
+ * $mail->Debugoutput = new myPsr3Logger;
+ * ```
+ *
+ * @see SMTP::$Debugoutput
+ *
+ * @var string|callable|\Psr\Log\LoggerInterface
+ */
+ public $Debugoutput = 'echo';
+
+ /**
+ * Whether to keep the SMTP connection open after each message.
+ * If this is set to true then the connection will remain open after a send,
+ * and closing the connection will require an explicit call to smtpClose().
+ * It's a good idea to use this if you are sending multiple messages as it reduces overhead.
+ * See the mailing list example for how to use it.
+ *
+ * @var bool
+ */
+ public $SMTPKeepAlive = false;
+
+ /**
+ * Whether to split multiple to addresses into multiple messages
+ * or send them all in one message.
+ * Only supported in `mail` and `sendmail` transports, not in SMTP.
+ *
+ * @var bool
+ *
+ * @deprecated 6.0.0 PHPMailer isn't a mailing list manager!
+ */
+ public $SingleTo = false;
+
+ /**
+ * Storage for addresses when SingleTo is enabled.
+ *
+ * @var array
+ */
+ protected $SingleToArray = [];
+
+ /**
+ * Whether to generate VERP addresses on send.
+ * Only applicable when sending via SMTP.
+ *
+ * @see https://en.wikipedia.org/wiki/Variable_envelope_return_path
+ * @see https://www.postfix.org/VERP_README.html Postfix VERP info
+ *
+ * @var bool
+ */
+ public $do_verp = false;
+
+ /**
+ * Whether to allow sending messages with an empty body.
+ *
+ * @var bool
+ */
+ public $AllowEmpty = false;
+
+ /**
+ * DKIM selector.
+ *
+ * @var string
+ */
+ public $DKIM_selector = '';
+
+ /**
+ * DKIM Identity.
+ * Usually the email address used as the source of the email.
+ *
+ * @var string
+ */
+ public $DKIM_identity = '';
+
+ /**
+ * DKIM passphrase.
+ * Used if your key is encrypted.
+ *
+ * @var string
+ */
+ public $DKIM_passphrase = '';
+
+ /**
+ * DKIM signing domain name.
+ *
+ * @example 'example.com'
+ *
+ * @var string
+ */
+ public $DKIM_domain = '';
+
+ /**
+ * DKIM Copy header field values for diagnostic use.
+ *
+ * @var bool
+ */
+ public $DKIM_copyHeaderFields = true;
+
+ /**
+ * DKIM Extra signing headers.
+ *
+ * @example ['List-Unsubscribe', 'List-Help']
+ *
+ * @var array
+ */
+ public $DKIM_extraHeaders = [];
+
+ /**
+ * DKIM private key file path.
+ *
+ * @var string
+ */
+ public $DKIM_private = '';
+
+ /**
+ * DKIM private key string.
+ *
+ * If set, takes precedence over `$DKIM_private`.
+ *
+ * @var string
+ */
+ public $DKIM_private_string = '';
+
+ /**
+ * Callback Action function name.
+ *
+ * The function that handles the result of the send email action.
+ * It is called out by send() for each email sent.
+ *
+ * Value can be any php callable: https://www.php.net/is_callable
+ *
+ * Parameters:
+ * bool $result result of the send action
+ * array $to email addresses of the recipients
+ * array $cc cc email addresses
+ * array $bcc bcc email addresses
+ * string $subject the subject
+ * string $body the email body
+ * string $from email address of sender
+ * string $extra extra information of possible use
+ * 'smtp_transaction_id' => last smtp transaction id
+ *
+ * @var callable|callable-string
+ */
+ public $action_function = '';
+
+ /**
+ * What to put in the X-Mailer header.
+ * Options: An empty string for PHPMailer default, whitespace/null for none, or a string to use.
+ *
+ * @var string|null
+ */
+ public $XMailer = '';
+
+ /**
+ * Which validator to use by default when validating email addresses.
+ * May be a callable to inject your own validator, but there are several built-in validators.
+ * The default validator uses PHP's FILTER_VALIDATE_EMAIL filter_var option.
+ *
+ * If CharSet is UTF8, the validator is left at the default value,
+ * and you send to addresses that use non-ASCII local parts, then
+ * PHPMailer automatically changes to the 'eai' validator.
+ *
+ * @see PHPMailer::validateAddress()
+ *
+ * @var string|callable
+ */
+ public static $validator = 'php';
+
+ /**
+ * An instance of the SMTP sender class.
+ *
+ * @var SMTP
+ */
+ protected $smtp;
+
+ /**
+ * The array of 'to' names and addresses.
+ *
+ * @var array
+ */
+ protected $to = [];
+
+ /**
+ * The array of 'cc' names and addresses.
+ *
+ * @var array
+ */
+ protected $cc = [];
+
+ /**
+ * The array of 'bcc' names and addresses.
+ *
+ * @var array
+ */
+ protected $bcc = [];
+
+ /**
+ * The array of reply-to names and addresses.
+ *
+ * @var array
+ */
+ protected $ReplyTo = [];
+
+ /**
+ * An array of all kinds of addresses.
+ * Includes all of $to, $cc, $bcc.
+ *
+ * @see PHPMailer::$to
+ * @see PHPMailer::$cc
+ * @see PHPMailer::$bcc
+ *
+ * @var array
+ */
+ protected $all_recipients = [];
+
+ /**
+ * An array of names and addresses queued for validation.
+ * In send(), valid and non duplicate entries are moved to $all_recipients
+ * and one of $to, $cc, or $bcc.
+ * This array is used only for addresses with IDN.
+ *
+ * @see PHPMailer::$to
+ * @see PHPMailer::$cc
+ * @see PHPMailer::$bcc
+ * @see PHPMailer::$all_recipients
+ *
+ * @var array
+ */
+ protected $RecipientsQueue = [];
+
+ /**
+ * An array of reply-to names and addresses queued for validation.
+ * In send(), valid and non duplicate entries are moved to $ReplyTo.
+ * This array is used only for addresses with IDN.
+ *
+ * @see PHPMailer::$ReplyTo
+ *
+ * @var array
+ */
+ protected $ReplyToQueue = [];
+
+ /**
+ * Whether the need for SMTPUTF8 has been detected. Set by
+ * preSend() if necessary.
+ *
+ * @var bool
+ */
+ public $UseSMTPUTF8 = false;
+
+ /**
+ * The array of attachments.
+ *
+ * @var array
+ */
+ protected $attachment = [];
+
+ /**
+ * The array of custom headers.
+ *
+ * @var array
+ */
+ protected $CustomHeader = [];
+
+ /**
+ * The most recent Message-ID (including angular brackets).
+ *
+ * @var string
+ */
+ protected $lastMessageID = '';
+
+ /**
+ * The message's MIME type.
+ *
+ * @var string
+ */
+ protected $message_type = '';
+
+ /**
+ * The array of MIME boundary strings.
+ *
+ * @var array
+ */
+ protected $boundary = [];
+
+ /**
+ * The array of available text strings for the current language.
+ *
+ * @var array
+ */
+ protected static $language = [];
+
+ /**
+ * The number of errors encountered.
+ *
+ * @var int
+ */
+ protected $error_count = 0;
+
+ /**
+ * The S/MIME certificate file path.
+ *
+ * @var string
+ */
+ protected $sign_cert_file = '';
+
+ /**
+ * The S/MIME key file path.
+ *
+ * @var string
+ */
+ protected $sign_key_file = '';
+
+ /**
+ * The optional S/MIME extra certificates ("CA Chain") file path.
+ *
+ * @var string
+ */
+ protected $sign_extracerts_file = '';
+
+ /**
+ * The S/MIME password for the key.
+ * Used only if the key is encrypted.
+ *
+ * @var string
+ */
+ protected $sign_key_pass = '';
+
+ /**
+ * Whether to throw exceptions for errors.
+ *
+ * @var bool
+ */
+ protected $exceptions = false;
+
+ /**
+ * Unique ID used for message ID and boundaries.
+ *
+ * @var string
+ */
+ protected $uniqueid = '';
+
+ /**
+ * The PHPMailer Version number.
+ *
+ * @var string
+ */
+ const VERSION = '7.0.0';
+
+ /**
+ * Error severity: message only, continue processing.
+ *
+ * @var int
+ */
+ const STOP_MESSAGE = 0;
+
+ /**
+ * Error severity: message, likely ok to continue processing.
+ *
+ * @var int
+ */
+ const STOP_CONTINUE = 1;
+
+ /**
+ * Error severity: message, plus full stop, critical error reached.
+ *
+ * @var int
+ */
+ const STOP_CRITICAL = 2;
+
+ /**
+ * The SMTP standard CRLF line break.
+ * If you want to change line break format, change static::$LE, not this.
+ */
+ const CRLF = "\r\n";
+
+ /**
+ * "Folding White Space" a white space string used for line folding.
+ */
+ const FWS = ' ';
+
+ /**
+ * SMTP RFC standard line ending; Carriage Return, Line Feed.
+ *
+ * @var string
+ */
+ protected static $LE = self::CRLF;
+
+ /**
+ * The maximum line length supported by mail().
+ *
+ * Background: mail() will sometimes corrupt messages
+ * with headers longer than 65 chars, see #818.
+ *
+ * @var int
+ */
+ const MAIL_MAX_LINE_LENGTH = 63;
+
+ /**
+ * The maximum line length allowed by RFC 2822 section 2.1.1.
+ *
+ * @var int
+ */
+ const MAX_LINE_LENGTH = 998;
+
+ /**
+ * The lower maximum line length allowed by RFC 2822 section 2.1.1.
+ * This length does NOT include the line break
+ * 76 means that lines will be 77 or 78 chars depending on whether
+ * the line break format is LF or CRLF; both are valid.
+ *
+ * @var int
+ */
+ const STD_LINE_LENGTH = 76;
+
+ /**
+ * Constructor.
+ *
+ * @param bool $exceptions Should we throw external exceptions?
+ */
+ public function __construct($exceptions = null)
+ {
+ if (null !== $exceptions) {
+ $this->exceptions = (bool) $exceptions;
+ }
+ //Pick an appropriate debug output format automatically
+ $this->Debugoutput = (strpos(PHP_SAPI, 'cli') !== false ? 'echo' : 'html');
+ }
+
+ /**
+ * Destructor.
+ */
+ public function __destruct()
+ {
+ //Close any open SMTP connection nicely
+ $this->smtpClose();
+ }
+
+ /**
+ * Call mail() in a safe_mode-aware fashion.
+ * Also, unless sendmail_path points to sendmail (or something that
+ * claims to be sendmail), don't pass params (not a perfect fix,
+ * but it will do).
+ *
+ * @param string $to To
+ * @param string $subject Subject
+ * @param string $body Message Body
+ * @param string $header Additional Header(s)
+ * @param string|null $params Params
+ *
+ * @return bool
+ */
+ private function mailPassthru($to, $subject, $body, $header, $params)
+ {
+ //Check overloading of mail function to avoid double-encoding
+ if ((int)ini_get('mbstring.func_overload') & 1) {
+ $subject = $this->secureHeader($subject);
+ } else {
+ $subject = $this->encodeHeader($this->secureHeader($subject));
+ }
+ //Calling mail() with null params breaks
+ $this->edebug('Sending with mail()');
+ $this->edebug('Sendmail path: ' . ini_get('sendmail_path'));
+ $this->edebug("Envelope sender: {$this->Sender}");
+ $this->edebug("To: {$to}");
+ $this->edebug("Subject: {$subject}");
+ $this->edebug("Headers: {$header}");
+ if (!$this->UseSendmailOptions || null === $params) {
+ $result = @mail($to, $subject, $body, $header);
+ } else {
+ $this->edebug("Additional params: {$params}");
+ $result = @mail($to, $subject, $body, $header, $params);
+ }
+ $this->edebug('Result: ' . ($result ? 'true' : 'false'));
+ return $result;
+ }
+
+ /**
+ * Output debugging info via a user-defined method.
+ * Only generates output if debug output is enabled.
+ *
+ * @see PHPMailer::$Debugoutput
+ * @see PHPMailer::$SMTPDebug
+ *
+ * @param string $str
+ */
+ protected function edebug($str)
+ {
+ if ($this->SMTPDebug <= 0) {
+ return;
+ }
+ //Is this a PSR-3 logger?
+ if ($this->Debugoutput instanceof \Psr\Log\LoggerInterface) {
+ $this->Debugoutput->debug(rtrim($str, "\r\n"));
+
+ return;
+ }
+ //Avoid clash with built-in function names
+ if (is_callable($this->Debugoutput) && !in_array($this->Debugoutput, ['error_log', 'html', 'echo'])) {
+ call_user_func($this->Debugoutput, $str, $this->SMTPDebug);
+
+ return;
+ }
+ switch ($this->Debugoutput) {
+ case 'error_log':
+ //Don't output, just log
+ /** @noinspection ForgottenDebugOutputInspection */
+ error_log($str);
+ break;
+ case 'html':
+ //Cleans up output a bit for a better looking, HTML-safe output
+ echo htmlentities(
+ preg_replace('/[\r\n]+/', '', $str),
+ ENT_QUOTES,
+ 'UTF-8'
+ ), "
\n";
+ break;
+ case 'echo':
+ default:
+ //Normalize line breaks
+ $str = preg_replace('/\r\n|\r/m', "\n", $str);
+ echo gmdate('Y-m-d H:i:s'),
+ "\t",
+ //Trim trailing space
+ trim(
+ //Indent for readability, except for trailing break
+ str_replace(
+ "\n",
+ "\n \t ",
+ trim($str)
+ )
+ ),
+ "\n";
+ }
+ }
+
+ /**
+ * Sets message type to HTML or plain.
+ *
+ * @param bool $isHtml True for HTML mode
+ */
+ public function isHTML($isHtml = true)
+ {
+ if ($isHtml) {
+ $this->ContentType = static::CONTENT_TYPE_TEXT_HTML;
+ } else {
+ $this->ContentType = static::CONTENT_TYPE_PLAINTEXT;
+ }
+ }
+
+ /**
+ * Send messages using SMTP.
+ */
+ public function isSMTP()
+ {
+ $this->Mailer = 'smtp';
+ }
+
+ /**
+ * Send messages using PHP's mail() function.
+ */
+ public function isMail()
+ {
+ $this->Mailer = 'mail';
+ }
+
+ /**
+ * Send messages using $Sendmail.
+ */
+ public function isSendmail()
+ {
+ $ini_sendmail_path = ini_get('sendmail_path');
+
+ if (false === stripos($ini_sendmail_path, 'sendmail')) {
+ $this->Sendmail = '/usr/sbin/sendmail';
+ } else {
+ $this->Sendmail = $ini_sendmail_path;
+ }
+ $this->Mailer = 'sendmail';
+ }
+
+ /**
+ * Send messages using qmail.
+ */
+ public function isQmail()
+ {
+ $ini_sendmail_path = ini_get('sendmail_path');
+
+ if (false === stripos($ini_sendmail_path, 'qmail')) {
+ $this->Sendmail = '/var/qmail/bin/qmail-inject';
+ } else {
+ $this->Sendmail = $ini_sendmail_path;
+ }
+ $this->Mailer = 'qmail';
+ }
+
+ /**
+ * Add a "To" address.
+ *
+ * @param string $address The email address to send to
+ * @param string $name
+ *
+ * @throws Exception
+ *
+ * @return bool true on success, false if address already used or invalid in some way
+ */
+ public function addAddress($address, $name = '')
+ {
+ return $this->addOrEnqueueAnAddress('to', $address, $name);
+ }
+
+ /**
+ * Add a "CC" address.
+ *
+ * @param string $address The email address to send to
+ * @param string $name
+ *
+ * @throws Exception
+ *
+ * @return bool true on success, false if address already used or invalid in some way
+ */
+ public function addCC($address, $name = '')
+ {
+ return $this->addOrEnqueueAnAddress('cc', $address, $name);
+ }
+
+ /**
+ * Add a "BCC" address.
+ *
+ * @param string $address The email address to send to
+ * @param string $name
+ *
+ * @throws Exception
+ *
+ * @return bool true on success, false if address already used or invalid in some way
+ */
+ public function addBCC($address, $name = '')
+ {
+ return $this->addOrEnqueueAnAddress('bcc', $address, $name);
+ }
+
+ /**
+ * Add a "Reply-To" address.
+ *
+ * @param string $address The email address to reply to
+ * @param string $name
+ *
+ * @throws Exception
+ *
+ * @return bool true on success, false if address already used or invalid in some way
+ */
+ public function addReplyTo($address, $name = '')
+ {
+ return $this->addOrEnqueueAnAddress('Reply-To', $address, $name);
+ }
+
+ /**
+ * Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer
+ * can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still
+ * be modified after calling this function), addition of such addresses is delayed until send().
+ * Addresses that have been added already return false, but do not throw exceptions.
+ *
+ * @param string $kind One of 'to', 'cc', 'bcc', or 'Reply-To'
+ * @param string $address The email address
+ * @param string $name An optional username associated with the address
+ *
+ * @throws Exception
+ *
+ * @return bool true on success, false if address already used or invalid in some way
+ */
+ protected function addOrEnqueueAnAddress($kind, $address, $name)
+ {
+ $pos = false;
+ if ($address !== null) {
+ $address = trim($address);
+ $pos = strrpos($address, '@');
+ }
+ if (false === $pos) {
+ //At-sign is missing.
+ $error_message = sprintf(
+ '%s (%s): %s',
+ self::lang('invalid_address'),
+ $kind,
+ $address
+ );
+ $this->setError($error_message);
+ $this->edebug($error_message);
+ if ($this->exceptions) {
+ throw new Exception($error_message);
+ }
+
+ return false;
+ }
+ if ($name !== null && is_string($name)) {
+ $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
+ } else {
+ $name = '';
+ }
+ $params = [$kind, $address, $name];
+ //Enqueue addresses with IDN until we know the PHPMailer::$CharSet.
+ //Domain is assumed to be whatever is after the last @ symbol in the address
+ if ($this->has8bitChars(substr($address, ++$pos))) {
+ if (static::idnSupported()) {
+ if ('Reply-To' !== $kind) {
+ if (!array_key_exists($address, $this->RecipientsQueue)) {
+ $this->RecipientsQueue[$address] = $params;
+
+ return true;
+ }
+ } elseif (!array_key_exists($address, $this->ReplyToQueue)) {
+ $this->ReplyToQueue[$address] = $params;
+
+ return true;
+ }
+ }
+ //We have an 8-bit domain, but we are missing the necessary extensions to support it
+ //Or we are already sending to this address
+ return false;
+ }
+
+ //Immediately add standard addresses without IDN.
+ return call_user_func_array([$this, 'addAnAddress'], $params);
+ }
+
+ /**
+ * Set the boundaries to use for delimiting MIME parts.
+ * If you override this, ensure you set all 3 boundaries to unique values.
+ * The default boundaries include a "=_" sequence which cannot occur in quoted-printable bodies,
+ * as suggested by https://www.rfc-editor.org/rfc/rfc2045#section-6.7
+ *
+ * @return void
+ */
+ public function setBoundaries()
+ {
+ $this->uniqueid = $this->generateId();
+ $this->boundary[1] = 'b1=_' . $this->uniqueid;
+ $this->boundary[2] = 'b2=_' . $this->uniqueid;
+ $this->boundary[3] = 'b3=_' . $this->uniqueid;
+ }
+
+ /**
+ * Add an address to one of the recipient arrays or to the ReplyTo array.
+ * Addresses that have been added already return false, but do not throw exceptions.
+ *
+ * @param string $kind One of 'to', 'cc', 'bcc', or 'ReplyTo'
+ * @param string $address The email address to send, resp. to reply to
+ * @param string $name
+ *
+ * @throws Exception
+ *
+ * @return bool true on success, false if address already used or invalid in some way
+ */
+ protected function addAnAddress($kind, $address, $name = '')
+ {
+ if (
+ self::$validator === 'php' &&
+ ((bool) preg_match('/[\x80-\xFF]/', $address))
+ ) {
+ //The caller has not altered the validator and is sending to an address
+ //with UTF-8, so assume that they want UTF-8 support instead of failing
+ $this->CharSet = self::CHARSET_UTF8;
+ self::$validator = 'eai';
+ }
+ if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) {
+ $error_message = sprintf(
+ '%s: %s',
+ self::lang('Invalid recipient kind'),
+ $kind
+ );
+ $this->setError($error_message);
+ $this->edebug($error_message);
+ if ($this->exceptions) {
+ throw new Exception($error_message);
+ }
+
+ return false;
+ }
+ if (!static::validateAddress($address)) {
+ $error_message = sprintf(
+ '%s (%s): %s',
+ self::lang('invalid_address'),
+ $kind,
+ $address
+ );
+ $this->setError($error_message);
+ $this->edebug($error_message);
+ if ($this->exceptions) {
+ throw new Exception($error_message);
+ }
+
+ return false;
+ }
+ if ('Reply-To' !== $kind) {
+ if (!array_key_exists(strtolower($address), $this->all_recipients)) {
+ $this->{$kind}[] = [$address, $name];
+ $this->all_recipients[strtolower($address)] = true;
+
+ return true;
+ }
+ } else {
+ foreach ($this->ReplyTo as $replyTo) {
+ if (0 === strcasecmp($replyTo[0], $address)) {
+ return false;
+ }
+ }
+ $this->ReplyTo[] = [$address, $name];
+
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Parse and validate a string containing one or more RFC822-style comma-separated email addresses
+ * of the form "display name " into an array of name/address pairs.
+ * Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available.
+ * Note that quotes in the name part are removed.
+ *
+ * @see https://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation
+ *
+ * @param string $addrstr The address list string
+ * @param null $useimap Deprecated argument since 6.11.0.
+ * @param string $charset The charset to use when decoding the address list string.
+ *
+ * @return array
+ */
+ public static function parseAddresses($addrstr, $useimap = null, $charset = self::CHARSET_ISO88591)
+ {
+ if ($useimap !== null) {
+ trigger_error(self::lang('deprecated_argument'), E_USER_DEPRECATED);
+ }
+ $addresses = [];
+ if (function_exists('imap_rfc822_parse_adrlist')) {
+ //Use this built-in parser if it's available
+ $list = imap_rfc822_parse_adrlist($addrstr, '');
+ // Clear any potential IMAP errors to get rid of notices being thrown at end of script.
+ imap_errors();
+ foreach ($list as $address) {
+ if (
+ '.SYNTAX-ERROR.' !== $address->host &&
+ static::validateAddress($address->mailbox . '@' . $address->host)
+ ) {
+ //Decode the name part if it's present and maybe encoded
+ if (
+ property_exists($address, 'personal')
+ && is_string($address->personal)
+ && $address->personal !== ''
+ ) {
+ $address->personal = static::decodeHeader($address->personal, $charset);
+ }
+
+ $addresses[] = [
+ 'name' => (property_exists($address, 'personal') ? $address->personal : ''),
+ 'address' => $address->mailbox . '@' . $address->host,
+ ];
+ }
+ }
+ } else {
+ //Use this simpler parser
+ $addresses = static::parseSimplerAddresses($addrstr, $charset);
+ }
+
+ return $addresses;
+ }
+
+ /**
+ * Parse a string containing one or more RFC822-style comma-separated email addresses
+ * with the form "display name " into an array of name/address pairs.
+ * Uses a simpler parser that does not require the IMAP extension but doesnt support
+ * the full RFC822 spec. For full RFC822 support, use the PHP IMAP extension.
+ *
+ * @param string $addrstr The address list string
+ * @param string $charset The charset to use when decoding the address list string.
+ *
+ * @return array
+ */
+ protected static function parseSimplerAddresses($addrstr, $charset)
+ {
+ // Emit a runtime notice to recommend using the IMAP extension for full RFC822 parsing
+ trigger_error(self::lang('imap_recommended'), E_USER_NOTICE);
+
+ $addresses = [];
+ $list = explode(',', $addrstr);
+ foreach ($list as $address) {
+ $address = trim($address);
+ //Is there a separate name part?
+ if (strpos($address, '<') === false) {
+ //No separate name, just use the whole thing
+ if (static::validateAddress($address)) {
+ $addresses[] = [
+ 'name' => '',
+ 'address' => $address,
+ ];
+ }
+ } else {
+ $parsed = static::parseEmailString($address);
+ $email = $parsed['email'];
+ if (static::validateAddress($email)) {
+ $name = static::decodeHeader($parsed['name'], $charset);
+ $addresses[] = [
+ //Remove any surrounding quotes and spaces from the name
+ 'name' => trim($name, '\'" '),
+ 'address' => $email,
+ ];
+ }
+ }
+ }
+
+ return $addresses;
+ }
+
+ /**
+ * Parse a string containing an email address with an optional name
+ * and divide it into a name and email address.
+ *
+ * @param string $input The email with name.
+ *
+ * @return array{name: string, email: string}
+ */
+ private static function parseEmailString($input)
+ {
+ $input = trim((string)$input);
+
+ if ($input === '') {
+ return ['name' => '', 'email' => ''];
+ }
+
+ $pattern = '/^\s*(?:(?:"([^"]*)"|\'([^\']*)\'|([^<]*?))\s*)?<\s*([^>]+)\s*>\s*$/';
+ if (preg_match($pattern, $input, $matches)) {
+ $name = '';
+ // Double quotes including special scenarios.
+ if (isset($matches[1]) && $matches[1] !== '') {
+ $name = $matches[1];
+ // Single quotes including special scenarios.
+ } elseif (isset($matches[2]) && $matches[2] !== '') {
+ $name = $matches[2];
+ // Simplest scenario, name and email are in the format "Name ".
+ } elseif (isset($matches[3])) {
+ $name = trim($matches[3]);
+ }
+
+ return ['name' => $name, 'email' => trim($matches[4])];
+ }
+
+ return ['name' => '', 'email' => $input];
+ }
+
+ /**
+ * Set the From and FromName properties.
+ *
+ * @param string $address
+ * @param string $name
+ * @param bool $auto Whether to also set the Sender address, defaults to true
+ *
+ * @throws Exception
+ *
+ * @return bool
+ */
+ public function setFrom($address, $name = '', $auto = true)
+ {
+ if (is_null($name)) {
+ //Helps avoid a deprecation warning in the preg_replace() below
+ $name = '';
+ }
+ $address = trim((string)$address);
+ $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
+ //Don't validate now addresses with IDN. Will be done in send().
+ $pos = strrpos($address, '@');
+ if (
+ (false === $pos)
+ || ((!$this->has8bitChars(substr($address, ++$pos)) || !static::idnSupported())
+ && !static::validateAddress($address))
+ ) {
+ $error_message = sprintf(
+ '%s (From): %s',
+ self::lang('invalid_address'),
+ $address
+ );
+ $this->setError($error_message);
+ $this->edebug($error_message);
+ if ($this->exceptions) {
+ throw new Exception($error_message);
+ }
+
+ return false;
+ }
+ $this->From = $address;
+ $this->FromName = $name;
+ if ($auto && empty($this->Sender)) {
+ $this->Sender = $address;
+ }
+
+ return true;
+ }
+
+ /**
+ * Return the Message-ID header of the last email.
+ * Technically this is the value from the last time the headers were created,
+ * but it's also the message ID of the last sent message except in
+ * pathological cases.
+ *
+ * @return string
+ */
+ public function getLastMessageID()
+ {
+ return $this->lastMessageID;
+ }
+
+ /**
+ * Check that a string looks like an email address.
+ * Validation patterns supported:
+ * * `auto` Pick best pattern automatically;
+ * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0;
+ * * `pcre` Use old PCRE implementation;
+ * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL;
+ * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
+ * * `eai` Use a pattern similar to the HTML5 spec for 'email' and to firefox, extended to support EAI (RFC6530).
+ * * `noregex` Don't use a regex: super fast, really dumb.
+ * Alternatively you may pass in a callable to inject your own validator, for example:
+ *
+ * ```php
+ * PHPMailer::validateAddress('user@example.com', function($address) {
+ * return (strpos($address, '@') !== false);
+ * });
+ * ```
+ *
+ * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator.
+ *
+ * @param string $address The email address to check
+ * @param string|callable $patternselect Which pattern to use
+ *
+ * @return bool
+ */
+ public static function validateAddress($address, $patternselect = null)
+ {
+ if (null === $patternselect) {
+ $patternselect = static::$validator;
+ }
+ //Don't allow strings as callables, see SECURITY.md and CVE-2021-3603
+ if (is_callable($patternselect) && !is_string($patternselect)) {
+ return call_user_func($patternselect, $address);
+ }
+ //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
+ if (strpos($address, "\n") !== false || strpos($address, "\r") !== false) {
+ return false;
+ }
+ switch ($patternselect) {
+ case 'pcre': //Kept for BC
+ case 'pcre8':
+ /*
+ * A more complex and more permissive version of the RFC5322 regex on which FILTER_VALIDATE_EMAIL
+ * is based.
+ * In addition to the addresses allowed by filter_var, also permits:
+ * * dotless domains: `a@b`
+ * * comments: `1234 @ local(blah) .machine .example`
+ * * quoted elements: `'"test blah"@example.org'`
+ * * numeric TLDs: `a@b.123`
+ * * unbracketed IPv4 literals: `a@192.168.0.1`
+ * * IPv6 literals: 'first.last@[IPv6:a1::]'
+ * Not all of these will necessarily work for sending!
+ *
+ * @copyright 2009-2010 Michael Rushton
+ * Feel free to use and redistribute this code. But please keep this copyright notice.
+ */
+ return (bool) preg_match(
+ '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' .
+ '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' .
+ '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' .
+ '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' .
+ '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' .
+ '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' .
+ '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' .
+ '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' .
+ '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD',
+ $address
+ );
+ case 'html5':
+ /*
+ * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements.
+ *
+ * @see https://html.spec.whatwg.org/#e-mail-state-(type=email)
+ */
+ return (bool) preg_match(
+ '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' .
+ '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD',
+ $address
+ );
+ case 'eai':
+ /*
+ * This is the pattern used in the HTML5 spec for validation of 'email' type
+ * form input elements (as above), modified to accept Unicode email addresses.
+ * This is also more lenient than Firefox' html5 spec, in order to make the regex faster.
+ * 'eai' is an acronym for Email Address Internationalization.
+ * This validator is selected automatically if you attempt to use recipient addresses
+ * that contain Unicode characters in the local part.
+ *
+ * @see https://html.spec.whatwg.org/#e-mail-state-(type=email)
+ * @see https://en.wikipedia.org/wiki/International_email
+ */
+ return (bool) preg_match(
+ '/^[-\p{L}\p{N}\p{M}.!#$%&\'*+\/=?^_`{|}~]+@[\p{L}\p{N}\p{M}](?:[\p{L}\p{N}\p{M}-]{0,61}' .
+ '[\p{L}\p{N}\p{M}])?(?:\.[\p{L}\p{N}\p{M}]' .
+ '(?:[-\p{L}\p{N}\p{M}]{0,61}[\p{L}\p{N}\p{M}])?)*$/usD',
+ $address
+ );
+ case 'php':
+ default:
+ return filter_var($address, FILTER_VALIDATE_EMAIL) !== false;
+ }
+ }
+
+ /**
+ * Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the
+ * `intl` and `mbstring` PHP extensions.
+ *
+ * @return bool `true` if required functions for IDN support are present
+ */
+ public static function idnSupported()
+ {
+ return function_exists('idn_to_ascii') && function_exists('mb_convert_encoding');
+ }
+
+ /**
+ * Converts IDN in given email address to its ASCII form, also known as punycode, if possible.
+ * Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet.
+ * This function silently returns unmodified address if:
+ * - No conversion is necessary (i.e. domain name is not an IDN, or is already in ASCII form)
+ * - Conversion to punycode is impossible (e.g. required PHP functions are not available)
+ * or fails for any reason (e.g. domain contains characters not allowed in an IDN).
+ *
+ * @see PHPMailer::$CharSet
+ *
+ * @param string $address The email address to convert
+ *
+ * @return string The encoded address in ASCII form
+ */
+ public function punyencodeAddress($address)
+ {
+ //Verify we have required functions, CharSet, and at-sign.
+ $pos = strrpos($address, '@');
+ if (
+ !empty($this->CharSet) &&
+ false !== $pos &&
+ static::idnSupported()
+ ) {
+ $domain = substr($address, ++$pos);
+ //Verify CharSet string is a valid one, and domain properly encoded in this CharSet.
+ if ($this->has8bitChars($domain) && @mb_check_encoding($domain, $this->CharSet)) {
+ //Convert the domain from whatever charset it's in to UTF-8
+ $domain = mb_convert_encoding($domain, self::CHARSET_UTF8, $this->CharSet);
+ //Ignore IDE complaints about this line - method signature changed in PHP 5.4
+ $errorcode = 0;
+ if (defined('INTL_IDNA_VARIANT_UTS46')) {
+ //Use the current punycode standard (appeared in PHP 7.2)
+ $punycode = idn_to_ascii(
+ $domain,
+ \IDNA_DEFAULT | \IDNA_USE_STD3_RULES | \IDNA_CHECK_BIDI |
+ \IDNA_CHECK_CONTEXTJ | \IDNA_NONTRANSITIONAL_TO_ASCII,
+ \INTL_IDNA_VARIANT_UTS46
+ );
+ } elseif (defined('INTL_IDNA_VARIANT_2003')) {
+ //Fall back to this old, deprecated/removed encoding
+ $punycode = idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_2003);
+ } else {
+ //Fall back to a default we don't know about
+ $punycode = idn_to_ascii($domain, $errorcode);
+ }
+ if (false !== $punycode) {
+ return substr($address, 0, $pos) . $punycode;
+ }
+ }
+ }
+
+ return $address;
+ }
+
+ /**
+ * Create a message and send it.
+ * Uses the sending method specified by $Mailer.
+ *
+ * @throws Exception
+ *
+ * @return bool false on error - See the ErrorInfo property for details of the error
+ */
+ public function send()
+ {
+ try {
+ if (!$this->preSend()) {
+ return false;
+ }
+
+ return $this->postSend();
+ } catch (Exception $exc) {
+ $this->mailHeader = '';
+ $this->setError($exc->getMessage());
+ if ($this->exceptions) {
+ throw $exc;
+ }
+
+ return false;
+ }
+ }
+
+ /**
+ * Prepare a message for sending.
+ *
+ * @throws Exception
+ *
+ * @return bool
+ */
+ public function preSend()
+ {
+ if (
+ 'smtp' === $this->Mailer
+ || ('mail' === $this->Mailer && (\PHP_VERSION_ID >= 80000 || stripos(PHP_OS, 'WIN') === 0))
+ ) {
+ //SMTP mandates RFC-compliant line endings
+ //and it's also used with mail() on Windows
+ static::setLE(self::CRLF);
+ } else {
+ //Maintain backward compatibility with legacy Linux command line mailers
+ static::setLE(PHP_EOL);
+ }
+ //Check for buggy PHP versions that add a header with an incorrect line break
+ if (
+ 'mail' === $this->Mailer
+ && ((\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70017)
+ || (\PHP_VERSION_ID >= 70100 && \PHP_VERSION_ID < 70103))
+ && ini_get('mail.add_x_header') === '1'
+ && stripos(PHP_OS, 'WIN') === 0
+ ) {
+ trigger_error(self::lang('buggy_php'), E_USER_WARNING);
+ }
+
+ try {
+ $this->error_count = 0; //Reset errors
+ $this->mailHeader = '';
+
+ //The code below tries to support full use of Unicode,
+ //while remaining compatible with legacy SMTP servers to
+ //the greatest degree possible: If the message uses
+ //Unicode in the local parts of any addresses, it is sent
+ //using SMTPUTF8. If not, it it sent using
+ //punycode-encoded domains and plain SMTP.
+ if (
+ static::CHARSET_UTF8 === strtolower($this->CharSet) &&
+ ($this->anyAddressHasUnicodeLocalPart($this->RecipientsQueue) ||
+ $this->anyAddressHasUnicodeLocalPart(array_keys($this->all_recipients)) ||
+ $this->anyAddressHasUnicodeLocalPart($this->ReplyToQueue) ||
+ $this->addressHasUnicodeLocalPart($this->From))
+ ) {
+ $this->UseSMTPUTF8 = true;
+ }
+ //Dequeue recipient and Reply-To addresses with IDN
+ foreach (array_merge($this->RecipientsQueue, $this->ReplyToQueue) as $params) {
+ if (!$this->UseSMTPUTF8) {
+ $params[1] = $this->punyencodeAddress($params[1]);
+ }
+ call_user_func_array([$this, 'addAnAddress'], $params);
+ }
+ if (count($this->to) + count($this->cc) + count($this->bcc) < 1) {
+ throw new Exception(self::lang('provide_address'), self::STOP_CRITICAL);
+ }
+
+ //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;
+ }
+ $this->{$address_kind} = $this->punyencodeAddress($this->{$address_kind});
+ if (!static::validateAddress($this->{$address_kind})) {
+ $error_message = sprintf(
+ '%s (%s): %s',
+ self::lang('invalid_address'),
+ $address_kind,
+ $this->{$address_kind}
+ );
+ $this->setError($error_message);
+ $this->edebug($error_message);
+ if ($this->exceptions) {
+ throw new Exception($error_message);
+ }
+
+ return false;
+ }
+ }
+
+ //Set whether the message is multipart/alternative
+ if ($this->alternativeExists()) {
+ $this->ContentType = static::CONTENT_TYPE_MULTIPART_ALTERNATIVE;
+ }
+
+ $this->setMessageType();
+ //Refuse to send an empty message unless we are specifically allowing it
+ if (!$this->AllowEmpty && empty($this->Body)) {
+ throw new Exception(self::lang('empty_message'), self::STOP_CRITICAL);
+ }
+
+ //Trim subject consistently
+ $this->Subject = trim($this->Subject);
+ //Create body before headers in case body makes changes to headers (e.g. altering transfer encoding)
+ $this->MIMEHeader = '';
+ $this->MIMEBody = $this->createBody();
+ //createBody may have added some headers, so retain them
+ $tempheaders = $this->MIMEHeader;
+ $this->MIMEHeader = $this->createHeader();
+ $this->MIMEHeader .= $tempheaders;
+
+ //To capture the complete message when using mail(), create
+ //an extra header list which createHeader() doesn't fold in
+ if ('mail' === $this->Mailer) {
+ if (count($this->to) > 0) {
+ $this->mailHeader .= $this->addrAppend('To', $this->to);
+ } else {
+ $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;');
+ }
+ $this->mailHeader .= $this->headerLine(
+ 'Subject',
+ $this->encodeHeader($this->secureHeader($this->Subject))
+ );
+ }
+
+ //Sign with DKIM if enabled
+ if (
+ !empty($this->DKIM_domain)
+ && !empty($this->DKIM_selector)
+ && (!empty($this->DKIM_private_string)
+ || (!empty($this->DKIM_private)
+ && static::isPermittedPath($this->DKIM_private)
+ && file_exists($this->DKIM_private)
+ )
+ )
+ ) {
+ $header_dkim = $this->DKIM_Add(
+ $this->MIMEHeader . $this->mailHeader,
+ $this->encodeHeader($this->secureHeader($this->Subject)),
+ $this->MIMEBody
+ );
+ $this->MIMEHeader = static::stripTrailingWSP($this->MIMEHeader) . static::$LE .
+ static::normalizeBreaks($header_dkim) . static::$LE;
+ }
+
+ return true;
+ } catch (Exception $exc) {
+ $this->setError($exc->getMessage());
+ if ($this->exceptions) {
+ throw $exc;
+ }
+
+ return false;
+ }
+ }
+
+ /**
+ * Actually send a message via the selected mechanism.
+ *
+ * @throws Exception
+ *
+ * @return bool
+ */
+ public function postSend()
+ {
+ try {
+ //Choose the mailer and send through it
+ switch ($this->Mailer) {
+ case 'sendmail':
+ case 'qmail':
+ return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody);
+ case 'smtp':
+ return $this->smtpSend($this->MIMEHeader, $this->MIMEBody);
+ case 'mail':
+ return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
+ default:
+ $sendMethod = $this->Mailer . 'Send';
+ if (method_exists($this, $sendMethod)) {
+ return $this->{$sendMethod}($this->MIMEHeader, $this->MIMEBody);
+ }
+
+ return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
+ }
+ } catch (Exception $exc) {
+ $this->setError($exc->getMessage());
+ $this->edebug($exc->getMessage());
+ if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) {
+ $this->smtp->reset();
+ }
+ if ($this->exceptions) {
+ throw $exc;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Send mail using the $Sendmail program.
+ *
+ * @see PHPMailer::$Sendmail
+ *
+ * @param string $header The message headers
+ * @param string $body The message body
+ *
+ * @throws Exception
+ *
+ * @return bool
+ */
+ protected function sendmailSend($header, $body)
+ {
+ if ($this->Mailer === 'qmail') {
+ $this->edebug('Sending with qmail');
+ } else {
+ $this->edebug('Sending with sendmail');
+ }
+ $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;
+ //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
+ //A space after `-f` is optional, but there is a long history of its presence
+ //causing problems, so we don't use one
+ //Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
+ //Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html
+ //Example problem: https://www.drupal.org/node/1057954
+
+ //PHP 5.6 workaround
+ $sendmail_from_value = ini_get('sendmail_from');
+ if (empty($this->Sender) && !empty($sendmail_from_value)) {
+ //PHP config has a sender address we can use
+ $this->Sender = ini_get('sendmail_from');
+ }
+ //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
+ if (!empty($this->Sender) && static::validateAddress($this->Sender) && self::isShellSafe($this->Sender)) {
+ if ($this->Mailer === 'qmail') {
+ $sendmailFmt = '%s -f%s';
+ } else {
+ $sendmailFmt = '%s -oi -f%s -t';
+ }
+ } elseif ($this->Mailer === 'qmail') {
+ $sendmailFmt = '%s';
+ } else {
+ //Allow sendmail to choose a default envelope sender. It may
+ //seem preferable to force it to use the From header as with
+ //SMTP, but that introduces new problems (see
+ //), and
+ //it has historically worked this way.
+ $sendmailFmt = '%s -oi -t';
+ }
+
+ $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender);
+ $this->edebug('Sendmail path: ' . $this->Sendmail);
+ $this->edebug('Sendmail command: ' . $sendmail);
+ $this->edebug('Envelope sender: ' . $this->Sender);
+ $this->edebug("Headers: {$header}");
+
+ if ($this->SingleTo) {
+ foreach ($this->SingleToArray as $toAddr) {
+ $mail = @popen($sendmail, 'w');
+ if (!$mail) {
+ throw new Exception(self::lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+ }
+ $this->edebug("To: {$toAddr}");
+ fwrite($mail, 'To: ' . $toAddr . "\n");
+ fwrite($mail, $header);
+ fwrite($mail, $body);
+ $result = pclose($mail);
+ $addrinfo = static::parseAddresses($toAddr, null, $this->CharSet);
+ foreach ($addrinfo as $addr) {
+ $this->doCallback(
+ ($result === 0),
+ [[$addr['address'], $addr['name']]],
+ $this->cc,
+ $this->bcc,
+ $this->Subject,
+ $body,
+ $this->From,
+ []
+ );
+ }
+ $this->edebug("Result: " . ($result === 0 ? 'true' : 'false'));
+ if (0 !== $result) {
+ throw new Exception(self::lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+ }
+ }
+ } else {
+ $mail = @popen($sendmail, 'w');
+ if (!$mail) {
+ throw new Exception(self::lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+ }
+ fwrite($mail, $header);
+ fwrite($mail, $body);
+ $result = pclose($mail);
+ $this->doCallback(
+ ($result === 0),
+ $this->to,
+ $this->cc,
+ $this->bcc,
+ $this->Subject,
+ $body,
+ $this->From,
+ []
+ );
+ $this->edebug("Result: " . ($result === 0 ? 'true' : 'false'));
+ if (0 !== $result) {
+ throw new Exception(self::lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters.
+ * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows.
+ *
+ * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report
+ *
+ * @param string $string The string to be validated
+ *
+ * @return bool
+ */
+ protected static function isShellSafe($string)
+ {
+ //It's not possible to use shell commands safely (which includes the mail() function) without escapeshellarg,
+ //but some hosting providers disable it, creating a security problem that we don't want to have to deal with,
+ //so we don't.
+ if (!function_exists('escapeshellarg') || !function_exists('escapeshellcmd')) {
+ return false;
+ }
+
+ if (
+ escapeshellcmd($string) !== $string
+ || !in_array(escapeshellarg($string), ["'$string'", "\"$string\""])
+ ) {
+ return false;
+ }
+
+ $length = strlen($string);
+
+ for ($i = 0; $i < $length; ++$i) {
+ $c = $string[$i];
+
+ //All other characters have a special meaning in at least one common shell, including = and +.
+ //Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here.
+ //Note that this does permit non-Latin alphanumeric characters based on the current locale.
+ if (!ctype_alnum($c) && strpos('@_-.', $c) === false) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Check whether a file path is of a permitted type.
+ * Used to reject URLs and phar files from functions that access local file paths,
+ * such as addAttachment.
+ *
+ * @param string $path A relative or absolute path to a file
+ *
+ * @return bool
+ */
+ protected static function isPermittedPath($path)
+ {
+ //Matches scheme definition from https://www.rfc-editor.org/rfc/rfc3986#section-3.1
+ return !preg_match('#^[a-z][a-z\d+.-]*://#i', $path);
+ }
+
+ /**
+ * Check whether a file path is safe, accessible, and readable.
+ *
+ * @param string $path A relative or absolute path to a file
+ *
+ * @return bool
+ */
+ protected static function fileIsAccessible($path)
+ {
+ if (!static::isPermittedPath($path)) {
+ return false;
+ }
+ $readable = is_file($path);
+ //If not a UNC path (expected to start with \\), check read permission, see #2069
+ if (strpos($path, '\\\\') !== 0) {
+ $readable = $readable && is_readable($path);
+ }
+ return $readable;
+ }
+
+ /**
+ * Send mail using the PHP mail() function.
+ *
+ * @see https://www.php.net/manual/en/book.mail.php
+ *
+ * @param string $header The message headers
+ * @param string $body The message body
+ *
+ * @throws Exception
+ *
+ * @return bool
+ */
+ protected function mailSend($header, $body)
+ {
+ $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;
+
+ $toArr = [];
+ foreach ($this->to as $toaddr) {
+ $toArr[] = $this->addrFormat($toaddr);
+ }
+ $to = trim(implode(', ', $toArr));
+
+ //If there are no To-addresses (e.g. when sending only to BCC-addresses)
+ //the following should be added to get a correct DKIM-signature.
+ //Compare with $this->preSend()
+ if ($to === '') {
+ $to = 'undisclosed-recipients:;';
+ }
+
+ $params = null;
+ //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
+ //A space after `-f` is optional, but there is a long history of its presence
+ //causing problems, so we don't use one
+ //Exim docs: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-the_exim_command_line.html
+ //Sendmail docs: https://www.sendmail.org/~ca/email/man/sendmail.html
+ //Example problem: https://www.drupal.org/node/1057954
+ //CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
+
+ //PHP 5.6 workaround
+ $sendmail_from_value = ini_get('sendmail_from');
+ if (empty($this->Sender) && !empty($sendmail_from_value)) {
+ //PHP config has a sender address we can use
+ $this->Sender = ini_get('sendmail_from');
+ }
+ if (!empty($this->Sender) && static::validateAddress($this->Sender)) {
+ if (self::isShellSafe($this->Sender)) {
+ $params = sprintf('-f%s', $this->Sender);
+ }
+ $old_from = ini_get('sendmail_from');
+ ini_set('sendmail_from', $this->Sender);
+ }
+ $result = false;
+ if ($this->SingleTo && count($toArr) > 1) {
+ foreach ($toArr as $toAddr) {
+ $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
+ $addrinfo = static::parseAddresses($toAddr, null, $this->CharSet);
+ foreach ($addrinfo as $addr) {
+ $this->doCallback(
+ $result,
+ [[$addr['address'], $addr['name']]],
+ $this->cc,
+ $this->bcc,
+ $this->Subject,
+ $body,
+ $this->From,
+ []
+ );
+ }
+ }
+ } else {
+ $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
+ $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From, []);
+ }
+ if (isset($old_from)) {
+ ini_set('sendmail_from', $old_from);
+ }
+ if (!$result) {
+ throw new Exception(self::lang('instantiate'), self::STOP_CRITICAL);
+ }
+
+ return true;
+ }
+
+ /**
+ * Get an instance to use for SMTP operations.
+ * Override this function to load your own SMTP implementation,
+ * or set one with setSMTPInstance.
+ *
+ * @return SMTP
+ */
+ public function getSMTPInstance()
+ {
+ if (!is_object($this->smtp)) {
+ $this->smtp = new SMTP();
+ }
+
+ return $this->smtp;
+ }
+
+ /**
+ * Provide an instance to use for SMTP operations.
+ *
+ * @return SMTP
+ */
+ public function setSMTPInstance(SMTP $smtp)
+ {
+ $this->smtp = $smtp;
+
+ return $this->smtp;
+ }
+
+ /**
+ * Provide SMTP XCLIENT attributes
+ *
+ * @param string $name Attribute name
+ * @param ?string $value Attribute value
+ *
+ * @return bool
+ */
+ public function setSMTPXclientAttribute($name, $value)
+ {
+ if (!in_array($name, SMTP::$xclient_allowed_attributes)) {
+ return false;
+ }
+ if (isset($this->SMTPXClient[$name]) && $value === null) {
+ unset($this->SMTPXClient[$name]);
+ } elseif ($value !== null) {
+ $this->SMTPXClient[$name] = $value;
+ }
+
+ return true;
+ }
+
+ /**
+ * Get SMTP XCLIENT attributes
+ *
+ * @return array
+ */
+ public function getSMTPXclientAttributes()
+ {
+ return $this->SMTPXClient;
+ }
+
+ /**
+ * Send mail via SMTP.
+ * Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
+ *
+ * @see PHPMailer::setSMTPInstance() to use a different class.
+ *
+ * @uses \PHPMailer\PHPMailer\SMTP
+ *
+ * @param string $header The message headers
+ * @param string $body The message body
+ *
+ * @throws Exception
+ *
+ * @return bool
+ */
+ protected function smtpSend($header, $body)
+ {
+ $header = static::stripTrailingWSP($header) . static::$LE . static::$LE;
+ $bad_rcpt = [];
+ if (!$this->smtpConnect($this->SMTPOptions)) {
+ throw new Exception(self::lang('smtp_connect_failed'), self::STOP_CRITICAL);
+ }
+ //If we have recipient addresses that need Unicode support,
+ //but the server doesn't support it, stop here
+ if ($this->UseSMTPUTF8 && !$this->smtp->getServerExt('SMTPUTF8')) {
+ throw new Exception(self::lang('no_smtputf8'), self::STOP_CRITICAL);
+ }
+ //Sender already validated in preSend()
+ if ('' === $this->Sender) {
+ $smtp_from = $this->From;
+ } else {
+ $smtp_from = $this->Sender;
+ }
+ if (count($this->SMTPXClient)) {
+ $this->smtp->xclient($this->SMTPXClient);
+ }
+ if (!$this->smtp->mail($smtp_from)) {
+ $this->setError(self::lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
+ throw new Exception($this->ErrorInfo, self::STOP_CRITICAL);
+ }
+
+ $callbacks = [];
+ //Attempt to send to all recipients
+ foreach ([$this->to, $this->cc, $this->bcc] as $togroup) {
+ foreach ($togroup as $to) {
+ if (!$this->smtp->recipient($to[0], $this->dsn)) {
+ $error = $this->smtp->getError();
+ $bad_rcpt[] = ['to' => $to[0], 'error' => $error['detail']];
+ $isSent = false;
+ } else {
+ $isSent = true;
+ }
+
+ $callbacks[] = ['issent' => $isSent, 'to' => $to[0], 'name' => $to[1]];
+ }
+ }
+
+ //Only send the DATA command if we have viable recipients
+ if ((count($this->all_recipients) > count($bad_rcpt)) && !$this->smtp->data($header . $body)) {
+ throw new Exception(self::lang('data_not_accepted'), self::STOP_CRITICAL);
+ }
+
+ $smtp_transaction_id = $this->smtp->getLastTransactionID();
+
+ if ($this->SMTPKeepAlive) {
+ $this->smtp->reset();
+ } else {
+ $this->smtp->quit();
+ $this->smtp->close();
+ }
+
+ foreach ($callbacks as $cb) {
+ $this->doCallback(
+ $cb['issent'],
+ [[$cb['to'], $cb['name']]],
+ [],
+ [],
+ $this->Subject,
+ $body,
+ $this->From,
+ ['smtp_transaction_id' => $smtp_transaction_id]
+ );
+ }
+
+ //Create error message for any bad addresses
+ if (count($bad_rcpt) > 0) {
+ $errstr = '';
+ foreach ($bad_rcpt as $bad) {
+ $errstr .= $bad['to'] . ': ' . $bad['error'];
+ }
+ throw new Exception(self::lang('recipients_failed') . $errstr, self::STOP_CONTINUE);
+ }
+
+ return true;
+ }
+
+ /**
+ * Initiate a connection to an SMTP server.
+ * Returns false if the operation failed.
+ *
+ * @param array $options An array of options compatible with stream_context_create()
+ *
+ * @throws Exception
+ *
+ * @uses \PHPMailer\PHPMailer\SMTP
+ *
+ * @return bool
+ */
+ public function smtpConnect($options = null)
+ {
+ if (null === $this->smtp) {
+ $this->smtp = $this->getSMTPInstance();
+ }
+
+ //If no options are provided, use whatever is set in the instance
+ if (null === $options) {
+ $options = $this->SMTPOptions;
+ }
+
+ //Already connected?
+ if ($this->smtp->connected()) {
+ return true;
+ }
+
+ $this->smtp->setTimeout($this->Timeout);
+ $this->smtp->setDebugLevel($this->SMTPDebug);
+ $this->smtp->setDebugOutput($this->Debugoutput);
+ $this->smtp->setVerp($this->do_verp);
+ $this->smtp->setSMTPUTF8($this->UseSMTPUTF8);
+ if ($this->Host === null) {
+ $this->Host = 'localhost';
+ }
+ $hosts = explode(';', $this->Host);
+ $lastexception = null;
+
+ foreach ($hosts as $hostentry) {
+ $hostinfo = [];
+ if (
+ !preg_match(
+ '/^(?:(ssl|tls):\/\/)?(.+?)(?::(\d+))?$/',
+ trim($hostentry),
+ $hostinfo
+ )
+ ) {
+ $this->edebug(self::lang('invalid_hostentry') . ' ' . trim($hostentry));
+ //Not a valid host entry
+ continue;
+ }
+ //$hostinfo[1]: optional ssl or tls prefix
+ //$hostinfo[2]: the hostname
+ //$hostinfo[3]: optional port number
+ //The host string prefix can temporarily override the current setting for SMTPSecure
+ //If it's not specified, the default value is used
+
+ //Check the host name is a valid name or IP address before trying to use it
+ if (!static::isValidHost($hostinfo[2])) {
+ $this->edebug(self::lang('invalid_host') . ' ' . $hostinfo[2]);
+ continue;
+ }
+ $prefix = '';
+ $secure = $this->SMTPSecure;
+ $tls = (static::ENCRYPTION_STARTTLS === $this->SMTPSecure);
+ if ('ssl' === $hostinfo[1] || ('' === $hostinfo[1] && static::ENCRYPTION_SMTPS === $this->SMTPSecure)) {
+ $prefix = 'ssl://';
+ $tls = false; //Can't have SSL and TLS at the same time
+ $secure = static::ENCRYPTION_SMTPS;
+ } elseif ('tls' === $hostinfo[1]) {
+ $tls = true;
+ //TLS doesn't use a prefix
+ $secure = static::ENCRYPTION_STARTTLS;
+ }
+ //Do we need the OpenSSL extension?
+ $sslext = defined('OPENSSL_ALGO_SHA256');
+ if (static::ENCRYPTION_STARTTLS === $secure || static::ENCRYPTION_SMTPS === $secure) {
+ //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
+ if (!$sslext) {
+ throw new Exception(self::lang('extension_missing') . 'openssl', self::STOP_CRITICAL);
+ }
+ }
+ $host = $hostinfo[2];
+ $port = $this->Port;
+ if (
+ array_key_exists(3, $hostinfo) &&
+ is_numeric($hostinfo[3]) &&
+ $hostinfo[3] > 0 &&
+ $hostinfo[3] < 65536
+ ) {
+ $port = (int) $hostinfo[3];
+ }
+ if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
+ try {
+ if ($this->Helo) {
+ $hello = $this->Helo;
+ } else {
+ $hello = $this->serverHostname();
+ }
+ $this->smtp->hello($hello);
+ //Automatically enable TLS encryption if:
+ //* it's not disabled
+ //* we are not connecting to localhost
+ //* we have openssl extension
+ //* we are not already using SSL
+ //* the server offers STARTTLS
+ if (
+ $this->SMTPAutoTLS &&
+ $this->Host !== 'localhost' &&
+ $sslext &&
+ $secure !== 'ssl' &&
+ $this->smtp->getServerExt('STARTTLS')
+ ) {
+ $tls = true;
+ }
+ if ($tls) {
+ if (!$this->smtp->startTLS()) {
+ $message = $this->getSmtpErrorMessage('connect_host');
+ throw new Exception($message);
+ }
+ //We must resend EHLO after TLS negotiation
+ $this->smtp->hello($hello);
+ }
+ if (
+ $this->SMTPAuth && !$this->smtp->authenticate(
+ $this->Username,
+ $this->Password,
+ $this->AuthType,
+ $this->oauth
+ )
+ ) {
+ throw new Exception(self::lang('authenticate'));
+ }
+
+ return true;
+ } catch (Exception $exc) {
+ $lastexception = $exc;
+ $this->edebug($exc->getMessage());
+ //We must have connected, but then failed TLS or Auth, so close connection nicely
+ $this->smtp->quit();
+ }
+ }
+ }
+ //If we get here, all connection attempts have failed, so close connection hard
+ $this->smtp->close();
+ //As we've caught all exceptions, just report whatever the last one was
+ if ($this->exceptions && null !== $lastexception) {
+ throw $lastexception;
+ }
+ if ($this->exceptions) {
+ // no exception was thrown, likely $this->smtp->connect() failed
+ $message = $this->getSmtpErrorMessage('connect_host');
+ throw new Exception($message);
+ }
+
+ return false;
+ }
+
+ /**
+ * Close the active SMTP session if one exists.
+ */
+ public function smtpClose()
+ {
+ if ((null !== $this->smtp) && $this->smtp->connected()) {
+ $this->smtp->quit();
+ $this->smtp->close();
+ }
+ }
+
+ /**
+ * Set the language for error messages.
+ * The default language is English.
+ *
+ * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr")
+ * Optionally, the language code can be enhanced with a 4-character
+ * script annotation and/or a 2-character country annotation.
+ * @param string $lang_path Path to the language file directory, with trailing separator (slash)
+ * Do not set this from user input!
+ *
+ * @return bool Returns true if the requested language was loaded, false otherwise.
+ */
+ public static function setLanguage($langcode = 'en', $lang_path = '')
+ {
+ //Backwards compatibility for renamed language codes
+ $renamed_langcodes = [
+ 'br' => 'pt_br',
+ 'cz' => 'cs',
+ 'dk' => 'da',
+ 'no' => 'nb',
+ 'se' => 'sv',
+ 'rs' => 'sr',
+ 'tg' => 'tl',
+ 'am' => 'hy',
+ ];
+
+ if (array_key_exists($langcode, $renamed_langcodes)) {
+ $langcode = $renamed_langcodes[$langcode];
+ }
+
+ //Define full set of translatable strings in English
+ $PHPMAILER_LANG = [
+ 'authenticate' => 'SMTP Error: Could not authenticate.',
+ 'buggy_php' => 'Your version of PHP is affected by a bug that may result in corrupted messages.' .
+ ' To fix it, switch to sending using SMTP, disable the mail.add_x_header option in' .
+ ' your php.ini, switch to MacOS or Linux, or upgrade your PHP to version 7.0.17+ or 7.1.3+.',
+ 'connect_host' => 'SMTP Error: Could not connect to SMTP host.',
+ 'data_not_accepted' => 'SMTP Error: data not accepted.',
+ 'empty_message' => 'Message body empty',
+ 'encoding' => 'Unknown encoding: ',
+ 'execute' => 'Could not execute: ',
+ 'extension_missing' => 'Extension missing: ',
+ 'file_access' => 'Could not access file: ',
+ 'file_open' => 'File Error: Could not open file: ',
+ 'from_failed' => 'The following From address failed: ',
+ 'instantiate' => 'Could not instantiate mail function.',
+ 'invalid_address' => 'Invalid address: ',
+ 'invalid_header' => 'Invalid header name or value',
+ 'invalid_hostentry' => 'Invalid hostentry: ',
+ 'invalid_host' => 'Invalid host: ',
+ 'mailer_not_supported' => ' mailer is not supported.',
+ 'provide_address' => 'You must provide at least one recipient email address.',
+ 'recipients_failed' => 'SMTP Error: The following recipients failed: ',
+ 'signing' => 'Signing Error: ',
+ 'smtp_code' => 'SMTP code: ',
+ 'smtp_code_ex' => 'Additional SMTP info: ',
+ 'smtp_connect_failed' => 'SMTP connect() failed.',
+ 'smtp_detail' => 'Detail: ',
+ 'smtp_error' => 'SMTP server error: ',
+ 'variable_set' => 'Cannot set or reset variable: ',
+ 'no_smtputf8' => 'Server does not support SMTPUTF8 needed to send to Unicode addresses',
+ 'imap_recommended' => 'Using simplified address parser is not recommended. ' .
+ 'Install the PHP IMAP extension for full RFC822 parsing.',
+ 'deprecated_argument' => 'Argument $useimap is deprecated',
+ ];
+ if (empty($lang_path)) {
+ //Calculate an absolute path so it can work if CWD is not here
+ $lang_path = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'language' . DIRECTORY_SEPARATOR;
+ }
+
+ //Validate $langcode
+ $foundlang = true;
+ $langcode = strtolower($langcode);
+ if (
+ !preg_match('/^(?P[a-z]{2})(?P