source: server/trunk/web/lib/Sophie.pm @ 35

Last change on this file since 35 was 35, checked in by nanardon, 14 years ago
  • add pre work for bot
File size: 2.4 KB
Line 
1package Sophie;
2use Moose;
3use namespace::autoclean;
4use Catalyst::Runtime 5.80;
5use Sophie::Base;
6
7# Set flags and add plugins for the application
8#
9#         -Debug: activates the debug mode for very useful log messages
10#   ConfigLoader: will load the configuration from a Config::General file in the
11#                 application's home directory
12# Static::Simple: will serve static files from the application's root
13#                 directory
14
15use Catalyst qw/
16    ConfigLoader
17    Static::Simple
18    Session
19    Session::Store::DBI
20    Session::State::Cookie
21    Compress::Zlib
22    Server
23    Server::XMLRPC
24    Authentication
25/;
26
27use RPC::XML;
28$RPC::XML::FORCE_STRING_ENCODING = 1;
29
30extends 'Catalyst';
31
32our $VERSION = '0.01';
33$VERSION = eval $VERSION;
34
35# Configure the application.
36#
37# Note that settings in sophie.conf (or other external
38# configuration file that you set up manually) take precedence
39# over this when using ConfigLoader. Thus configuration
40# details given here can function as a default configuration,
41# with an external configuration file acting as an override for
42# local deployment.
43
44__PACKAGE__->config(
45    name => 'Sophie',
46    # Disable deprecated behavior needed by old applications
47    disable_component_resolution_regex_fallback => 1,
48    default_view => 'TT',
49    xmlrpc => {
50        xml_encoding => 'UTF-8',
51    },
52
53    'authentication' => {
54        default_realm => 'members',
55        realms => {
56            members => {
57                credential => {
58                    class => 'Password',
59                    password_field => 'password',
60                    password_type => 'crypted'
61                },
62                store => {
63                    class => 'DBIx::Class',
64                    user_model => 'Base::Users',
65                    role_relation => 'UsersRoles',
66                    role_field => 'rolename',
67                    id_field => 'mail',
68                },
69            },
70        },
71    },
72);
73
74__PACKAGE__->config->{session} = {
75    expires   => 3600,
76    dbi_dbh   => 'Base',
77    dbi_table => 'sessions',
78};
79
80# Start the application
81__PACKAGE__->setup();
82
83=head1 NAME
84
85Sophie - Catalyst based application
86
87=head1 SYNOPSIS
88
89    script/sophie_server.pl
90
91=head1 DESCRIPTION
92
93[enter your description here]
94
95=head1 SEE ALSO
96
97L<Sophie::Controller::Root>, L<Catalyst>
98
99=head1 AUTHOR
100
101Olivier Thauvin
102
103=head1 LICENSE
104
105This library is free software. You can redistribute it and/or modify
106it under the same terms as Perl itself.
107
108=cut
109
1101;
Note: See TracBrowser for help on using the repository browser.