From: <pdo...@us...> - 2021-09-09 06:25:15
|
Revision: 14928 http://sourceforge.net/p/squirrelmail/code/14928 Author: pdontthink Date: 2021-09-09 06:25:12 +0000 (Thu, 09 Sep 2021) Log Message: ----------- Class constructor updates that were missed previously Modified Paths: -------------- trunk/squirrelmail/class/error.class.php trunk/squirrelmail/class/l10n/gettext.class.php trunk/squirrelmail/class/l10n/streams.class.php trunk/squirrelmail/class/template/PHP_Template.class.php trunk/squirrelmail/class/template/Template.class.php Modified: trunk/squirrelmail/class/error.class.php =================================================================== --- trunk/squirrelmail/class/error.class.php 2021-08-25 03:38:28 UTC (rev 14927) +++ trunk/squirrelmail/class/error.class.php 2021-09-09 06:25:12 UTC (rev 14928) @@ -34,12 +34,12 @@ 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 */ - function ErrorHandler(&$oTemplate, $sTemplateFile) { + function __construct(&$oTemplate, $sTemplateFile) { # echo 'init error handler...'; $this->TemplateName = $sTemplateFile; $this->Template =& $oTemplate; @@ -50,6 +50,16 @@ } /** + * 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 */ Modified: trunk/squirrelmail/class/l10n/gettext.class.php =================================================================== --- trunk/squirrelmail/class/l10n/gettext.class.php 2021-08-25 03:38:28 UTC (rev 14927) +++ trunk/squirrelmail/class/l10n/gettext.class.php 2021-09-09 06:25:12 UTC (rev 14928) @@ -68,9 +68,11 @@ } /** + * 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) { $MAGIC1 = (int) ((222) | (18<<8) | (4<<16) | (149<<24)); @@ -107,6 +109,17 @@ } /** + * 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 */ function load_tables($translations=false) { Modified: trunk/squirrelmail/class/l10n/streams.class.php =================================================================== --- trunk/squirrelmail/class/l10n/streams.class.php 2021-08-25 03:38:28 UTC (rev 14927) +++ trunk/squirrelmail/class/l10n/streams.class.php 2021-09-09 06:25:12 UTC (rev 14928) @@ -58,11 +58,13 @@ 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)) { @@ -80,6 +82,17 @@ } /** + * 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 * @return string read data Modified: trunk/squirrelmail/class/template/PHP_Template.class.php =================================================================== --- trunk/squirrelmail/class/template/PHP_Template.class.php 2021-08-25 03:38:28 UTC (rev 14927) +++ trunk/squirrelmail/class/template/PHP_Template.class.php 2021-09-09 06:25:12 UTC (rev 14928) @@ -40,7 +40,7 @@ /** - * Constructor + * Constructor (PHP5 style, required in some future version of PHP) * * Please do not call directly. Use Template::construct_template(). * @@ -47,7 +47,7 @@ * @param string $template_id the template ID * */ - function PHP_Template($template_id) { + function __construct($template_id) { //FIXME: find a way to test that this is ONLY ever called // from parent's construct_template() method (I doubt it // is worth the trouble to parse the current stack trace) @@ -59,6 +59,18 @@ } /** + * 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 * * @param array|string $tpl_var the template variable name(s) Modified: trunk/squirrelmail/class/template/Template.class.php =================================================================== --- trunk/squirrelmail/class/template/Template.class.php 2021-08-25 03:38:28 UTC (rev 14927) +++ trunk/squirrelmail/class/template/Template.class.php 2021-09-09 06:25:12 UTC (rev 14928) @@ -127,7 +127,7 @@ 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(). * @@ -134,7 +134,7 @@ * @param string $template_set_id the template ID * */ - function Template($template_set_id) { + function __construct($template_set_id) { //FIXME: find a way to test that this is ONLY ever called // from the construct_template() method (I doubt it // is worth the trouble to parse the current stack trace) @@ -146,6 +146,18 @@ } /** + * 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 * * This method should always be called instead of trying This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |