[Jifty-commit] r943 - in jifty/trunk: lib lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Apr 27 01:07:09 EDT 2006


Author: jesse
Date: Thu Apr 27 01:07:08 2006
New Revision: 943

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty.pm
   jifty/trunk/lib/Jifty/DateTime.pm

Log:
 r11977 at hualien:  jesse | 2006-04-27 01:05:12 -0400
 * A more conservative Time::Local / $ENV{TZ} workaround


Modified: jifty/trunk/lib/Jifty.pm
==============================================================================
--- jifty/trunk/lib/Jifty.pm	(original)
+++ jifty/trunk/lib/Jifty.pm	Thu Apr 27 01:07:08 2006
@@ -3,7 +3,8 @@
 
 package Jifty;
 use encoding 'utf8';
-$ENV{'TZ'} = "GMT";
+# Work around the fact that Time::Local caches thing on first require
+BEGIN { local $ENV{'TZ'} = "GMT";  require Time::Local;}
 our $VERSION = '0.60321';
 
 =head1 NAME

Modified: jifty/trunk/lib/Jifty/DateTime.pm
==============================================================================
--- jifty/trunk/lib/Jifty/DateTime.pm	(original)
+++ jifty/trunk/lib/Jifty/DateTime.pm	Thu Apr 27 01:07:08 2006
@@ -56,8 +56,10 @@
 sub new_from_string {
   my $class  = shift;
   my $string = shift;
-
-  my $now = Date::Manip::UnixDate( $string, "%o" );
+  my $now;
+  { local $ENV{'TZ'} = "GMT"; 
+    $now = Date::Manip::UnixDate( $string, "%o" );
+  }
   return undef unless $now;
   my $self = $class->from_epoch( epoch => $now, time_zone => 'gmt' );
   $self->_get_current_user();


More information about the Jifty-commit mailing list