浏览代码

Add PHP5-style constructor

pdontthink 8 年之前
父节点
当前提交
50f7e1b6db
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      class/mime/Disposition.class.php

+ 10 - 2
class/mime/Disposition.class.php

@@ -23,14 +23,22 @@
  */
 class Disposition {
     /**
-     * Constructor function
+     * Constructor (PHP5 style, required in some future version of PHP)
      * @param string $name
      */
-    function Disposition($name) {
+    function __construct($name) {
        $this->name = $name;
        $this->properties = array();
     }
 
+    /**
+     * Constructor (PHP4 style, kept for compatibility reasons)
+     * @param string $name
+     */
+    function Disposition($name) {
+       self::__construct($name);
+    }
+
     /**
      * Returns value of content disposition property
      * @param string $par content disposition property name