X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial.pod;h=4b5084841015a7aa4bb81d6c0e5b537f7240a158;hb=4f4dac1f2c66aeaea0d05e100f550af669c56dcb;hp=0e4464508d93db8fdae5dbfaaafa4b12b0d2b8b4;hpb=af00c122ea90cce0d758c8757d0746b14211d4bf;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Manual/Tutorial.pod b/lib/Catalyst/Manual/Tutorial.pod index 0e44645..4b50848 100644 --- a/lib/Catalyst/Manual/Tutorial.pod +++ b/lib/Catalyst/Manual/Tutorial.pod @@ -1,849 +1,583 @@ =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: +B CLICK THESE LINKS TO JUMP TO CHAPTERS (the index links above +only navigate inside this page). - $ perl -MCPAN -e 'install Task::Catalyst' +=over 4 -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 at -L, especially if you are -on a system that lacks a compiler. +=item * +L -=head2 The very basics - Setting up the skeleton application. +=item * -Catalyst includes a helper script, C, that will set up a -skeleton application for you: +L - $ catalyst.pl tutorial +=item * - created "tutorial" - created "tutorial/script" - ... output snipped - created "tutorial/script/tutorial_create.pl" +L -This creates the directory structure, populated with skeleton -files. +=item * -=head2 Testing out the skeleton application +L -You can test out your new application by running the server script that -Catalyst provides: +=item * - $ cd tutorial - $ script/tutorial_server.pl +L - [...] [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 | - '--------------------------------------+---------------------------------------' +=item * - [...] [catalyst] [info] tutorial powered by Catalyst 5.67 - You can connect to your server at http://localhost:3000 +L -(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.) +=item * -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): +L - $ telnet localhost 3000 - Trying 127.0.0.1... - Connected to localhost. - Escape character is '^]'. - GET / HTTP/1.0 +=item * - 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.67 +L - [...] - Connection closed by foreign host. - $ +=item * -You can see the full welcome message by visiting -http://localhost:3000/ with your browser. +L -More trace messages will appear in the original terminal window: +=back - [...] [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 | - '------------------------------------------------------------------+-----------' +A tarball of the final application is available at +L. -The server will continue running until you interrupt it. -The application can also be tested from the command line using the generated -helper script, C