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

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Jun 8 17:33:30 EDT 2006


Author: jesse
Date: Thu Jun  8 17:33:29 2006
New Revision: 1215

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

Log:
 r12394 at pinglin:  jesse | 2006-06-08 17:32:39 -0400
  * 50% less lexwrap


Modified: jifty/trunk/lib/Jifty/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Handler.pm	(original)
+++ jifty/trunk/lib/Jifty/Handler.pm	Thu Jun  8 17:33:29 2006
@@ -27,6 +27,22 @@
 use base qw/Class::Accessor::Fast/;
 use Hook::LexWrap qw(wrap);
 use Module::Refresh ();
+
+BEGIN {
+    # Creating a new CGI object breaks FastCGI in all sorts of painful
+    # ways.  So wrap the call and preempt it if we already have one
+    use CGI ();
+    *CGI::__jifty_real_new = \&CGI::new;
+    
+    no warnings qw(redefine);
+    *CGI::new = sub {
+	return Jifty->handler->cgi if Jifty->handler->cgi;
+	CGI::__jifty_real_new(@_);	
+    }
+};
+
+
+
 __PACKAGE__->mk_accessors(qw(mason dispatcher static_handler cgi apache));
 
 =head2 new
@@ -41,13 +57,9 @@
     bless $self, $class;
 
     $self->create_cache_directories();
-
-    # Creating a new CGI object breaks FastCGI in all sorts of painful
-    # ways.  So wrap the call and preempt it if we already have one
-    use CGI;
-    wrap 'CGI::new', pre => sub {
-        $_[-1] = Jifty->handler->cgi if Jifty->handler->cgi;
-    };
+#    wrap 'CGI::new', pre => sub {
+#        $_[-1] = Jifty->handler->cgi if Jifty->handler->cgi;
+#    };
 
     $self->dispatcher(
         Jifty->config->framework('ApplicationClass') . "::Dispatcher" );


More information about the Jifty-commit mailing list