link fixes
[catagits/Catalyst-Manual.git] / lib / Catalyst / Manual / Tutorial / 10_Appendices.pod
index 3af8a6c..e78a562 100644 (file)
@@ -2,7 +2,6 @@
 
 Catalyst::Manual::Tutorial::10_Appendices - Catalyst Tutorial - Chapter 10: Appendices
 
-
 =head1 OVERVIEW
 
 This is B<Chapter 10 of 10> for the Catalyst tutorial.
@@ -77,28 +76,28 @@ regex patterns).  I<Note that all 3 of the regexs end in 4 spaces>:
 
 =item *
 
-":0,$s/^    "
+C<":0,$s/^    ">
 
 Removes four leading spaces from the entire file (from the first line,
 C<0>, to the last line, C<$>).
 
 =item *
 
-"%s/^    "
+C<"%s/^    ">
 
 A shortcut for the previous item (C<%> specifies the entire file; so
 this removes four leading spaces from every line).
 
 =item *
 
-":.,$s/^    "
+C<":.,$s/^    ">
 
 Removes the first four spaces from the line the cursor is on at the time
 the regex command is executed (".") to the last line of the file.
 
 =item *
 
-":.,44s/^    "
+C<":.,44s/^    ">
 
 Removes four leading space from the current line through line 44
 (obviously adjust the C<44> to the appropriate value in your example).
@@ -123,26 +122,26 @@ entered on the last line.
 You can limit the replacement operation by selecting text first (depending
 on your version of Emacs, you can either use the mouse or experiment with
 commands such as C<C-SPC> to set the mark at the cursor location and
-C<C-E<lt>> and C<C-E<gt>> to set the mark at the beginning and end of the
+C<< C-< >> and C<< C-> >> to set the mark at the beginning and end of the
 file respectively.
 
-Also, Stefan Kangas sent in the following tip about an alternate 
-approach using the command C<indent-region> to redo the indentation 
-for the currently selected region (adhering to indent rules in the 
-current major mode). You can run the command by typing M-x 
-indent-region or pressing the default keybinding C-M-\ in cperl-mode. 
+Also, Stefan Kangas sent in the following tip about an alternate
+approach using the command C<indent-region> to redo the indentation
+for the currently selected region (adhering to indent rules in the
+current major mode). You can run the command by typing M-x
+indent-region or pressing the default keybinding C-M-\ in cperl-mode.
 Additional details can be found here:
 
-L<http://www.gnu.org/software/emacs/manual/html_node/emacs/Indentation-Commands.html>
+L<https://www.gnu.org/software/emacs/manual/html_node/emacs/Indentation-Commands.html>
 
 
 =head1 APPENDIX 2: USING POSTGRESQL AND MYSQL
 
 The main database used in this tutorial is the very simple yet powerful
-L<SQLite|http://www.sqlite.org>.  This section provides information
+L<SQLite|https://www.sqlite.org>.  This section provides information
 that can be used to "convert" the tutorial to use
-L<PostgreSQL|http://www.postgresql.org> and
-L<MySQL|http://dev.mysql.com>.  However, note that part of
+L<PostgreSQL|https://www.postgresql.org> and
+L<MySQL|https://dev.mysql.com>.  However, note that part of
 the beauty of the MVC architecture is that very little database-specific
 code is spread throughout the system (at least when MVC is "done
 right").  Consequently, converting from one database to another is
@@ -158,9 +157,9 @@ field types/constraints.
 
 =head2 PostgreSQL
 
-Use the following steps to adapt the tutorial to PostgreSQL.  Thanks 
-to Caelum (Rafael Kitover) for assistance with the most recent 
-updates, and Louis Moore, Marcello Romani and Tom Lanyon for help with 
+Use the following steps to adapt the tutorial to PostgreSQL.  Thanks
+to Caelum (Rafael Kitover) for assistance with the most recent
+updates, and Louis Moore, Marcello Romani and Tom Lanyon for help with
 earlier versions.
 
 =over 4
@@ -175,13 +174,13 @@ Chapter 3: More Catalyst Basics
 
 Install the PostgreSQL server and client and DBD::Pg:
 
-If you are following along in Debian 5, you can quickly install these 
+If you are following along in Debian 6, you can quickly install these
 items via this command:
 
     sudo aptitude install postgresql libdbd-pg-perl libdatetime-format-pg-perl
 
-To configure the permissions, you can open 
-C</etc/postgresql/8.3/main/pg_hba.conf> and change this line (near the 
+To configure the permissions, you can open
+F</etc/postgresql/8.3/main/pg_hba.conf> and change this line (near the
 bottom):
 
     # "local" is for Unix domain socket connections only
@@ -199,8 +198,8 @@ And then restart PostgreSQL:
 
 =item *
 
-Create the database and a user for the database (note that we are 
-using "E<lt>catalystE<gt>" to represent the hidden password of 
+Create the database and a user for the database (note that we are
+using "<catalyst>" to represent the hidden password of
 "catalyst"):
 
     $ sudo -u postgres createuser -P catappuser
@@ -221,7 +220,7 @@ Create the C<.sql> file and load the data:
 
 =item *
 
-Open the C<myapp01_psql.sql> in your editor and enter:
+Open the F<myapp01_psql.sql> in your editor and enter:
 
     --
     -- Drops just in case you are reloading
@@ -232,7 +231,7 @@ Open the C<myapp01_psql.sql> in your editor and enter:
     DROP TABLE IF EXISTS users CASCADE;
     DROP TABLE IF EXISTS roles CASCADE;
     DROP TABLE IF EXISTS user_roles CASCADE;
-    
+
     --
     -- Create a very simple database to hold book and author information
     --
@@ -244,20 +243,20 @@ Open the C<myapp01_psql.sql> in your editor and enter:
         -- created     TIMESTAMP NOT NULL DEFAULT now(),
         -- updated     TIMESTAMP
     );
-    
+
     CREATE TABLE authors (
         id          SERIAL PRIMARY KEY,
         first_name  TEXT,
         last_name   TEXT
     );
-    
+
     -- 'book_authors' is a many-to-many join table between books & authors
     CREATE TABLE book_authors (
         book_id     INTEGER REFERENCES books(id) ON DELETE CASCADE ON UPDATE CASCADE,
         author_id   INTEGER REFERENCES authors(id) ON DELETE CASCADE ON UPDATE CASCADE,
         PRIMARY KEY (book_id, author_id)
     );
-    
+
     ---
     --- Load some sample data
     ---
@@ -288,7 +287,7 @@ Open the C<myapp01_psql.sql> in your editor and enter:
 Load the data:
 
     $ psql -U catappuser -W catappdb -f myapp01_psql.sql
-    Password for user catappuser: 
+    Password for user catappuser:
     psql:myapp01_psql.sql:8: NOTICE:  CREATE TABLE will create implicit sequence "books_id_seq" for serial column "books.id"
     psql:myapp01_psql.sql:8: NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "books_pkey" for table "books"
     CREATE TABLE
@@ -309,24 +308,24 @@ Make sure the data loaded correctly:
     $ psql -U catappuser -W catappdb
     Password for user catappuser: <catalyst>
     Welcome to psql 8.3.7, the PostgreSQL interactive terminal.
-    
+
     Type:  \copyright for distribution terms
            \h for help with SQL commands
            \? for help with psql commands
            \g or terminate with semicolon to execute query
            \q to quit
-    
+
     catappdb=> \dt
                  List of relations
-     Schema |     Name     | Type  |   Owner    
+     Schema |     Name     | Type  |   Owner
     --------+--------------+-------+------------
      public | authors      | table | catappuser
      public | book_authors | table | catappuser
      public | books        | table | catappuser
     (3 rows)
-    
+
     catappdb=> select * from books;
-     id |               title                | rating 
+     id |               title                | rating
     ----+------------------------------------+--------
       1 | CCSP SNRS Exam Certification Guide |      5
       2 | TCP/IP Illustrated, Volume 1       |      5
@@ -334,8 +333,8 @@ Make sure the data loaded correctly:
       4 | Perl Cookbook                      |      5
       5 | Designing with Web Standards       |      5
     (5 rows)
-    
-    catappdb=> 
+
+    catappdb=>
 
 =back
 
@@ -344,13 +343,13 @@ Make sure the data loaded correctly:
 After the steps where you:
 
     edit lib/MyApp.pm
-    
+
     create lib/MyAppDB.pm
-    
+
     create lib/MyAppDB/Book.pm
-    
+
     create lib/MyAppDB/Author.pm
-    
+
     create lib/MyAppDB/BookAuthor.pm
 
 
@@ -396,12 +395,12 @@ Chapter 5: Authentication
 
 Create the C<.sql> file for the user/roles data:
 
-Open C<myapp02_psql.sql> in your editor and enter:
+Open F<myapp02_psql.sql> in your editor and enter:
 
     --
     -- Add users and roles tables, along with a many-to-many join table
     --
-    
+
     CREATE TABLE users (
         id            SERIAL PRIMARY KEY,
         username      TEXT,
@@ -411,24 +410,24 @@ Open C<myapp02_psql.sql> in your editor and enter:
         last_name     TEXT,
         active        INTEGER
     );
-    
+
     CREATE TABLE roles (
         id   SERIAL PRIMARY KEY,
         role TEXT
     );
-    
+
     CREATE TABLE user_roles (
         user_id INTEGER REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE,
         role_id INTEGER REFERENCES roles(id) ON DELETE CASCADE ON UPDATE CASCADE,
         PRIMARY KEY (user_id, role_id)
     );
-    
+
     --
     -- Load up some initial test data
     --
-    INSERT INTO users (username, password, email_address, first_name, last_name, active) 
+    INSERT INTO users (username, password, email_address, first_name, last_name, active)
         VALUES ('test01', 'mypass', 't01@na.com', 'Joe',  'Blow', 1);
-    INSERT INTO users (username, password, email_address, first_name, last_name, active) 
+    INSERT INTO users (username, password, email_address, first_name, last_name, active)
         VALUES ('test02', 'mypass', 't02@na.com', 'Jane', 'Doe',  1);
     INSERT INTO users (username, password, email_address, first_name, last_name, active)
         VALUES ('test03', 'mypass', 't03@na.com', 'No',   'Go',   0);
@@ -467,7 +466,7 @@ Confirm with:
 
     $ psql -U catappuser -W catappdb -c "select * from users"
     Password for user catappuser: <catalyst>
-     id | username | password | email_address | first_name | last_name | active 
+     id | username | password | email_address | first_name | last_name | active
     ----+----------+----------+---------------+------------+-----------+--------
       1 | test01   | mypass   | t01@na.com    | Joe        | Blow      |      1
       2 | test02   | mypass   | t02@na.com    | Jane       | Doe       |      1
@@ -477,26 +476,26 @@ Confirm with:
 
 =item *
 
-Modify C<set_hashed_passwords.pl> to match the following (the only difference
+Modify F<set_hashed_passwords.pl> to match the following (the only difference
 is the C<connect> line):
 
     #!/usr/bin/perl
-    
+
     use strict;
     use warnings;
-    
+
     use MyApp::Schema;
-    
+
     my $schema = MyApp::Schema->connect('dbi:Pg:dbname=catappdb', 'catappuser', 'catalyst');
-    
+
     my @users = $schema->resultset('Users')->all;
-    
+
     foreach my $user (@users) {
         $user->password('mypass');
         $user->update;
     }
 
-Run the C<set_hashed_passwords.pl> as per the "normal" flow of the 
+Run the F<set_hashed_passwords.pl> as per the "normal" flow of the
 tutorial:
 
     $ perl -Ilib set_hashed_passwords.pl
@@ -536,12 +535,12 @@ The MySQL database server and client utility.
 
 =item *
 
-The Perl C<DBD::MySQL> module
+The Perl L<DBD::MySQL> module
 
 =back
 
 For CentOS users (see
-L<Catalyst::Manual::Installation::CentOS4|Catalyst::Manual::Installation::CentOS4>),
+L<Catalyst::Manual::Installation::CentOS4>),
 you can use the following commands to install the software and start the MySQL
 daemon:
 
@@ -562,7 +561,7 @@ in you MySQL. You can simply figure out that your install supports it or not:
     Enter password:
     Welcome to the MySQL monitor.  Commands end with ; or \g.
 
-    Type 'help;' or '\h' for help. Type '\c' to clear the current input 
+    Type 'help;' or '\h' for help. Type '\c' to clear the current input
     statement.
 
     mysql> SHOW VARIABLES LIKE 'have_innodb';
@@ -610,29 +609,29 @@ Create the C<.sql> file and load the data:
 
 =item *
 
-Open the C<myapp01_mysql.sql> in your editor and enter:
+Open the F<myapp01_mysql.sql> in your editor and enter:
 
     --
     -- Create a very simple database to hold book and author information
     --
     CREATE TABLE IF NOT EXISTS `books` (
-      `id` int(11) NOT NULL AUTO_INCREMENT,
-      `title` text CHARACTER SET utf8,
-      `rating` int(11) DEFAULT NULL,
-      PRIMARY KEY (`id`)
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `title` text CHARACTER SET utf8,
+        `rating` int(11) DEFAULT NULL,
+        PRIMARY KEY (`id`)
     ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
     -- 'book_authors' is a many-to-many join table between books & authors
     CREATE TABLE IF NOT EXISTS `book_authors` (
-      `book_id` int(11) NOT NULL DEFAULT '0',
-      `author_id` int(11) NOT NULL DEFAULT '0',
-      PRIMARY KEY (`book_id`,`author_id`),
-      KEY `author_id` (`author_id`)
+        `book_id` int(11) NOT NULL DEFAULT '0',
+        `author_id` int(11) NOT NULL DEFAULT '0',
+        PRIMARY KEY (`book_id`,`author_id`),
+        KEY `author_id` (`author_id`)
     ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
     CREATE TABLE IF NOT EXISTS `authors` (
-      `id` int(11) NOT NULL AUTO_INCREMENT,
-      `first_name` text CHARACTER SET utf8,
-      `last_name` text CHARACTER SET utf8,
-      PRIMARY KEY (`id`)
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `first_name` text CHARACTER SET utf8,
+        `last_name` text CHARACTER SET utf8,
+        PRIMARY KEY (`id`)
     ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
     ---
     --- Load some sample data
@@ -729,7 +728,7 @@ Delete the existing model:
 Regenerate the model using the Catalyst "_create.pl" script:
 
     script/myapp_create.pl model DB DBIC::Schema MyApp::Schema create=static \
-       dbi:mysql:myapp 'tutorial' 'yourpassword' '{ AutoCommit => 1 }'
+        dbi:mysql:myapp 'tutorial' 'yourpassword' '{ AutoCommit => 1 }'
 
 =back
 
@@ -745,31 +744,31 @@ Chapter 5: Authentication
 
 Create the C<.sql> file for the user/roles data:
 
-Open C<myapp02_mysql.sql> in your editor and enter:
+Open F<myapp02_mysql.sql> in your editor and enter:
 
     --
     -- Add users and roles tables, along with a many-to-many join table
     --
     CREATE TABLE IF NOT EXISTS `roles` (
-      `id` int(11) NOT NULL,
-      `role` text CHARACTER SET utf8,
-      PRIMARY KEY (`id`)
+        `id` int(11) NOT NULL,
+        `role` text CHARACTER SET utf8,
+        PRIMARY KEY (`id`)
     ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
     CREATE TABLE IF NOT EXISTS `users` (
-      `id` int(11) NOT NULL,
-      `username` text CHARACTER SET utf8,
-      `password` text CHARACTER SET utf8,
-      `email_address` text CHARACTER SET utf8,
-      `first_name` text CHARACTER SET utf8,
-      `last_name` text CHARACTER SET utf8,
-      `active` int(11) DEFAULT NULL,
-      PRIMARY KEY (`id`)
+        `id` int(11) NOT NULL,
+        `username` text CHARACTER SET utf8,
+        `password` text CHARACTER SET utf8,
+        `email_address` text CHARACTER SET utf8,
+        `first_name` text CHARACTER SET utf8,
+        `last_name` text CHARACTER SET utf8,
+        `active` int(11) DEFAULT NULL,
+        PRIMARY KEY (`id`)
     ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
     CREATE TABLE IF NOT EXISTS `user_roles` (
-      `user_id` int(11) NOT NULL DEFAULT '0',
-      `role_id` int(11) NOT NULL DEFAULT '0',
-      PRIMARY KEY (`user_id`,`role_id`),
-      KEY `role_id` (`role_id`)
+        `user_id` int(11) NOT NULL DEFAULT '0',
+        `role_id` int(11) NOT NULL DEFAULT '0',
+        PRIMARY KEY (`user_id`,`role_id`),
+        KEY `role_id` (`role_id`)
     ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
     --
     -- Load up some initial test data
@@ -810,7 +809,7 @@ Update the model:
 Regenerate the model using the Catalyst "_create.pl" script:
 
     script/myapp_create.pl model DB DBIC::Schema MyApp::Schema create=static \
-       components=TimeStamp,PassphraseColumn dbi:mysql:myapp 'tutorial' 'yourpassword' '{ AutoCommit => 1 }'
+        components=TimeStamp,PassphraseColumn dbi:mysql:myapp 'tutorial' 'yourpassword' '{ AutoCommit => 1 }'
 
 =back
 
@@ -818,7 +817,7 @@ Regenerate the model using the Catalyst "_create.pl" script:
 
 Create the C<.sql> file for the hashed password data:
 
-Open C<myapp03_mysql.sql> in your editor and enter:
+Open F<myapp03_mysql.sql> in your editor and enter:
 
     --
     -- Convert passwords to SHA-1 hashes
@@ -842,10 +841,10 @@ Load the user/roles data:
 
 Kennedy Clark, C<hkclark@gmail.com>
 
-Please report any errors, issues or suggestions to the author.  The
-most recent version of the Catalyst Tutorial can be found at
-L<http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/>.
+Feel free to contact the author for any errors or suggestions, but the
+best way to report issues is via the CPAN RT Bug system at
+L<https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Manual>.
 
-Copyright 2006-2010, Kennedy Clark, under the
+Copyright 2006-2011, Kennedy Clark, under the
 Creative Commons Attribution Share-Alike License Version 3.0
-(L<http://creativecommons.org/licenses/by-sa/3.0/us/>).
+(L<https://creativecommons.org/licenses/by-sa/3.0/us/>).