From: Gavin Henry Date: Sat, 11 Feb 2006 00:00:47 +0000 (+0000) Subject: Some little changes to Plugins.pod before bed. Ran podchecker on all pods and cleaned... X-Git-Tag: 5.7099_04~706 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=b248fa4a4191cd3eaa13d72e6ec8e64dfef973e0 Some little changes to Plugins.pod before bed. Ran podchecker on all pods and cleaned up small errors. Also removed the 'Some background' section title in About.pod, as it didn't seem to add anything. podchecker also doesn't like emtpy sections. Feel free to put it back if it does add any value. Gavin. --- diff --git a/lib/Catalyst/Manual/About.pod b/lib/Catalyst/Manual/About.pod index e95ea95..60c8354 100644 --- a/lib/Catalyst/Manual/About.pod +++ b/lib/Catalyst/Manual/About.pod @@ -115,8 +115,6 @@ however, several systems built on top of Catalyst that can get you very close to a working app.) It is not designed for end users, but for working programmers. -=head2 Some background - =head2 Web programming: The Olden Days Perl has long been favored for web applications. There are a wide diff --git a/lib/Catalyst/Manual/Cookbook.pod b/lib/Catalyst/Manual/Cookbook.pod index a39e607..b6913a7 100644 --- a/lib/Catalyst/Manual/Cookbook.pod +++ b/lib/Catalyst/Manual/Cookbook.pod @@ -74,16 +74,16 @@ Catalyst Controller module 'upload' action: if ( $c->request->parameters->{form_submit} eq 'yes' ) { if ( my $upload = $c->request->upload('my_file') ) { - + my $filename = $upload->filename; my $target = "/tmp/upload/$filename"; - + unless ( $upload->link_to($target) || $upload->copy_to($target) ) { die( "Failed to copy '$filename' to '$target': $!" ); } } } - + $c->stash->{template} = 'file_upload.html'; } @@ -113,7 +113,7 @@ And in the controller: my $upload = $c->req->upload($field); my $filename = $upload->filename; my $target = "/tmp/upload/$filename"; - + unless ( $upload->link_to($target) || $upload->copy_to($target) ) { die( "Failed to copy '$filename' to '$target': $!" ); } @@ -343,7 +343,7 @@ authentication, authorization, and access check phases. For more information see the FastCGI documentation, the C module and L. - + =head2 Serving static content Serving static content in Catalyst can be somewhat tricky; this recipe @@ -410,7 +410,7 @@ Edit the file and add the following methods: # serve all files under /static as static files sub default : Path('/static') { my ( $self, $c ) = @_; - + # Optional, allow the browser to cache the content $c->res->headers->header( 'Cache-Control' => 'max-age=86400' ); @@ -420,7 +420,7 @@ Edit the file and add the following methods: # also handle requests for /favicon.ico sub favicon : Path('/favicon.ico') { my ( $self, $c ) = @_; - + $c->serve_static; } @@ -461,7 +461,7 @@ config for this application under mod_perl 1.x: use lib qw(/var/www/MyApp/lib); PerlModule MyApp - + ServerName myapp.example.com DocumentRoot /var/www/MyApp/root @@ -495,8 +495,8 @@ the Catalyst Request object: $c->req->args([qw/arg1 arg2 arg3/]); $c->forward('/wherever'); -(See L for more information on -passing arguments via C.) +(See the L Flow_Control section for more +information on passing arguments via C.) =head2 Configure your application @@ -594,21 +594,21 @@ C method; see L). sub end : Private { my ( $self, $c ) = @_; - + if ( scalar @{ $c->error } ) { $c->stash->{errors} = $c->error; $c->stash->{template} = 'errors.tt'; $c->forward('MyApp::View::TT'); $c->error(0); } - + return 1 if $c->response->status =~ /^3\d\d$/; return 1 if $c->response->body; - + unless ( $c->response->content_type ) { $c->response->content_type('text/html; charset=utf-8'); } - + $c->forward('MyApp::View::TT'); } @@ -678,7 +678,7 @@ in your Catalyst application, then make the following changes: $c->request->param('username'), $c->request->param('password'), ); - + # if login() returns 1, user is now logged in $c->response->redirect('/some/page'); } diff --git a/lib/Catalyst/Manual/Intro.pod b/lib/Catalyst/Manual/Intro.pod index 3a0e6c7..a1eff74 100644 --- a/lib/Catalyst/Manual/Intro.pod +++ b/lib/Catalyst/Manual/Intro.pod @@ -636,7 +636,7 @@ be reset. my $first_argument = $c->req->args[0]; # now = 'test1' # do something... } - + As you can see from these examples, you can just use the method name as long as you are referring to methods in the same controller. If you want to forward to a method in another controller, or the main application, @@ -808,7 +808,7 @@ stash to pass data to your templates. name => 'My Application', root => '/home/joeuser/myapp/root' ); - + __PACKAGE__->setup; sub end : Private { diff --git a/lib/Catalyst/Manual/Plugins.pod b/lib/Catalyst/Manual/Plugins.pod index 022422a..0e09de1 100644 --- a/lib/Catalyst/Manual/Plugins.pod +++ b/lib/Catalyst/Manual/Plugins.pod @@ -19,7 +19,7 @@ on the current status or preferred use of your chosen plugin/framework. =head2 Catalyst::Plugin::Account::AutoDiscovery -L provides Account Auto-Discovery +L provides Account Auto-Discovery for Catalyst. =head2 Catalyst::Plugin::Acme::Scramble @@ -64,7 +64,7 @@ Replaced by L L is a plugin which implements WSSE and Basic authentication for Catalyst applications using -L +L =head2 Catalyst::Plugin::Authentication::Credential::Flickr @@ -103,7 +103,7 @@ a look at L. =head2 Catalyst::Plugin::Authentication::Simple -Replaced by new L +Replaced by new L framework =head2 Catalyst::Plugin::Authentication::Store diff --git a/lib/Catalyst/Manual/Tutorial.pod b/lib/Catalyst/Manual/Tutorial.pod index 58f6f7e..6ad32ae 100644 --- a/lib/Catalyst/Manual/Tutorial.pod +++ b/lib/Catalyst/Manual/Tutorial.pod @@ -23,7 +23,7 @@ Catalyst includes a helper script, C, that will set up a skeleton application for you: $ catalyst MyApp - + created "MyApp" created "MyApp/script" created "MyApp/lib" @@ -87,7 +87,7 @@ Catalyst provides: +--------------------------------------+---------------------------------------+ | /default | MyApp | '--------------------------------------+---------------------------------------' - + [...] [catalyst] [info] MyApp powered by Catalyst 5.5 You can connect to your server at http://localhost:3000 @@ -104,7 +104,7 @@ and hit return twice): Connected to localhost. Escape character is '^]'. GET / HTTP/1.0 - + HTTP/1.0 200 OK Date: Mon, 07 Nov 2005 14:57:39 GMT Content-Length: 5525 @@ -188,7 +188,7 @@ explain more about those later. =head2 Debugging The simplest way to debug your Catalyst application is to run it using -the built-in mini-server as described in L. +the built-in mini-server as described in L. If you want to output any debugging information to the console, then call C<< $context->log->debug() >>, passing it a string to output. For @@ -330,7 +330,7 @@ This a private action which will not be matched to a path like our done. Only one end action will be called, if there is one in a controller, it will be prefered over one in the application module, and so on. - + Since we're writing a simple application, just add an end action like this to F: diff --git a/lib/Catalyst/Manual/WritingPlugins.pod b/lib/Catalyst/Manual/WritingPlugins.pod index 20e3fdc..5af1713 100644 --- a/lib/Catalyst/Manual/WritingPlugins.pod +++ b/lib/Catalyst/Manual/WritingPlugins.pod @@ -108,7 +108,7 @@ the rest of the arguments to the next handler in row by calling it via $c->NEXT::handler-name( @_ ); if you already Ced it out of C<@_>. Remember to C C. - + =head2 Storage and Configuration Some Plugins use their accessor names as a storage point, e.g. @@ -131,16 +131,16 @@ Here's a simple example Plugin that shows how to overload C to add a unique ID to every request: package Catalyst::Plugin::RequestUUID; - + use warnings; use strict; - + use Catalyst::Request; use Data::UUID; use NEXT; our $VERSION = 0.01; - + { # create a uuid accessor package Catalyst::Request; __PACKAGE__->mk_accessors('uuid'); @@ -148,7 +148,7 @@ to add a unique ID to every request: sub prepare { my $class = shift; - + # Turns the engine-specific request into a Catalyst context . my $c = $class->NEXT::prepare( @_ );