call to $class->import in Catalyst::Test
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index f0638c1..5b79ba6 100644 (file)
@@ -5,9 +5,9 @@ use base 'Class::Data::Inheritable';
 use UNIVERSAL::require;
 use Catalyst::Log;
 
-__PACKAGE__->mk_classdata($_) for qw/_config log/;
+__PACKAGE__->mk_classdata($_) for qw/_config engine log/;
 
-our $VERSION = '4.33';
+our $VERSION = '4.34';
 our @ISA;
 
 =head1 NAME
@@ -141,15 +141,9 @@ sub import {
     my ( $self, @options ) = @_;
     my $caller = caller(0);
 
-    # Class
-    {
+    unless ( $caller->isa($self) ) {
         no strict 'refs';
-        *{"$caller\::handler"} =
-          sub { Catalyst::Engine::handler( $caller, @_ ) };
-
-        unless ( $caller->isa($self) ) {
-            push @{"$caller\::ISA"}, $self;
-        }
+        push @{"$caller\::ISA"}, $self;
     }
 
     unless ( $caller->log ) {
@@ -194,9 +188,14 @@ sub import {
         no strict 'refs';
         push @{"$caller\::ISA"}, $engine;
     }
+    $caller->engine($engine);
     $caller->log->debug(qq/Loaded engine "$engine"/) if $caller->debug;
 }
 
+=item $c->engine
+
+Contains the engine class.
+
 =item $c->log
 
 Contains the logging object.  Unless it is already set Catalyst sets this up with a