X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=eee6a002d5160fe724459a74da59c21db6ceb875;hb=3e5e24e72e331f9e3c5e8754d74f52ac55de8642;hp=664f0d2aa9f727f60c0396e7ba54d71b1cfac1e9;hpb=fae374846bd8612908cd1c240284feb14d00d3e1;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 664f0d2..eee6a00 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -2,6 +2,7 @@ package Catalyst; use Moose; extends 'Catalyst::Component'; +use Moose::Util qw/find_meta/; use bytes; use Scope::Upper (); use Catalyst::Exception; @@ -74,7 +75,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.80001'; +our $VERSION = '5.80002'; { my $dev_version = $VERSION =~ /_\d{2}$/; @@ -1054,10 +1055,11 @@ EOF } # 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 @@ -2161,6 +2163,14 @@ sub setup_components { =cut +sub _controller_init_base_classes { + my ($class, $component) = @_; + foreach my $class ( reverse @{ mro::get_linear_isa($component) } ) { + Moose->init_meta( for_class => $class ) + unless find_meta($class); + } +} + sub setup_component { my( $class, $component ) = @_; @@ -2168,6 +2178,14 @@ sub setup_component { return $component; } + # FIXME - Ugly, ugly hack to ensure the we force initialize non-moose base classes + # nearest to Catalyst::Controller first, no matter what order stuff happens + # to be loaded. There are TODO tests in Moose for this, see + # f2391d17574eff81d911b97be15ea51080500003 + if ($component->isa('Catalyst::Controller')) { + $class->_controller_init_base_classes($component); + } + my $suffix = Catalyst::Utils::class2classsuffix( $component ); my $config = $class->config->{ $suffix } || {};