[Catalyst-commits] r8065 - trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Tue Jul 1 04:53:31 BST 2008


Author: caelum
Date: 2008-07-01 04:53:30 +0100 (Tue, 01 Jul 2008)
New Revision: 8065

Modified:
   trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/CGIBin.pm
Log:
Minor change

Modified: trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/CGIBin.pm
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/CGIBin.pm	2008-07-01 02:16:38 UTC (rev 8064)
+++ trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/CGIBin.pm	2008-07-01 03:53:30 UTC (rev 8065)
@@ -54,6 +54,8 @@
 
 Dispatches to executable CGI files in root/cgi-bin for /cgi-bin/ paths.
 
+CGI paths are converted into action names using cgi_action (below.)
+
 A path such as C<root/cgi-bin/hlagh/bar.cgi> will get the private path
 C<foo/CGI_hlagh_bar_cgi>, for controller Foo, with the C</>s converted to C<_>s
 and prepended with C<CGI_>, as well as all non-word characters converted to
@@ -66,18 +68,18 @@
 =cut
 
 sub register_actions {
-    my ($self, $c) = @_;
+    my ($self, $app) = @_;
 
     my $cwd = getcwd;
 
-    my $cgi_bin = $c->path_to('root', 'cgi-bin');
+    my $cgi_bin = $app->path_to('root', 'cgi-bin');
 
     chdir $cgi_bin ||
         Catalyst::Exception->throw(
             message => 'You have no root/cgi-bin directory'
         );
 
-    my $namespace = $self->action_namespace($c);
+    my $namespace = $self->action_namespace($app);
 
     my $class = ref $self || $self;
 
@@ -94,8 +96,8 @@
             undef $@;
         }
 
-        $c->log->info("Registering root/cgi_bin/$file as a $type CGI.")
-            if $c->debug;
+        $app->log->info("Registering root/cgi_bin/$file as a $type CGI.")
+            if $app->debug;
 
         my $action_name = $self->cgi_action($file);
         my $path        = join '/' => splitdir($file);
@@ -116,12 +118,12 @@
             attributes => $attrs
         );
 
-        $c->dispatcher->register($c, $action);
+        $app->dispatcher->register($app, $action);
     }
 
     chdir $cwd;
 
-    $self->next::method($c, @_);
+    $self->next::method($app, @_);
 }
 
 =head1 METHODS




More information about the Catalyst-commits mailing list