Jelajahi Sumber

Add PHP5-style constructor

pdontthink 8 tahun lalu
induk
melakukan
5b1a0f6a59
1 mengubah file dengan 11 tambahan dan 2 penghapusan
  1. 11 2
      functions/abook_local_file.php

+ 11 - 2
functions/abook_local_file.php

@@ -92,11 +92,11 @@ class abook_local_file extends addressbook_backend {
     /* ========================== Private ======================= */
 
     /**
-     * Constructor
+     * Constructor (PHP5 style, required in some future version of PHP)
      * @param array $param backend options
      * @return bool
      */
-    function abook_local_file($param) {
+    function __construct($param) {
         $this->sname = _("Personal Address Book");
         $this->umask = Umask();
 
@@ -139,6 +139,15 @@ class abook_local_file extends addressbook_backend {
         }
     }
 
+    /**
+     * Constructor (PHP4 style, kept for compatibility reasons)
+     * @param array $param backend options
+     * @return bool
+     */
+    function abook_local_file($param) {
+        return self::__construct($param);
+    }
+
     /**
      * Open the addressbook file and store the file pointer.
      * Use $file as the file to open, or the class' own