From: Andrew Ford Date: Mon, 21 Mar 2005 19:37:57 +0000 (+0000) Subject: minor doc changes X-Git-Tag: 5.7099_04~1747 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=b22c66686d892bba76a150f727561f8778f3ea72 minor doc changes --- diff --git a/lib/Catalyst/Log.pm b/lib/Catalyst/Log.pm index d7776f3..af779be 100644 --- a/lib/Catalyst/Log.pm +++ b/lib/Catalyst/Log.pm @@ -18,43 +18,45 @@ See L. Simple logging functionality for Catalyst. -=head2 METHODS +=head1 METHODS -=head3 debug +=over 4 -Log debug informations. +=item $c->debug($msg) + +Logs a debugging message. =cut sub debug { _format( 'debug', $_[1] ) } -=head3 dump +=item $c->dump($ref) -Dump stuff. +Logs a formatted dump of a variable passed by reference (uses C). =cut sub dump { _format( 'dump', Dumper( $_[1] ) ) } -=head3 error +=item $c->error($msg) -Log error informations. +Logs an error message. =cut sub error { _format( 'error', $_[1] ) } -=head3 info +=item $c->info($msg) -Log informations. +Logs an informational message. =cut sub info { _format( 'info', $_[1] ) } -=head3 warn +=item $c->warn($msg) -Log warnings. +Logs a warning message. =cut @@ -64,6 +66,8 @@ sub _format { print STDERR '[' . localtime(time) . "] [catalyst] [$_[0]] $_[1]\n"; } +=back + =head1 SEE ALSO L. diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index f06e27e..1276fc5 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -17,87 +17,114 @@ Catalyst::Request - Catalyst Request Class =head1 SYNOPSIS -See L. + + $req = $c->request; + $req->action; + $req->address; + $req->args; + $req->arguments; + $req->base; + $req->cookies; + $req->headers; + $req->hostname; + $req->match; + $req->method; + $req->parameters; + $req->params; + $req->path; + $req->snippets; + $req->uploads; + +See also L. =head1 DESCRIPTION -The Catalyst Request. +This is the Catalyst Request class, which provides a set of accessors to the +request data. The request object is prepared by the specialized Catalyst +Engine module thus hiding the details of the particular engine implementation. + + +=head1 METHODS -=head2 METHODS +=over 4 -=head3 action +=item $req->action Contains the action. print $c->request->action; -=head3 address +=item $req->address Contains the remote address. print $c->request->address -=head3 arguments (args) +=item $req->arguments -Returns an arrayref containing the arguments. +=item $req->args + +Returns a reference to an array containing the arguments. print $c->request->arguments->[0]; -=head3 base +=item $req->base Contains the uri base. -=head3 cookies +=item $req->cookies -Returns a hashref containing the cookies. +Returns a reference to a hash containing the cookies. print $c->request->cookies->{mycookie}->value; -=head3 headers +=item $req->headers -Returns a L object containing the headers. +Returns an L object containing the headers. print $c->request->headers->header('X-Catalyst'); -=head3 hostname +=item $req->hostname Contains the remote hostname. print $c->request->hostname -=head3 match +=item $req->match Contains the match. print $c->request->match; -=head3 parameters (params) +=item $req->parameters + +=item $req->params -Returns a hashref containing the parameters. +Returns a reference to a hash containing the parameters. print $c->request->parameters->{foo}; -=head3 path +=item $req->path Contains the path. print $c->request->path; -=head3 method +=item $req->method -Contains the request method. +Contains the request method (C, C, C, etc). print $c->request->method -=head3 snippets +=item $req->snippets -Returns an arrayref containing regex snippets. +Returns a reference to an array containing regex snippets. my @snippets = @{ $c->request->snippets }; -=head3 uploads +=item $req->uploads -Returns a hashref containing the uploads. +Returns a reference to a hash containing the uploads. my $filename = $c->req->parameters->{foo}; print $c->request->uploads->{$filename}->{type}; @@ -105,6 +132,8 @@ Returns a hashref containing the uploads. my $fh = $c->request->uploads->{$filename}->{fh}; my $content = do { local $/; <$fh> }; +=back + =head1 AUTHOR Sebastian Riedel, C diff --git a/lib/Catalyst/Response.pm b/lib/Catalyst/Response.pm index e29380d..d22dc3c 100644 --- a/lib/Catalyst/Response.pm +++ b/lib/Catalyst/Response.pm @@ -11,44 +11,56 @@ Catalyst::Response - Catalyst Response Class =head1 SYNOPSIS -See L. + $resp = $c->response; + $resp->cookies; + $resp->headers; + $resp->output; + $resp->redirect; + $resp->status; + +See also L. =head1 DESCRIPTION -The Catalyst Response. +This is the Catalyst Response class, which provides a set of accessors to +response data. + +=head1 METHODS -=head2 METHODS +=over 4 -=head3 cookies +=item $resp->cookies -Returns a hashref containing the cookies. +Returns a reference to a hash containing the cookies. $c->response->cookies->{foo} = { value => '123' }; -=head3 headers +=item $resp->headers Returns a L object containing the headers. $c->response->headers->header( 'X-Catalyst' => $Catalyst::VERSION ); -=head3 output +=item $resp->output($text) Contains the final output. $c->response->output('Catalyst rockz!'); -=head3 redirect +=item $resp->redirect($url) Contains a location to redirect to. $c->response->redirect('http://slashdot.org'); -=head3 status +=item status Contains the HTTP status. $c->response->status(404); +=back + =head1 AUTHOR Sebastian Riedel, C