Explorar o código

Add PHP5-style constructor

pdontthink %!s(int64=8) %!d(string=hai) anos
pai
achega
49aecd2ee8
Modificáronse 1 ficheiros con 11 adicións e 1 borrados
  1. 11 1
      functions/db_prefs.php

+ 11 - 1
functions/db_prefs.php

@@ -208,10 +208,11 @@ class dbPrefs {
 
 
     /**
+     * Constructor (PHP5 style, required in some future version of PHP)
      * initialize the default preferences array.
      *
      */
-    function dbPrefs() {
+    function __construct() {
         // Try and read the default preferences file.
         $default_pref = SM_PATH . 'config/default_pref';
         if (@file_exists($default_pref)) {
@@ -228,6 +229,15 @@ class dbPrefs {
         }
     }
 
+    /**
+     * Constructor (PHP4 style, kept for compatibility reasons)
+     * initialize the default preferences array.
+     *
+     */
+    function dbPrefs() {
+       self::__construct();
+    }
+
     /**
      * initialize DB connection object
      *