source: trunk/lib/Epoll.pm @ 259

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