[Catalyst] Win32 Catalyst Demo
Jeremy Silva
JeremySilva at SilgorSolutions.com
Wed Apr 6 04:00:13 CEST 2005
Hey all,
Here are some instructions on getting the Hops example up and running
for win32 people. Hopefully it will help others out.
Jeremy
Installing Catalyst Hops SQLite Sample
on a Clean Win2k Installation
(requires some knowledge of PPM,CPAN, and a little Perl)
Pre-requisite software:
Nmake: ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe
sqlite2: http://www.sqlite.org/ (install in either windows/system or
another directory that is defined in your environment path).
1.) Install Active State 5.8
2.) Install in PPM the following(accept/install all related dependencies):
CGI-Simple
YAML
Cache-Cache
DBD-SQLite2
Class-DBI-Plugin-RetrieveAll
Module-Pluggable-Fast
Class-DBI-Loader
Class-DBI-SQLite
3.) Install in CPAN the following:
Bundle::Catalyst
Catalyst::Model::CDBI::CRUD
Template::Plugin::Class
4.) Per Sebastian's advice,
Open C:\Perl\site\lib\Catalyst\Plugin\Session\FastMmap.pm
and
replace line: "use Cache::FastMmap;"
with line: "use Cache::FileCache;" (or "use Cache::MemoryCache")
In the "setup" sub-routine, also make sure you replace
"Cache::FastMap" with
"Cache::FileCache".
Make sure that you wrap the "new" call, as a Hash Reference.
Example: Cache::FileCache->new( { ... } );
instead of Cache::FileCache->new();
(Thanks Sebastian!)
5.) Get the latest "Hops" example and unpack it into a directory
on your server. I have unpacked mine into "c:\code\hops".
6.) In the root "hops" example directory, edit "hops.yml".
Change "root" to be the "templates" sub-directory of your "hops"
directory (ex. c:\code\hops\templates).
Change the DBI string to point to "hops.db" (ex. c:\code\hops\hops.db).
Make sure to change the uri_base to be "templates".
7.) Edit the hops\lib\hops.PM file. Change "Hops->config(
YAML::LoadFile('...') );"
to point to your YML file.
ex.) Hops->config( YAML::LoadFile('c:\code\hops\hops.yml') );"
8.) Now you'll need to setup your database.
- Open up a command prompt window, to the "Hops" root directory.
- Type: "sqlite hops.db"
- Copy and paste the contents of the "hops_sqlite.sql" file, into the
command prompt window.
- Type: .exit
- Close down your current Hops Server instance.
9.) Open up a command windows.
Go to your Hops\script directory
Type: perl server.pl
Look out for any errors/warnings/non-compilations.
10.) Fire up a browser and point it at: http://servername:3000/
You should be looking at your brand new Catalyst Example App.
-------------- next part --------------
CREATE TABLE brewery (
id INTEGER PRIMARY KEY,
name varchar(30),
url varchar(50),
notes text
);
INSERT INTO brewery VALUES(1, 'St Peter''s Brewery', 'http://www.stpetersbrewery.co.uk/', NULL);
CREATE TABLE beer (
id INTEGER PRIMARY KEY,
brewery integer,
style integer,
name varchar(30),
url varchar(120),
score integer(2),
price varchar(12),
abv varchar(10),
notes text
);
INSERT INTO beer VALUES(1, 1, NULL, 'Organic Best Bitter', NULL, NULL, NULL, '4.1', NULL);
CREATE TABLE handpump (
id INTEGER PRIMARY KEY,
beer integer,
pub integer
);
INSERT INTO handpump VALUES(1, 1, 1);
CREATE TABLE pub (
id INTEGER PRIMARY KEY,
name varchar(60),
url varchar(120),
notes text
);
INSERT INTO pub VALUES(1, 'Turf Tavern', NULL, NULL);
CREATE TABLE style (
id INTEGER PRIMARY KEY,
name varchar(60),
notes text
);
INSERT INTO style VALUES(1, 'Test style','Note');
More information about the Catalyst
mailing list