source: trunk/lib/Vote.pm @ 129

Last change on this file since 129 was 129, checked in by nanardon, 15 years ago
  • 0.10
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
25our $VERSION = '0.10';
26
27# Configure the application.
28#
29# Note that settings in Vote.yml (or other external
30# configuration file that you set up manually) take precedence
31# over this when using ConfigLoader. Thus configuration
32# details given here can function as a default configuration,
33# with a external configuration file acting as an override for
34# local deployment.
35
36__PACKAGE__->config( name => 'Vote' );
37
38# Config file, in tree, else should be in /etc
39
40__PACKAGE__->config(
41    'Plugin::ConfigLoader' => {
42        file => -f __PACKAGE__->path_to('epoll.yml')
43            ? __PACKAGE__->path_to('epoll.yml')
44            : '/etc/epoll.yml',
45    }
46);
47
48__PACKAGE__->config->{session} = {
49    expires   => 1800,
50    dbi_table => 'sessions',
51    dbi_dsn => 'noo',
52};
53
54
55# Start the application
56__PACKAGE__->setup;
57
58# This is after because db config is in config file
59__PACKAGE__->config->{session}{dbi_dsn} = 'dbi:Pg:' . __PACKAGE__->config->{db};
60
61
62=head1 NAME
63
64Vote - Catalyst based application
65
66=head1 SYNOPSIS
67
68    script/vote_server.pl
69
70=head1 DESCRIPTION
71
72[enter your description here]
73
74=head1 SEE ALSO
75
76L<Vote::Controller::Root>, L<Catalyst>
77
78=head1 AUTHOR
79
80Thauvin Olivier
81
82=head1 LICENSE
83
84This library is free software, you can redistribute it and/or modify
85it under the same terms as Perl itself or CeCILL.
86
87=cut
88
891;
Note: See TracBrowser for help on using the repository browser.