X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2FCatalystBasics.pod;h=16826a20cb6547f055888196805fd9222d23dfbf;hb=8e9564644668f2677f492999cdf112b4acecba64;hp=c7c752f4a339c6b8129920f4938f813f806d756f;hpb=71dedf57db8d0813e63bcfc3fc3b60b469cf81a8;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod index c7c752f..16826a2 100644 --- a/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod @@ -49,6 +49,7 @@ L =back + =head1 DESCRIPTION In this part of the tutorial, we will create a very basic Catalyst web @@ -106,7 +107,7 @@ B: Note that all of the code for this part of the tutorial can be pulled from the Catalyst Subversion repository in one step with the following command: - svn checkout http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/Tutorial@### + svn checkout http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/Tutorial@4609 . IMPORTANT: Does not work yet. Will be completed for final version. @@ -120,6 +121,12 @@ In the case of this tutorial, use the Catalyst C script to initialize the framework for an application called C: $ catalyst.pl MyApp + created "MyApp" + created "MyApp/script" + created "MyApp/lib" + created "MyApp/root" + ... + created "MyApp/script/myapp_create.pl" $ cd MyApp The C helper script will display the names of the @@ -129,12 +136,53 @@ Though it's too early for any significant celebration, we already have a functioning application. Run the following command to run this application with the built-in development web server: - $ script/myapp_server.pl + $ script/myapp_server.pl + [debug] Debug messages enabled + [debug] Loaded plugins: + .----------------------------------------------------------------------------. + | Catalyst::Plugin::ConfigLoader 0.06 | + | Catalyst::Plugin::Static::Simple 0.14 | + '----------------------------------------------------------------------------' + + [debug] Loaded dispatcher "Catalyst::Dispatcher" + [debug] Loaded engine "Catalyst::Engine::HTTP" + [debug] Found home "/root/dev/MyApp" + [debug] Loaded components: + .-----------------------------------------------------------------+----------. + | Class | Type | + +-----------------------------------------------------------------+----------+ + | MyApp::Controller::Root | instance | + '-----------------------------------------------------------------+----------' + + [debug] Loaded Private actions: + .----------------------+--------------------------------------+--------------. + | Private | Class | Method | + +----------------------+--------------------------------------+--------------+ + | /default | MyApp::Controller::Root | default | + | /end | MyApp::Controller::Root | end | + '----------------------+--------------------------------------+--------------' + + [info] MyApp powered by Catalyst 5.7000 + You can connect to your server at http://localhost.localdomain:3000 + +Point your web browser to L (substituting a +different hostname or IP address as appropriate) and you should be +greeted by the Catalyst welcome screen. Information similar to the +following should be appended to the logging output of the development +server: + + [info] *** Request 1 (0.008/s) [2822] [Mon Jul 3 12:42:43 2006] *** + [debug] "GET" request for "/" from "127.0.0.1" + [info] Request took 0.154781s (6.461/s) + .----------------------------------------------------------------+-----------. + | Action | Time | + +----------------------------------------------------------------+-----------+ + | /default | 0.069475s | + | /end | 0.085305s | + '----------------------------------------------------------------+-----------' + +Press Ctrl-C to break out of the development server. -Point your web browser to L (substituting a -different hostname or IP address as appropriate) and you should be -greeted by the Catalyst welcome screen. Press Ctrl-C to break out of -the development server. =head1 CREATE A SQLITE DATABASE @@ -187,7 +235,7 @@ in your editor and enter: INSERT INTO book_authors VALUES (5, 8); B: See Appendix 1 for tips on removing the leading spaces when -cutting and pasting example code from POD documents. +cutting and pasting example code from POD-based documents. Then use the following command to build a C SQLite database: @@ -253,7 +301,9 @@ this plugin when you place your application into production. As you may have noticed, C<-Debug> is not a plugin, but a I. Although most of the items specified on the C line of your application class will be plugins, Catalyst supports a limited number of -flag options (of these, C<-Debug> is the most common). +flag options (of these, C<-Debug> is the most common). See the +documentation for C to get details on other flags +(currently C<-Engine>, C<-Home>, and C<-Log>). If you prefer, you can use the C<$c-Edebug> method to enable debug messages. @@ -272,7 +322,7 @@ authorization sections (Part 4 and Part 5). =item * -L +L C provides an easy method of serving static content such as images and CSS files under the development server. @@ -292,57 +342,23 @@ Replace it with: ConfigLoader Static::Simple - Dumper StackTrace - DefaultEnd /; -This tells Catalyst to start using three new plugins: +This tells Catalyst to start using one new plugin: =over 4 =item * -L - -Allows you to easily use L to dump variables -to the logs, for example: - - $c->log->dumper($myvar); - -When running your application under the development server, the logs -will be printed to your screen along with the other debug information -generated by the C<-Debug> flag. - -=item * - L Adds a stack trace to the standard Catalyst "debug screen" (this is the screen Catalyst sends to your browser when an error occurs). -Note: L output appears on the console -window where you issue the C