[Catalyst-commits] r7785 - trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial

hkclark at dev.catalyst.perl.org hkclark at dev.catalyst.perl.org
Sat May 24 12:31:17 BST 2008


Author: hkclark
Date: 2008-05-24 12:31:16 +0100 (Sat, 24 May 2008)
New Revision: 7785

Modified:
   trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/Authentication.pod
   trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/Intro.pod
   trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod
Log:
Add additional information for transition from YAML to Config::General

Modified: trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/Authentication.pod
===================================================================
--- trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/Authentication.pod	2008-05-23 22:57:59 UTC (rev 7784)
+++ trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/Authentication.pod	2008-05-24 11:31:16 UTC (rev 7785)
@@ -287,10 +287,18 @@
 
 Although C<__PACKAGE__-E<gt>config(name =E<gt> 'value');> is still 
 supported, newer Catalyst applications tend to place all configuration 
-information in C<myapp.yml> and automatically load this information 
+information in C<myapp.conf> and automatically load this information 
 into C<MyApp-E<gt>config> using the 
-L<ConfigLoader|Catalyst::Plugin::ConfigLoader> plugin.  Here, we need 
-to load several parameters that tell 
+L<ConfigLoader|Catalyst::Plugin::ConfigLoader> plugin.  
+
+First, as noted in Part 3 of the tutorial, Catalyst has recently 
+switched from a default config file format of YAML to 
+C<Config::General> (an apache-like format).  In case you are using
+a version of Catalyst earlier than v5.7014, delete the C<myapp.yml>
+file and simply follow the directions below to create a new
+C<myapp.conf> file.
+
+Here, we need to load several parameters that tell 
 L<Catalyst::Plugin::Authentication|Catalyst::Plugin::Authentication> 
 where to locate information in your database.  To do this, edit the 
 C<myapp.conf> file and update it to match:

Modified: trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/Intro.pod
===================================================================
--- trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/Intro.pod	2008-05-23 22:57:59 UTC (rev 7784)
+++ trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/Intro.pod	2008-05-24 11:31:16 UTC (rev 7785)
@@ -325,7 +325,7 @@
 Install Catalyst:
 
     sudo apt-get update
-    sudo apt-get install libdbd-sqlite3-perl libcatalyst-perl libcatalyst-modules-perl
+    sudo apt-get install libdbd-sqlite3-perl libcatalyst-perl libcatalyst-modules-perl libconfig-general-perl
 
 Accept all of the dependencies.  Done.
 

Modified: trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod
===================================================================
--- trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod	2008-05-23 22:57:59 UTC (rev 7784)
+++ trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/MoreCatalystBasics.pod	2008-05-24 11:31:16 UTC (rev 7785)
@@ -140,6 +140,30 @@
 this feature of Catalyst during the authentication and authorization
 sections (Part 5 and Part 6).
 
+B<IMPORTANT NOTE>: If you are following along in Ubuntu 8.04 or 
+otherwise using a version of Catalyst prior to v5.7014, you need to be 
+aware that Catalyst changed from a default format of YAML to the more 
+straightforward C<Config::General> format.  Because Catalyst has long 
+supported both formats, this tutorial will simply use a configuration 
+file called C<myapp.conf> instead of C<myapp.yml> and Catatlyst will 
+automcatically use the new format.  Just be aware that earlier versions 
+of Catalyst will still create the C<myapp.yml> file and that you will 
+need to B<remove C<myapp.yml>> and create a new C<myapp.conf> file by 
+hand, but otherwise this transition is very painless.  The default 
+contents of C<myapp.conf> should only consist of one line: C<name 
+MyApp>.  Also be aware that you can continue to use any format
+supported by 
+L<Catalyst::Plugin::ConfigLoader|Catalyst::Plugin::ConfigLoader> and 
+L<Config::Any|Config::Any>, including YAML -- Catalyst will 
+automatically look for any of the supported configuration file formats.
+
+C<TIP>: This script can be useful for converting between configuration 
+formats:
+
+    perl -Ilib -e 'use MyApp; use Config::General; 
+        Config::General->new->save_file("myapp.conf", MyApp->config);'
+
+
 =item *
 
 L<Catalyst::Plugin::Static::Simple|Catalyst::Plugin::Static::Simple>




More information about the Catalyst-commits mailing list