Browse Source

Merge branch 'trunk' into master

Trunk forgot to change gettext_reader's constructor function.
Andy 3 years ago
parent
commit
40a3ce5b3a

+ 11 - 1
class/error.class.php

@@ -34,7 +34,7 @@ if (ini_get('docref_root')=='') ini_set('docref_root','http://www.php.net/');
 class ErrorHandler {
 
     /**
-     * Constructor
+     * Constructor (PHP5 style, required in some future version of PHP)
      * @param  object $oTemplate Template object
      * @param  string $sTemplateFile Template containing the error template
      * @since 1.5.1
@@ -49,6 +49,16 @@ class ErrorHandler {
         $this->Template->assign('delayed_errors', $this->delayed_errors);
     }
 
+    /**
+     * Constructor (PHP4 style, kept for compatibility reasons)
+     * @param  object $oTemplate Template object
+     * @param  string $sTemplateFile Template containing the error template
+     * @since 1.5.1
+     */
+    function ErrorHandler(&$oTemplate, $sTemplateFile) {
+        self::__construct($oTemplate, $sTemplateFile);
+    }
+
     /**
      * Sets the error template
      * @since 1.5.1

+ 14 - 1
class/l10n/gettext.class.php

@@ -68,11 +68,13 @@ class gettext_reader {
     }
 
     /**
+     * Constructor (PHP5 style, required in some future version of PHP)
      * constructor that requires StreamReader object
      * @param object $Reader
      * @return boolean false, if some error with stream
+TODO: Constructors should not return anything.
      */
-    function gettext_reader($Reader) {
+    function __construct($Reader) {
         $MAGIC1 = (int) ((222) | (18<<8) | (4<<16) | (149<<24));
         $MAGIC2 = (int) ((149) | (4<<8) | (18<<16) | (222<<24));
 
@@ -106,6 +108,17 @@ class gettext_reader {
         $this->_HASHED = array();
     }
 
+    /**
+     * Constructor (PHP4 style, kept for compatibility reasons)
+     * constructor that requires StreamReader object
+     * @param object $Reader
+     * @return boolean false, if some error with stream
+TODO: Constructors should not return anything.
+     */
+    function gettext_reader($Reader) {
+        return self::__construct($Reader);
+    }
+
     /**
      * @param boolean $translations do translation have to be loaded
      */

+ 14 - 1
class/l10n/streams.class.php

@@ -58,11 +58,13 @@ class FileReader {
     var $error=0;
 
     /**
+     * Constructor (PHP5 style, required in some future version of PHP)
      * reads translation file and fills translation input object properties
      * @param string $filename path to file
      * @return boolean false there is a problem with $filename
+TODO: Constructors should not return anything.
      */
-    function FileReader($filename) {
+    function __construct($filename) {
         // disable stat warnings for unreadable directories
         if (@file_exists($filename)) {
 
@@ -79,6 +81,17 @@ class FileReader {
         }
     }
 
+    /**
+     * Constructor (PHP4 style, kept for compatibility reasons)
+     * reads translation file and fills translation input object properties
+     * @param string $filename path to file
+     * @return boolean false there is a problem with $filename
+TODO: Constructors should not return anything.
+     */
+    function FileReader($filename) {
+        return self::__construct($filename);
+     }
+
     /**
      * reads data from current position
      * @param integer $bytes number of bytes to read

+ 13 - 1
class/template/PHP_Template.class.php

@@ -40,7 +40,7 @@ class PHP_Template extends Template
 
 
     /**
-      * Constructor
+      * Constructor (PHP5 style, required in some future version of PHP)
       *
       * Please do not call directly.  Use Template::construct_template().
       *
@@ -58,6 +58,18 @@ class PHP_Template extends Template
 
     }
 
+    /**
+      * Constructor (PHP4 style, kept for compatibility reasons)
+      *
+      * Please do not call directly.  Use Template::construct_template().
+      *
+      * @param string $template_id the template ID
+      *
+      */
+    function PHP_Template($template_id) {
+        self::__construct($template_id);
+    }
+
     /**
       * Assigns values to template variables
       *

+ 13 - 1
class/template/Template.class.php

@@ -127,7 +127,7 @@ class Template
     var $other_template_engine_objects = array();
 
     /**
-      * Constructor
+      * Constructor (PHP5 style, required in some future version of PHP)
       *
       * Please do not call directly.  Use Template::construct_template().
       *
@@ -145,6 +145,18 @@ class Template
 
     }
 
+    /**
+      * Constructor (PHP4 style, kept for compatibility reasons)
+      *
+      * Please do not call directly.  Use Template::construct_template().
+      *
+      * @param string $template_set_id the template ID
+      *
+      */
+    function Template($template_set_id) {
+        self::__construct($template_set_id);
+    }
+
     /**
       * Construct Template
       *