X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FCookbook.pod;h=1e0832b5589b2d4b8a435307bd25a14634eec9d1;hp=4db76b0a12dfd726660e73e53ca5636d561bf18e;hb=76776098d4731f120ecb88210b29a4496063e097;hpb=31e9c5ef62da7e7aab68a5dc4b4650e3e2ff307e diff --git a/lib/Catalyst/Manual/Cookbook.pod b/lib/Catalyst/Manual/Cookbook.pod index 4db76b0..1e0832b 100644 --- a/lib/Catalyst/Manual/Cookbook.pod +++ b/lib/Catalyst/Manual/Cookbook.pod @@ -133,7 +133,7 @@ reference. sub add_item : Local { my ( $self, $c ) = @_; - my $item_id = $c->req->param("item"); + my $item_id = $c->req->params->{item}; push @{ $c->session->{items} }, $item_id; @@ -387,8 +387,8 @@ the user is a member. sub login : Local { my ($self, $c) = @_; - if ( my $user = $c->req->param("user") - and my $password = $c->req->param("password") ) + if ( my $user = $c->req->params->{user} + and my $password = $c->req->param->{password} ) { if ( $c->authenticate( username => $user, password => $password ) ) { $c->res->body( "hello " . $c->user->name ); @@ -454,7 +454,7 @@ pretty nasti!). For example: sub feed_moose : Local { my ( $self, $c ) = @_; - $c->model( "Moose" )->eat( $c->req->param("food") ); + $c->model( "Moose" )->eat( $c->req->params->{food} ); } With this action, anyone can just come into the moose cage and feed @@ -476,7 +476,7 @@ And now our action should look like this: my ( $self, $c ) = @_; if ( $c->check_roles( "moose_feeder" ) ) { - $c->model( "Moose" )->eat( $c->req->param("food") ); + $c->model( "Moose" )->eat( $c->req->params->{food} ); } else { $c->stash->{error} = "unauthorized"; } @@ -1521,15 +1521,15 @@ including web server engines and tips to improve application efficiency. =head2 mod_perl Deployment -mod_perl is the best solution for many applications, but we'll list some pros -and cons so you can decide for yourself. The other production deployment -option is FastCGI, for which see below. +mod_perl is not the best solution for many applications, but we'll list some +pros and cons so you can decide for yourself. The other (recommended) +deployment option is FastCGI, for which see below. =head3 Pros =head4 Speed -mod_perl is very fast and your app will benefit from being loaded in memory +mod_perl is fast and your app will be loaded in memory within each Apache process. =head4 Shared memory for multiple apps @@ -1560,6 +1560,14 @@ C page to report that your app is down for maintenance. It is not possible to run two different versions of the same application in the same Apache instance because the namespaces will collide. +=head4 Cannot run different versions of libraries. + +If you have two differnet applications which run on the same machine, +which need two different versions of a library then the only way to do +this is to have per-vhost perl interpreters (with different library paths). +This is entirely possible, but nullifies all the memory sharing benefits that +you get from having multiple applications sharing the same interpreter. + =head4 Setup Now that we have that out of the way, let's talk about setting up mod_perl