B<NOTE: You can use any Perl-supported OS and environment to run
Catalyst.> It should make little or no difference to Catalyst's
-operation, B<but this tutorial has been written using the Debian 6 live
+operation, B<but this tutorial has been written using the Debian 6 Live
CD> because that represents a quick and easy way for most people to try
out Catalyst with virtually zero setup time and hassles. Also, the
tutorial has been tested to work correctly with the versions of Catalyst
=item *
-The use of L<DBIx::Class|DBIx::Class> (DBIC) for the model (including
+The use of L<DBIx::Class> (DBIC) for the model (including
some of the more advanced techniques you will probably want to use in
your applications).
=item *
-The use of L<HTML::FormFu|HTML::FormFu> or L<HTML::FormHandler|HTML::FormHandler>
+The use of L<HTML::FormFu> or L<HTML::FormHandler>
for automated form processing and validation.
=back
For those who want to get going quickly, here is a short "cookbook-style
recipe" to quickly get you up and running. Although there are many
different ways to get a Catalyst environment going, this tutorial has
-been written with and tested against Debian 6 Live CD, using the steps
-in this Quick Start.
+been written with and tested against the Debian 6 Live CD, using the
+steps in this Quick Start.
If you want, you can follow the directions in this section and then jump
right to L<Chapter 2|Catalyst::Manual::Tutorial::02_CatalystBasics> of
those other sections for suggestions if you do not wish to use the
Debian 6 Live CD.
-
=over 4
=item 1
=item 5
If you want to be able to remotely SSH to this system, set a
-password for root:
+password for root (you might want to do "dpkg -l | grep openssh-server"
+to be sure the ISO image you downloaded has the SSH daemon installed...
+if it's missing, do a "sudo aptitude -y install openssh-server"):
sudo passwd
...
Install Catalyst and related libraries:
sudo aptitude update
- sudo aptitude -y install sqlite3 libdbd-sqlite3-perl libcatalyst-perl \
- libcatalyst-modules-perl libdbix-class-timestamp-perl \
- libdatetime-format-sqlite-perl libconfig-general-perl \
- libhtml-formfu-model-dbic-perl libterm-readline-perl-perl \
- libdbix-class-encodedcolumn-perl libperl6-junction-perl \
- libtest-pod-perl
+ sudo aptitude -y install libcatalyst-perl libdatetime-format-sqlite-perl \
+ libdbix-class-encodedcolumn-perl sqlite3 libcatalyst-modules-perl \
+ libperl6-junction-perl libcatalyst-modules-extra-perl \
+ libdbix-class-timestamp-perl
sudo aptitude clean
=item 8
=head1 VERSIONS AND CONVENTIONS USED IN THIS TUTORIAL
This tutorial was built using the following resources. Please note that
-you may need to make adjustments for different environments and
-versions (note that trailing zeros in version numbers are not
-significant and may get dropped with techniques for viewing them;
-for example, Catalyst v5.80020 might show up as 5.8002):
+you may need to make adjustments for different environments and versions
+(note that trailing zeros in version numbers are not significant and may
+get dropped with some techniques for viewing them; for example, Catalyst
+v5.80020 might show up as 5.8002):
=over 4
=item *
-Debian 5 (Lenny)
+Debian 6 (Squeeze)
=item *
-Catalyst v5.80020 (note: may show up as '5.8002' without the trailing zero)
+Catalyst v5.80025
=item *
-Catalyst::Devel v1.26
+Catalyst::Devel v1.28
=item *
-DBIx::Class v0.08115
+DBIx::Class v0.08123
=item *
-Catalyst::Model::DBIC::Schema v0.40
+Catalyst::Model::DBIC::Schema v0.41
=item *
-Template Toolkit v2.20
-
-
-=item *
-
-Catalyst Plugins
-
-The plugins used in this tutorial all have sufficiently stable APIs that
-you shouldn't need to worry about versions. However, there could be
-cases where the tutorial is affected by what version of plugins you
-use. This tutorial has been tested against the following set of plugins:
+Template Toolkit v2.22
-=over 4
-
-=item *
-
-Catalyst::Plugin::Authentication -- v0.10016
=item *
-Catalyst::Plugin::Authorization::Roles -- v0.08
-
-=item *
-
-Catalyst::Plugin::ConfigLoader -- v0.27
-
-=item *
-
-Catalyst::Plugin::Session -- v0.29
-
-=item *
-
-Catalyst::Plugin::Session::State::Cookie -- v0.17
-
-=item *
-
-Catalyst::Plugin::Session::Store::File -- v0.18
-
-=item *
-
-Catalyst::Plugin::StackTrace -- v0.11
-
-=item *
-
-Catalyst::Plugin::Static::Simple -- v0.29
-
-=back
-
-=item *
-
-HTML::FormFu -- v0.06001
+HTML::FormFu -- v0.07002
=item *
B<NOTE:> You can check the versions you have installed with the
-following command:
+following command (note the slash before the space):
+
+ perl -M<_mod_name_>\ 999
+
+or:
perl -M<_mod_name_> -e 'print "$<_mod_name_>::VERSION\n"'
For example:
- perl -MCatalyst -e 'print "$Catalyst::VERSION\n";'
+ perl -MCatalyst::Devel\ 999
or:
This tutorial will assume that the web browser is located on the same
system where the Catalyst development server is running, and therefore
use a URL of C<http://localhost:3000> (the Catalyst development server
-defaults to port 3000). If you are running Perl on a different box than
+defaults to port 3000, but can be changed with the "-p" option to the
+development server). If you are running Perl on a different box than
where your web browser is located (or using a different port number via
the C<-p> I<port_number> option to the development server), then you
will need to update the URL you use accordingly.
"C<debian-live-6.0.1-i386-rescue.iso>" is probably the best all-around
option for most people because it includes many extra tools such as the
GCC compiler, therefore saving RAM (every package you need to install
-when running from live CD consumes memory because RAM disk is being used
-in lieu of real disk space). When initially booting under this image,
-you may see some cryptic warning messages having to do with various
-diagnostic tools it tries to load or enable, but you should be able to
-safely ignore these.
+when running from a Live CD consumes memory because RAM disk is being
+used in lieu of real disk space). When initially booting under this
+image, you may see some cryptic warning messages having to do with
+various diagnostic tools it tries to load or enable, but you should be
+able to safely ignore these.
=item *
Install Catalyst:
sudo aptitude update
- sudo aptitude -y install sqlite3 libdbd-sqlite3-perl libcatalyst-perl \
- libcatalyst-modules-perl libdbix-class-timestamp-perl \
- libdatetime-format-sqlite-perl libconfig-general-perl \
- libhtml-formfu-model-dbic-perl libterm-readline-perl-perl \
- libdbix-class-encodedcolumn-perl libperl6-junction-perl \
- libtest-pod-perl
-
-Let it install (normally about a 30 to 90-second operaton) and you are
-done. (Note the '\' above. Depending on your environment, you might
-be able to cut and paste the text as shown or need to remove the '\'
+ sudo aptitude -y install libcatalyst-perl libdatetime-format-sqlite-perl \
+ libdbix-class-encodedcolumn-perl sqlite3 libcatalyst-modules-perl \
+ libperl6-junction-perl libcatalyst-modules-extra-perl \
+ libdbix-class-timestamp-perl
+
+Let it install (normally about a 30 to 90-second operation) and you are
+done. (Note the '\' above. Depending on your environment, you might be
+able to cut and paste the text as shown or need to remove the '\'
characters to that the command is all on a single line.)
If you are using an image other than the "rescue" ISO, you will also need
=item *
Although you can free up space by removing packages you installed since
-you last booted (check out "C<aptitude remove _pkg_name>"), don't bother
+you last booted (check out "C<aptitude remove _pkg_name_>"), don't bother
trying to remove packages already available at the time of boot. Instead
-of freeing up space, it will actual I<consume> some space. (The live CD
+of freeing up space, it will actual consume I<more> space. (The live CD
uses these "burn in" packages right from the CD disk vs. first loading
them on the virtual RAM disk. However, if you remove them, the system
has to update various files, something that I<does> consume some space
Ubuntu
-Ubuntu is an extremely popular offshoot of Debian. It provides cutting
-edge versions of many common tools, application and libraries in an
+Ubuntu is a popular offshoot of Debian. It provides cutting edge
+versions of many common tools, application and libraries in an
easy-to-run live CD configuration (and because a single download option
can be used for both live CD and install-to-disk usage, it keeps your
download options nice and simple). As with Debian 6, you should be able
Available at L<http://www.shadowcat.co.uk/static/cat-install>,
C<cat-install> can be a fairly painless way to get Catalyst up and
-running. Just download the script from the link above and type C<perl
-cat-install>. Depending on the speed of your Internet connection and
-your computer, it will probably take 30 to 60 minutes to install because
-it downloads, makes, compiles, and tests every module. But this is an
-excellent way to automate the installation of all the latest modules
-used by Catalyst from CPAN.
+running. Just download the script from the link above and type
+C<perl cat-install>. Depending on the speed of your Internet connection
+and your computer, it will probably take 30 to 60 minutes to install
+because it downloads, makes, compiles, and tests every module. But this
+is an excellent way to automate the installation of all the latest
+modules used by Catalyst from CPAN.
=item *
You can get more information at
L<http://www.catalystframework.org/calendar/2008/7> or
-L<Perl::Dist::CatInABox|Perl::Dist::CatInABox>.
+L<Perl::Dist::CatInABox>.
=item *
There are currently two flavors of publicly available Amazon Machine
Images (AMI) that include all the elements you'd need to begin
developing in a fully functional Catalyst environment within minutes.
-See L<Catalyst::Manual::Installation|Catalyst::Manual::Installation>
+See L<Catalyst::Manual::Installation>
for more details.
=back
For additional information and recommendations on Catalyst installation,
please refer to
-L<Catalyst::Manual::Installation|Catalyst::Manual::Installation>.
+L<Catalyst::Manual::Installation>.
=head1 DATABASES
This tutorial will primarily focus on SQLite because of its simplicity
of installation and use; however, modifications in the script required
-to support MySQL and PostgreSQL will be presented in Appendix.
+to support MySQL and PostgreSQL will be presented in the Appendix.
-B<Note:> One of the advantages of the MVC design patterns is that
-applications become much more database independent. As such, you will
-notice that only the C<.sql> files used to initialize the database
-change between database systems: the Catalyst code generally remains the
+B<Note:> One of the advantages of using tools like Catalyst and DBIC is
+that applications become much more database independent. As such, you
+will notice that only the C<.sql> files used to initialize the database
+change between database systems: most of the code generally remains the
same.
cd MyApp_Chapter8/MyApp
CATALYST_DEBUG=0 prove -wl t
-If you wish to include the L<HTML::FormFu|HTML::FormFu> section in your tests,
+If you wish to include the L<HTML::FormFu> section in your tests,
substitute C<MyApp_Chapter9_FormFu> for C<MyApp_Chapter8> in the URL
above (don't forget to "cd" out of the Ch8 directory if you ran the code above).