php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #75877
Patch 75877_phpmailer_composer.patch revision 2018-11-12 02:49 UTC by zach at zrhoffman dot net

Patch 75877_phpmailer_composer.patch for Systems problem Bug #75877

Patch version 2018-11-12 02:49 UTC

Return to Bug #75877 | Download this patch
Patch Revisions:

Developer: zach@zrhoffman.net

commit 17141d4fefb7e323ec611a18960e6c5f34501d61
Author: zrhoffman <zach@zrhoffman.net>
Date:   Sun Nov 11 20:36:34 2018 -0600

    Load PHPMailer as a composer dependency
    
    PHP 5.5 and the "zip" extension are required by phpmailer/phpmailer, but since
    our limited use of that package seems to work on PHP 5.4 without the "zip"
    extension, we can ignore this platform requirement and dependency.

diff --git a/.gitignore b/.gitignore
index 7b6cb71..0d0fa33 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,5 @@
 .token_flickr
 tags
 manage/github-config.php
+/vendor
+!/vendor/michelf
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..caacbf2
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,13 @@
+{
+  "require": {
+    "phpmailer/phpmailer": "^6.0.5"
+  },
+  "replace": {
+    "ext-zip": "*"
+  },
+  "config": {
+    "platform": {
+      "php": "5.5"
+    }
+  }
+}
diff --git a/composer.lock b/composer.lock
new file mode 100644
index 0000000..3d77d09
--- /dev/null
+++ b/composer.lock
@@ -0,0 +1,87 @@
+{
+    "_readme": [
+        "This file locks the dependencies of your project to a known state",
+        "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+        "This file is @generated automatically"
+    ],
+    "content-hash": "78fdae9cd05d53b68a9e59ba05a9ef20",
+    "packages": [
+        {
+            "name": "phpmailer/phpmailer",
+            "version": "v6.0.5",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/PHPMailer/PHPMailer.git",
+                "reference": "cb3ea134d4d3729e7857737d5f320cce9caf4d32"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/cb3ea134d4d3729e7857737d5f320cce9caf4d32",
+                "reference": "cb3ea134d4d3729e7857737d5f320cce9caf4d32",
+                "shasum": ""
+            },
+            "require": {
+                "ext-ctype": "*",
+                "ext-filter": "*",
+                "php": ">=5.5.0"
+            },
+            "require-dev": {
+                "doctrine/annotations": "1.2.*",
+                "friendsofphp/php-cs-fixer": "^2.2",
+                "phpdocumentor/phpdocumentor": "2.*",
+                "phpunit/phpunit": "^4.8 || ^5.7",
+                "zendframework/zend-eventmanager": "3.0.*",
+                "zendframework/zend-i18n": "2.7.3",
+                "zendframework/zend-serializer": "2.7.*"
+            },
+            "suggest": {
+                "ext-mbstring": "Needed to send email in multibyte encoding charset",
+                "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
+                "league/oauth2-google": "Needed for Google XOAUTH2 authentication",
+                "psr/log": "For optional PSR-3 debug logging",
+                "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
+                "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "PHPMailer\\PHPMailer\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "LGPL-2.1"
+            ],
+            "authors": [
+                {
+                    "name": "Jim Jagielski",
+                    "email": "jimjag@gmail.com"
+                },
+                {
+                    "name": "Marcus Bointon",
+                    "email": "phpmailer@synchromedia.co.uk"
+                },
+                {
+                    "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",
+            "time": "2018-03-27T13:49:45+00:00"
+        }
+    ],
+    "packages-dev": [],
+    "aliases": [],
+    "minimum-stability": "stable",
+    "stability-flags": [],
+    "prefer-stable": false,
+    "prefer-lowest": false,
+    "platform": [],
+    "platform-dev": [],
+    "platform-overrides": {
+        "php": "5.5"
+    }
+}
diff --git a/entry/subscribe.php b/entry/subscribe.php
index 7500cc5..8a14c0b 100644
--- a/entry/subscribe.php
+++ b/entry/subscribe.php
@@ -3,9 +3,7 @@
 use PHPMailer\PHPMailer\PHPMailer;
 use PHPMailer\PHPMailer\Exception;
 
-require 'PHPMailer/src/Exception.php';
-require 'PHPMailer/src/PHPMailer.php';
-require 'PHPMailer/src/SMTP.php';
+require_once __DIR__ . '/../vendor/autoload.php';
 
 include "email-validation.inc";
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC