source: trunk/lib/Vote.pm @ 194

Last change on this file since 194 was 194, checked in by nanardon, 15 years ago
  • clearly separate Catalyst Model and Vote::DB module, making test faster
File size: 1.8 KB
Line 
1package Vote;
2
3use strict;
4use warnings;
5use Config::YAML;
6
7use Catalyst::Runtime '5.70';
8
9# Set flags and add plugins for the application
10#
11#         -Debug: activates the debug mode for very useful log messages
12#   ConfigLoader: will load the configuration from a YAML file in the
13#                 application's home directory
14# Static::Simple: will serve static files from the application's root
15#                 directory
16
17use Catalyst qw/
18    ConfigLoader
19    Static::Simple
20    Session
21    Session::Store::DBI
22    Session::State::Cookie
23    /;
24
25# Configure the application.
26#
27# Note that settings in Vote.yml (or other external
28# configuration file that you set up manually) take precedence
29# over this when using ConfigLoader. Thus configuration
30# details given here can function as a default configuration,
31# with a external configuration file acting as an override for
32# local deployment.
33
34__PACKAGE__->config( name => 'Vote' );
35
36# Config file, in tree, else should be in /etc
37
38__PACKAGE__->config(
39    'Plugin::ConfigLoader' => {
40        file => -f __PACKAGE__->path_to('epoll.yml')
41            ? __PACKAGE__->path_to('epoll.yml')
42            : '/etc/epoll.yml',
43    }
44);
45
46__PACKAGE__->config->{session} = {
47    expires   => 1800,
48    dbi_table => 'sessions',
49    dbi_dsn => 'noo',
50};
51
52
53# Start the application
54__PACKAGE__->setup;
55
56# This is after because db config is in config file
57__PACKAGE__->config->{session}{dbi_dsn} = 'dbi:Pg:' . __PACKAGE__->config->{db};
58
59
60=head1 NAME
61
62Vote - Catalyst based application
63
64=head1 SYNOPSIS
65
66    script/vote_server.pl
67
68=head1 DESCRIPTION
69
70[enter your description here]
71
72=head1 SEE ALSO
73
74L<Vote::Controller::Root>, L<Catalyst>
75
76=head1 AUTHOR
77
78Thauvin Olivier
79
80=head1 LICENSE
81
82This library is free software, you can redistribute it and/or modify
83it under the same terms as Perl itself or CeCILL.
84
85=cut
86
871;
Note: See TracBrowser for help on using the repository browser.