[Catalyst-commits] r9769 - in Catalyst-Runtime/5.80/trunk: . lib lib/Catalyst/Engine/HTTP/Restarter

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Tue Apr 21 01:40:47 GMT 2009


Author: t0m
Date: 2009-04-21 02:40:47 +0100 (Tue, 21 Apr 2009)
New Revision: 9769

Modified:
   Catalyst-Runtime/5.80/trunk/Changes
   Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm
Log:
Restartable app class on perl 5.10. More evil hackery..

Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes	2009-04-21 00:27:57 UTC (rev 9768)
+++ Catalyst-Runtime/5.80/trunk/Changes	2009-04-21 01:40:47 UTC (rev 9769)
@@ -1,5 +1,7 @@
 # This file documents the revision history for Perl extension Catalyst.
 
+        - Fix issues with restarting the application class due to C3 failures
+          on perl 5.10 (t0m)
         - Work around issues in Moose with initialization order of multiple
           levels of non-Moose classes inheriting from a Moose class (t0m)
           - Test for this

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm	2009-04-21 00:27:57 UTC (rev 9768)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm	2009-04-21 01:40:47 UTC (rev 9769)
@@ -145,10 +145,15 @@
                 my $is_immutable = $meta->can('is_immutable');
                 my $make_mutable = $meta->can('make_mutable');
                 $meta->$make_mutable() if $is_immutable && $make_mutable && $meta->$is_immutable();
+                eval { # Do not explode the watcher process if this fails.
+                    my $superclasses = $meta->can('superclasses');
+                    $meta->$superclasses('Moose::Object') if $superclasses;
+                };
             }
         });
     }
 
+    local $Catalyst::__AM_RESTARTING = 1; # Hack to avoid C3 fail
     delete $INC{$file}; # Remove from %INC so it will reload
     local $SIG{__WARN__} = sub { };
 

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm	2009-04-21 00:27:57 UTC (rev 9768)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm	2009-04-21 01:40:47 UTC (rev 9769)
@@ -1055,10 +1055,11 @@
     }
 
     # Call plugins setup, this is stupid and evil.
+    # Also screws C3 badly on 5.10, hack to avoid.
     {
         no warnings qw/redefine/;
         local *setup = sub { };
-        $class->setup;
+        $class->setup unless $Catalyst::__AM_RESTARTING;
     }
 
     # Initialize our data structure




More information about the Catalyst-commits mailing list