浏览代码

Add PHP5-style constructor

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

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

@@ -23,10 +23,10 @@
  */
 class Language {
     /**
-     * Class constructor
+     * Constructor (PHP5 style, required in some future version of PHP)
      * @param mixed $name
      */
-    function Language($name) {
+    function __construct($name) {
         /** @var mixed */
         $this->name = $name;
         /**
@@ -35,4 +35,12 @@ class Language {
          */
         $this->properties = array();
     }
+
+    /**
+     * Constructor (PHP4 style, kept for compatibility reasons)
+     * @param string $name
+     */
+    function Language($name) {
+       self::__construct($name);
+    }
 }