package Catalyst;
use Moose;
-extends 'Catalyst::Component';
+extends 'Catalyst::Component', 'Class::Accessor::Fast';
+use Moose::Util qw/find_meta/;
use bytes;
use Scope::Upper ();
use Catalyst::Exception;
# Remember to update this in Catalyst::Runtime as well!
-our $VERSION = '5.8000_07';
+our $VERSION = '5.80002';
{
my $dev_version = $VERSION =~ /_\d{2}$/;
}
# 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
# applying modifiers).
Scope::Upper::reap(sub {
my $meta = Class::MOP::get_metaclass_by_name($class);
- $meta->make_immutable unless $meta->is_immutable;
+ $meta->make_immutable(replace_constructor => 1) unless $meta->is_immutable;
}, Scope::Upper::SCOPE(1));
$class->setup_finalize;
push( @{ $c->stack }, $code );
+ no warnings 'recursion';
eval { $c->state( $code->execute( $class, $c, @{ $c->req->args } ) || 0 ) };
$c->_stats_finish_execute( $stats_info ) if $c->use_stats and $stats_info;
=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 ) = @_;
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 } || {};