浏览代码

Add PHP5-style constructor

pdontthink 8 年之前
父节点
当前提交
416ab4ec38
共有 1 个文件被更改,包括 13 次插入2 次删除
  1. 13 2
      class/deliver/Deliver_SendMail.class.php

+ 13 - 2
class/deliver/Deliver_SendMail.class.php

@@ -47,13 +47,13 @@ class Deliver_SendMail extends Deliver {
     var $sendmail_command = '';
 
     /**
-     * Constructor function
+     * Constructor (PHP5 style, required in some future version of PHP)
      * @param array configuration options. array key = option name, 
      * array value = option value.
      * @return void
      * @since 1.5.1
      */
-    function Deliver_SendMail($params=array()) {
+    function __construct($params=array()) {
         if (!empty($params) && is_array($params)) {
             // set extra sendmail arguments
             if (isset($params['sendmail_args'])) {
@@ -62,6 +62,17 @@ class Deliver_SendMail extends Deliver {
         }
     }
 
+    /**
+     * Constructor (PHP4 style, kept for compatibility reasons)
+     * @param array configuration options. array key = option name, 
+     * array value = option value.
+     * @return void
+     * @since 1.5.1
+     */
+    function Deliver_SendMail($params=array()) {
+        self::__construct($params);
+    }
+
    /**
     * function preWriteToStream
     *