X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=537cae1bff92d8a73447444d5835e18729af0f8f;hp=52b77876f8f65b143d840aaa77e6198b124a6b20;hb=e260802a2794d499f6faf2619dbbf943541829ab;hpb=2f5cb0703a06e037f2521ba220242a937d0e35b9 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 52b7787..537cae1 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -75,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}$/; @@ -527,7 +527,7 @@ sub _comp_search_prefixes { if( @result ) { # Disgusting hack to work out correct method name my $warn_for = lc $prefixes[0]; - my $msg = "Used regexp fallback for \$c->{$warn_for}('${name}'), which found '" . + my $msg = "Used regexp fallback for \$c->${warn_for}('${name}'), which found '" . (join '", "', @result) . "'. Relying on regexp fallback behavior for " . "component resolution is unreliable and unsafe."; my $short = $result[0]; @@ -1055,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 @@ -1098,7 +1099,7 @@ EOF # 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; @@ -2397,14 +2398,19 @@ sub setup_log { $levels ||= ''; $levels =~ s/^\s+//; $levels =~ s/\s+$//; - my %levels = map { $_ => 1 } split /\s*,\s*/, $levels || ''; - + my %levels = map { $_ => 1 } split /\s*,\s*/, $levels; + + my $env_debug = Catalyst::Utils::env_value( $class, 'DEBUG' ); + if ( defined $env_debug ) { + $levels{debug} = 1 if $env_debug; # Ugly! + delete($levels{debug}) unless $env_debug; + } + unless ( $class->log ) { $class->log( Catalyst::Log->new(keys %levels) ); } - my $env_debug = Catalyst::Utils::env_value( $class, 'DEBUG' ); - if ( defined($env_debug) or $levels{debug} ) { + if ( $levels{debug} ) { Class::MOP::get_metaclass_by_name($class)->add_method('debug' => sub { 1 }); $class->log->debug('Debug messages enabled'); }