- Made Catalyst::Action and ActionContainer default rather than hardcoded
Matt S Trout [Sat, 5 Nov 2005 19:07:14 +0000 (19:07 +0000)]
lib/Catalyst/Base.pm
lib/Catalyst/Dispatcher.pm

index 6a97984..35787a4 100644 (file)
@@ -8,9 +8,10 @@ use Catalyst::Utils;
 use Class::Inspector;
 use NEXT;
 
-__PACKAGE__->mk_classdata($_) for qw/_dispatch_steps/;
+__PACKAGE__->mk_classdata($_) for qw/_dispatch_steps _action_class/;
 
 __PACKAGE__->_dispatch_steps( [qw/_BEGIN _AUTO _ACTION/] );
+__PACKAGE__->_action_class('Catalyst::Action');
 
 sub _DISPATCH : Private {
     my ( $self, $c ) = @_;
@@ -92,7 +93,7 @@ sub register_actions {
             next;
         }
         my $reverse = $namespace ? "$namespace/$method" : $method;
-        my $action = Catalyst::Action->new(
+        my $action = $self->_action_class->new(
             {
                 name       => $method,
                 code       => $code,
index 686cf01..a8fee01 100644 (file)
@@ -15,7 +15,8 @@ use Tree::Simple::Visitor::FindByPath;
 # Stringify to class
 use overload '""' => sub { return ref shift }, fallback => 1;
 
-__PACKAGE__->mk_accessors(qw/tree dispatch_types registered_dispatch_types/);
+__PACKAGE__->mk_accessors(qw/tree dispatch_types registered_dispatch_types
+  method_action_class action_container_class/);
 
 # Preload these action types
 our @PRELOAD = qw/Path Regex/;
@@ -126,7 +127,7 @@ qq/Couldn't forward to command "$command". Invalid action or component./;
         my $method = shift || 'process';
 
         if ( my $code = $class->can($method) ) {
-            my $action = Catalyst::Action->new(
+            my $action = $self->method_action_class->new(
                 {
                     name      => $method,
                     code      => $code,
@@ -326,6 +327,8 @@ sub setup_actions {
 
     $self->dispatch_types( [] );
     $self->registered_dispatch_types( {} );
+    $self->method_action_class( 'Catalyst::Action' );
+    $self->action_container_class( 'Catalyst::ActionContainer' );
 
     # Preload action types
     for my $type (@PRELOAD) {