use strict;
use base 'Catalyst::Engine::CGI';
-use Catalyst::Utils;
+use HTTP::Request;
use HTTP::Response;
use HTTP::Status;
use NEXT;
sub run {
my ( $self, $class, $request ) = @_;
- $request = Catalyst::Utils::request($request);
+ # Construct request
+ unless ( ref $request ) {
+ if ( $request =~ m/http/i ) {
+ $request = URI->new($request)->canonical;
+ }
+ else {
+ $request = URI->new( 'http://localhost' . $request )->canonical;
+ }
+ }
+ unless ( ref $request eq 'HTTP::Request' ) {
+ $request = HTTP::Request->new( 'GET', $request );
+ }
$request->header(
'Host' => sprintf( '%s:%d', $request->uri->host, $request->uri->port )
use FindBin;
use Template;
use Catalyst;
+use Catalyst::Utils;
use Catalyst::Exception;
my %cache;
$self->{name} = $name;
$self->{dir} = $name;
$self->{dir} =~ s/\:\:/-/g;
- $self->{appprefix} = lc $self->{dir};
- $self->{appprefix} =~ s/-/_/g;
+ $self->{appprefix} = Catalyst::Utils::appprefix($name);
$self->{startperl} = $Config{startperl};
$self->{scriptgen} = $Catalyst::CATALYST_SCRIPT_GEN || 4;
$self->{author} = $self->{author} = $ENV{'AUTHOR'}
=head1 LICENSE
-This library is free software . You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
=head1 LICENSE
-This library is free software . You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
Copyright 2004 Sebastian Riedel. All rights reserved.
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
__fastcgi__
Copyright 2004 Sebastian Riedel. All rights reserved.
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
__server__
Copyright 2004 Sebastian Riedel. All rights reserved.
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
__test__
Copyright 2004 Sebastian Riedel. All rights reserved.
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
__create__
Copyright 2004 Sebastian Riedel. All rights reserved.
-This library is free software. You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
__compclass__
=head1 LICENSE
-This library is free software . You can redistribute it and/or modify
-it under the same terms as perl itself.
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
=cut
=over 4
+=item appprefix($class)
+
+Returns the application prefix for the class
+
+=cut
+
+sub appprefix {
+ my $class = shift;
+ $class =~ s/\:\:/_/g;
+ $class = lc($class);
+ return $class;
+}
+
=item attrs($coderef)
Returns attributes for coderef in a arrayref
return $actions;
}
-=item request($string);
-
-Returns an C<HTTP::Request> from a string.
-
-=cut
-
-sub request {
- my $request = shift;
-
- unless ( ref $request ) {
-
- if ( $request =~ m/http/i ) {
- $request = URI->new($request)->canonical;
- }
- else {
- $request = URI->new( 'http://localhost' . $request )->canonical;
- }
- }
-
- unless ( ref $request eq 'HTTP::Request' ) {
- $request = HTTP::Request->new( 'GET', $request );
- }
-
- return $request;
-}
-
=back
=head1 AUTHOR