This file documents the revision history for Perl extension Catalyst.
+4.30 XXX XXX XX XX:00:00 2005
+ - added connection informations (Christian Hansen)
+
4.28 Sat Mar 19 22:00:00 2005
- fixed isa tree (Christian Hansen)
- added script/cgi-server.pl, so no more server restarting after
t/11stash.t
t/12default.t
t/13beginend.t
+t/14connection.t
__PACKAGE__->mk_classdata($_) for qw/_config log/;
-our $VERSION = '4.28';
+our $VERSION = '4.30';
our @ISA;
=head1 NAME
}
}
-
=item $c->benchmark($coderef)
Takes a coderef with arguments and returns elapsed time as float.
$c->prepare_path;
$c->prepare_cookies;
$c->prepare_headers;
- my $method = $c->req->method || '';
- my $path = $c->req->path || '';
- $c->log->debug(qq/"$method" request for "$path"/) if $c->debug;
+ $c->prepare_connection;
+ my $method = $c->req->method || '';
+ my $path = $c->req->path || '';
+ my $hostname = $c->req->hostname || '';
+ my $address = $c->req->address || '';
+ $c->log->debug(qq/"$method" request for "$path" from $hostname($address)/)
+ if $c->debug;
$c->prepare_action;
$c->prepare_parameters;
if ( $c->debug && @args );
}
+=item $c->prepare_connection;
+
+Prepare connection.
+
+=cut
+
+sub prepare_connection { }
+
=item $c->prepare_cookies;
Prepare cookies.
# mod_perl
if (MP2) {
require Apache2;
+ require Apache::Connection;
require Apache::RequestIO;
require Apache::RequestRec;
require Apache::SubRequest;
$c->original_request->print( $c->response->{output} );
}
+=item $c->prepare_connection
+
+=cut
+
+sub prepare_connection {
+ my $c = shift;
+ $c->req->hostname( $c->apache_request->connection->remote_host );
+ $c->req->address( $c->apache_request->connection->remote_ip );
+}
+
=item $c->prepare_cookies
=cut
print $c->response->output;
}
+=item $c->prepare_connection
+
+=cut
+
+sub prepare_connection {
+ my $c = shift;
+ $c->req->hostname( $c->cgi->remote_host );
+ $c->req->address( $c->cgi->remote_addr );
+}
+
=item $c->prepare_cookies
Sets up cookies.
use base 'Class::Accessor::Fast';
__PACKAGE__->mk_accessors(
- qw/action arguments base cookies headers match method parameters path
- snippets uploads/
+ qw/action address arguments base cookies headers hostname match method
+ parameters path snippets uploads/
);
*args = \&arguments;
print $c->request->action;
+=head3 address
+
+Contains the remote address.
+
+ print $c->request->address
+
=head3 arguments (args)
Returns an arrayref containing the arguments.
print $c->request->headers->header('X-Catalyst');
+=head3 hostname
+
+Contains the remote hostname.
+
+ print $c->request->hostname
+
=head3 match
Contains the match.