Hastymail2

Hastymail2 is an Open Source IMAP webmail client written in PHP. Our focus is compliance, usability, security, and speed.

Hastymail 2

avatar
PHP Fatal error: Class 'DateTimeZone' not found in /usr/share/hastymail2/lib/utility_classes.php on line 1183

Testing the beta1 release on CentOS5 (php 5.1.6) fails with the following in my apache logs:

 PHP Fatal error:  Class 'DateTimeZone' not found in /usr/share/hastymail2/lib/utility_classes.php on line 1183

This occurs regardless of the setting of "site_default_timezone".

(BTW, I'm the guy who promised to contribute an RPM and this appears to be the only issue preventing me from providing you with something to review/test.) 

Reply /Quote
avatar
Fixed

Looks like this is a PHP 5.2 feature. 

Index: trunk/hastymail2/lib/utility_classes.php
===================================================================
--- trunk/hastymail2/lib/utility_classes.php    (revision 500)
+++ trunk/hastymail2/lib/utility_classes.php    (working copy)
@@ -1177,7 +1177,7 @@
         return $this->user_action->urlify($input);
     }
     function set_timezone() {
-        if ($this->phpversion >= 5) {
+        if ($this->phpversion >= 5.2) {
             $tz_set = false;
             if (isset($_SESSION['user_settings']['timezone'])) {
                 $tz_vals = DateTimeZone::listIdentifiers();
 

Reply /Quote
avatar
Maybe not...
Further research suggests that this was added in php 5.1, so I'm not sure why it doesn't work on CentOS 5...
Reply /Quote
avatar
More clarification...
OK, it looks like DateTimeZone is disabled by default in php 5.1, so apparently many distributions (including RHEL 5 and CentOS 5) include a php package that will not support it.  AFAICT, it is enabled by default in php 5.2, so I still suggest the above patch.
Reply /Quote
avatar
Re More clarification
Thanks for the info, I will have this in SVN shortly     
Reply /Quote


 SourceForge.net Logo