From: Kieren Diment Date: Wed, 9 Jul 2008 12:07:52 +0000 (+0000) Subject: rollback to use Catalyst qw/@plugins/ X-Git-Tag: v5.8005~271 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=commitdiff_plain;h=b411df01b40662f125aa854a7c25097bc53ad86a rollback to use Catalyst qw/@plugins/ --- diff --git a/lib/Catalyst/Manual.pm b/lib/Catalyst/Manual.pm index fddad58..431d26c 100644 --- a/lib/Catalyst/Manual.pm +++ b/lib/Catalyst/Manual.pm @@ -23,6 +23,6 @@ Tutorial. =cut -our $VERSION = '5.7012'; +our $VERSION = '5.7013'; 1; diff --git a/lib/Catalyst/Manual/Cookbook.pod b/lib/Catalyst/Manual/Cookbook.pod index 3aed940..c39e0a5 100644 --- a/lib/Catalyst/Manual/Cookbook.pod +++ b/lib/Catalyst/Manual/Cookbook.pod @@ -62,11 +62,10 @@ nifty statistics in your debug messages. =head2 Enable debug status in the environment Normally you enable the debugging info by adding the C<-Debug> flag to -your C statement (or C<__PACKAGE__->setup(qw/-Debug/) -). However, you can also enable it using environment variable, so you -can (for example) get debug info without modifying your application -scripts. Just set C or CMYAPPE_DEBUG> to a -true value. +your C statement . However, you can also enable it using +environment variable, so you can (for example) get debug info without +modifying your application scripts. Just set C or +CMYAPPE_DEBUG> to a true value. =head2 Sessions @@ -114,11 +113,11 @@ reference. =head3 EXAMPLE use parent qw/Catalyst/; - __PACKAGE__->setup( qw/ + use Catalyst qw/ Session Session::Store::FastMmap Session::State::Cookie - /;) + /; ## Write data into the session @@ -269,12 +268,11 @@ The L plugin is required when implementing roles: use parent qw/Catalyst/; - __PACKAGE__->setup (qw/ + use Catalyst qw/ Authentication Authentication::Credential::Password Authentication::Store::Htpasswd - Authorization::Roles - /); + Authorization::Roles/; Roles are implemented automatically when using L: @@ -404,10 +402,10 @@ the user is a member. =head3 EXAMPLE use parent qw/Catalyst/; - __PACKAGE__->setup( qw/Authentication - Authentication::Credential::Password - Authentication::Store::Htpasswd - Authorization::Roles/); + use Catalyst qw/Authentication + Authentication::Credential::Password + Authentication::Store::Htpasswd + Authorization::Roles/; __PACKAGE__->config->{authentication}{htpasswd} = "passwdfile"; @@ -501,10 +499,10 @@ The Authorization::Roles plugin let's us perform role based access control checks. Let's load it: use parent qw/Catalyst/; - __PACKAGE__->setup(qw/ - Authentication # yadda yadda - Authorization::Roles - /); + use Catalyst qw/ + Authentication # yadda yadda + Authorization::Roles + /; And now our action should look like this: @@ -718,7 +716,7 @@ later) and SOAP::Lite (for XMLRPCsh.pl). 3. Add the XMLRPC plugin to MyApp.pm - __PACKAGE__->setup( qw/-Debug Static::Simple XMLRPC/); + use Catalyst qw/-Debug Static::Simple XMLRPC/; 4. Add an API controller @@ -1912,7 +1910,7 @@ B is found and served. Using the plugin is as simple as setting your use line in MyApp.pm to include: - __PACKAGE__->setup( qw/Static::Simple/); + use Catalyst qw/Static::Simple/; and already files will be served. @@ -1997,7 +1995,7 @@ using L. In your main application class (MyApp.pm), load the plugin: - __PACKAGE__->setup( qw/-Debug FormValidator Static OtherPlugin/); + use Catalyst qw/-Debug FormValidator Static OtherPlugin/; You will also need to make sure your end method does I forward static content to the view, perhaps like this: @@ -2112,7 +2110,7 @@ rendered XHTML version of the source POD document. This is an ideal application for a cache because the source document changes infrequently but may be viewed many times. - __PACKAGE__->setup( qw/Cache::FileCache/); + use Catalyst qw/Cache::FileCache/; ... @@ -2160,7 +2158,7 @@ thing for every single user who views the page. We can add the PageCache plugin to speed things up. - __PACKAGE__->setup( qw/Cache::FileCache PageCache/); + use Catalyst qw/Cache::FileCache PageCache/; sub front_page : Path ('/') { my ( $self, $c ) = @_; diff --git a/lib/Catalyst/Manual/Intro.pod b/lib/Catalyst/Manual/Intro.pod index 61eeddf..36adc7c 100644 --- a/lib/Catalyst/Manual/Intro.pod +++ b/lib/Catalyst/Manual/Intro.pod @@ -574,9 +574,7 @@ configure your application, load plugins, and extend Catalyst. use strict; use parent qw/Catalyst/; - __PACKAGE__->setup(qw/-Debug ConfigLoader Static::Simple/); - # note you can still use use Catalyst qw/@plugins/ instead of the - # above two lines + use Catalyst qw/-Debug ConfigLoader Static::Simple/; MyApp->config( name => 'My Application', diff --git a/lib/Catalyst/Manual/Tutorial/Authentication.pod b/lib/Catalyst/Manual/Tutorial/Authentication.pod index f32e05b..8bae716 100644 --- a/lib/Catalyst/Manual/Tutorial/Authentication.pod +++ b/lib/Catalyst/Manual/Tutorial/Authentication.pod @@ -247,7 +247,7 @@ by Catalyst under C. Edit C and update it as follows (everything below C is new): - __PACKAGE__->setup(qw/ + use Catalyst qw/ -Debug ConfigLoader Static::Simple @@ -259,7 +259,7 @@ C is new): Session Session::Store::FastMmap Session::State::Cookie - /); + /; The C plugin supports Authentication while the C plugins are required to maintain state across multiple HTTP diff --git a/lib/Catalyst/Manual/Tutorial/Authorization.pod b/lib/Catalyst/Manual/Tutorial/Authorization.pod index 14d62b0..c617775 100644 --- a/lib/Catalyst/Manual/Tutorial/Authorization.pod +++ b/lib/Catalyst/Manual/Tutorial/Authorization.pod @@ -74,7 +74,7 @@ In this section you learn how to manually configure authorization. Edit C and add C to the list: - __PACKAGE__->setup(qw/ + use Catalyst qw/ -Debug ConfigLoader Static::Simple @@ -87,7 +87,7 @@ Edit C and add C to the list: Session Session::Store::FastMmap Session::State::Cookie - /); + /; =head2 Add Config Information for Authorization diff --git a/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod index 5197842..2c22731 100644 --- a/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod @@ -181,17 +181,17 @@ To modify the list of plugins, edit C (this file is generally referred to as your I) and delete the line with: - __PACKAGE__->setup(qw/-Debug ConfigLoader Static::Simple/); + use Catalyst qw/-Debug ConfigLoader Static::Simple/; Replace it with: - __PACKAGE__->setup(qw/ - -Debug - ConfigLoader - Static::Simple - - StackTrace - /); + use Catalyst qw/ + -Debug + ConfigLoader + Static::Simple + + StackTrace + /; This tells Catalyst to start using one new plugin: