source: trunk/lib/Epoll.pm @ 442

Last change on this file since 442 was 281, checked in by nanardon, 14 years ago
  • minor fix
File size: 1.9 KB
Line 
1package Epoll;
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    Prototype
24    I18N
25    /;
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 => 'Epoll' );
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    'Plugin::I18N' => {
47        maketext_options => {
48            Decode => 0
49        },
50    }
51);
52
53__PACKAGE__->config->{session} = {
54    expires   => 3600 * 24 * 60,
55    dbi_table => 'sessions',
56    dbi_dsn => 'noo',
57};
58
59
60# Start the application
61__PACKAGE__->setup;
62
63# This is after because db config is in config file
64__PACKAGE__->config->{session}{dbi_dsn} = 'dbi:Pg:' . __PACKAGE__->config->{db};
65
66=head1 NAME
67
68Vote - Catalyst based application
69
70=head1 SYNOPSIS
71
72    script/vote_server.pl
73
74=head1 DESCRIPTION
75
76[enter your description here]
77
78=head1 SEE ALSO
79
80L<Vote::Controller::Root>, L<Catalyst>
81
82=head1 AUTHOR
83
84Thauvin Olivier
85
86=head1 LICENSE
87
88This library is free software, you can redistribute it and/or modify
89it under the same terms as Perl itself or CeCILL.
90
91=cut
92
931;
Note: See TracBrowser for help on using the repository browser.