X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial.pod;h=af5e1fa40567ae67e82e3232f499abf917e5e1a6;hp=1d620bf190fd8d85ef387ed6f77129425fb8cb29;hb=c9b77c06a0de97f1d6e9a66091e693a637578357;hpb=4cfbdfdba42801fbce9de80c0e3ff74d6531da3a diff --git a/lib/Catalyst/Manual/Tutorial.pod b/lib/Catalyst/Manual/Tutorial.pod index 1d620bf..af5e1fa 100644 --- a/lib/Catalyst/Manual/Tutorial.pod +++ b/lib/Catalyst/Manual/Tutorial.pod @@ -1,851 +1,574 @@ =head1 NAME -Catalyst::Manual::Tutorial - Getting started with Catalyst +Catalyst::Manual::Tutorial - Catalyst Tutorial: Overview =head1 DESCRIPTION -This document aims to get you up and running with Catalyst. +The Catalyst framework is a flexible and comprehensive environment for +quickly building high-functionality web applications. This tutorial is +designed to provide a rapid introduction to its basics and its most +commonly used features while focusing on real-world best practices. -=head2 Installation +The tutorial is divided into the following sections: -The first step is to install Catalyst, and the simplest way to do this -is to install the Catalyst bundle from CPAN: +=over 4 - $ perl -MCPAN -e 'install Task::Catalyst' +=item * -This will retrieve Catalyst and a number of useful extensions and -install them for you. This process might not be totally painless -though, and you might want to look at CatInABox -L, especially if you are -on a system that lacks a compiler. +L +=item * -=head2 The very basics - Setting up the skeleton application. +L -Catalyst includes a helper script, C, that will set up a -skeleton application for you: +=item * - $ catalyst tutorial +L - created "tutorial" - created "tutorial/script" - ... output snipped - created "tutorial/script/tutorial_create.pl" +=item * -This creates the directory structure, populated with skeleton -files. +L -=head2 Testing out the skeleton application +=item * -You can test out your new application by running the server script that -Catalyst provides: +L - $ cd tutorial - $ script/tutorial_server.pl +=item * - [...] [catalyst] [debug] Debug messages enabled - [...] [catalyst] [debug] Loaded plugins: - .------------------------------------------------------------------------------. - | Catalyst::Plugin::Static::Simple | - '------------------------------------------------------------------------------' - [...] [catalyst] [debug] Loaded dispatcher "Catalyst::Dispatcher" - [...] [catalyst] [debug] Loaded engine "Catalyst::Engine::HTTP" - [...] [catalyst] [debug] Found home "/home/users/me/tutorial" - [...] [catalyst] [debug] Loaded Private actions: - .--------------------------------------+---------------------------------------. - | Private | Class | - +--------------------------------------+---------------------------------------+ - | /default | tutorial | - '--------------------------------------+---------------------------------------' +L - [...] [catalyst] [info] tutorial powered by Catalyst 5.66 - You can connect to your server at http://localhost:3000 +=item * -(Note that each line logged by Catalyst begins with a timestamp, which has -been replaced here with "C<...>" so that the text fits onto the lines.) +L -The server is now waiting for you to make requests of it. Try using -telnet to manually make a simple GET request of the server (when -telnet responds with "Escape character is '^]'.", type "GET / HTTP/1.0" -and hit return twice): +=item * - $ telnet localhost 3000 - Trying 127.0.0.1... - Connected to localhost. - Escape character is '^]'. - GET / HTTP/1.0 +L - HTTP/1.0 200 OK - Date: Mon, 07 Nov 2005 14:57:39 GMT - Content-Length: 5525 - Content-Type: text/html; charset=utf-8 - Status: 200 - X-Catalyst: 5.66 +=back - [...] - Connection closed by foreign host. - $ +A tarball of the final application is available at +C. -You can see the full welcome message by visiting -http://localhost:3000/ with your browser. +=head1 Detailed Table Of Contents -More trace messages will appear in the original terminal window: +=head2 Part 1: Introduction - [...] [catalyst] [debug] ********************************** - [...] [catalyst] [debug] * Request 1 (0.063/s) [2148] - [...] [catalyst] [debug] ********************************** - [...] [catalyst] [debug] Arguments are "" - [...] [catalyst] [debug] "GET" request for "" from localhost - [...] [catalyst] [info] Request took 0.046883s (21.330/s) - .------------------------------------------------------------------+-----------. - | Action | Time | - +------------------------------------------------------------------+-----------+ - | /default | 0.000000s | - '------------------------------------------------------------------+-----------' +=over 4 -The server will continue running until you interrupt it. +=item * -The application can also be tested from the command line using the generated -helper script, C