Add patch to Net_SMTP for php7 compatability
authorSeamus Lee <seamuslee001@gmail.com>
Sat, 20 May 2017 02:42:47 +0000 (12:42 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Sun, 21 May 2017 04:48:26 +0000 (04:48 +0000)
tools/scripts/composer/net-smtp-fix.sh
tools/scripts/composer/patches/net-smtp-php7-patch.txt [new file with mode: 0644]

index fb573c15b64cb49a764f235acdc03920d5f76d82..87721739d9566205c1fee5c5d56290602eb56083 100755 (executable)
@@ -18,3 +18,6 @@ fi
 if ! grep -q '@STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT' vendor/pear/net_smtp/Net/SMTP.php; then
 patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-tls-patch.txt
 fi
+if ! grep -q 'function __construct' vendor/pear/net_smtp/Net/SMTP.php; then
+patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-php7-patch.txt
+fi
diff --git a/tools/scripts/composer/patches/net-smtp-php7-patch.txt b/tools/scripts/composer/patches/net-smtp-php7-patch.txt
new file mode 100644 (file)
index 0000000..6ed1605
--- /dev/null
@@ -0,0 +1,11 @@
+--- SMTP.php    2017-05-20 11:50:53.716664059 +1000
++++ SMTP.php.new        2017-05-20 12:38:36.271530119 +1000
+@@ -167,7 +167,7 @@
+      * @access  public
+      * @since   1.0
+      */
+-    function Net_SMTP($host = null, $port = null, $localhost = null,
++    function __construct($host = null, $port = null, $localhost = null,
+         $pipelining = false, $timeout = 0, $socket_options = null)
+     {
+         if (isset($host)) {