From 88048ecc2f3269f9d3732ce1c892be60351f6f48 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 22 Oct 2006 06:39:49 +0000 Subject: [PATCH] renamed datetime class to egw_datetime to support php5.2 --- ...ime.inc.php => class.egw_datetime.inc.php} | 26 +++++++++++++++---- phpgwapi/inc/common_functions.inc.php | 2 ++ 2 files changed, 23 insertions(+), 5 deletions(-) rename phpgwapi/inc/{class.datetime.inc.php => class.egw_datetime.inc.php} (98%) diff --git a/phpgwapi/inc/class.datetime.inc.php b/phpgwapi/inc/class.egw_datetime.inc.php similarity index 98% rename from phpgwapi/inc/class.datetime.inc.php rename to phpgwapi/inc/class.egw_datetime.inc.php index 681e453789..ef27c8a659 100755 --- a/phpgwapi/inc/class.datetime.inc.php +++ b/phpgwapi/inc/class.egw_datetime.inc.php @@ -37,11 +37,12 @@ unset($d2); unset($d3); - /*! - @class datetime - @abstract datetime class that contains common date/time functions + /** + * eGroupWare datetime class that contains common date/time functions + * + * renamed to egw_datetime to support php5.2 */ - class datetime + class egw_datetime { var $zone_offset_list = array( 'ACT' => '+9:30', @@ -565,7 +566,22 @@ var $users_localtime; var $cv_gmtdate; + /** + * Calling the constructor of the renamed class + * + * @return egw_datetime + */ function datetime() + { + return $this->egw_datetime(); + } + + /** + * Constructor of the renamed class + * + * @return egw_datetime + */ + function egw_datetime() { $this->tz_offset = 3600 * (int)@$GLOBALS['egw_info']['user']['preferences']['common']['tz_offset']; print_debug('datetime::datetime::gmtnow',$this->gmtnow,'api'); @@ -587,7 +603,7 @@ } $this->users_localtime = time() + $this->tz_offset; } - + function getntpoffset() { $error_occured = False; diff --git a/phpgwapi/inc/common_functions.inc.php b/phpgwapi/inc/common_functions.inc.php index af59fe09ee..b50c10149f 100755 --- a/phpgwapi/inc/common_functions.inc.php +++ b/phpgwapi/inc/common_functions.inc.php @@ -662,6 +662,8 @@ function &CreateObject($class) { list($appname,$classname) = explode('.',$class); + + if ($classname == 'datetime') $classname = 'egw_datetime'; // php5.2 fix include_once(EGW_INCLUDE_ROOT.'/'.$appname.'/inc/class.'.$classname.'.inc.php');