Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 3.10 KB | None | 0 0
  1. package AVC;
  2. use Moose;
  3. use namespace::autoclean;
  4.  
  5. use Catalyst::Runtime 5.80;
  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.  
  15. # Other Plugins:
  16. #   Cache
  17. #   Email
  18.  
  19. use HTML::FormFu::Preload;
  20.  
  21. use Catalyst
  22.     qw/
  23.     -Debug
  24.     +CatalystX::Debug::RequestHeaders
  25.     +CatalystX::Debug::ResponseHeaders
  26.     StackTrace
  27.    
  28.     Static::Simple
  29.    
  30.     Authentication
  31.     Authorization::Roles
  32.    
  33.     Session
  34.     Session::Store::FastMmap
  35.     Session::State::Cookie
  36.    
  37.     +AVC::CatalystPlugs
  38. /;
  39.  
  40. extends 'Catalyst';
  41.  
  42. our $VERSION = '0.01';
  43. $VERSION = eval $VERSION;
  44.  
  45. # Configure the application.
  46.  
  47. __PACKAGE__->config(
  48.     name => 'AVC',
  49.     # Disable deprecated behavior needed by old applications
  50.     disable_component_resolution_regex_fallback => 1,
  51.     session => { flash_to_stash => 1 },
  52.     default_view => 'TT',
  53.     default_model => 'DB',
  54.    
  55.     'Controller::HTML::FormFu' => {
  56.         constructor => { render_method => 'tt' },
  57.     },
  58.    
  59.     'Plugin::Authentication' => {
  60.         default => {
  61.             store => {
  62.                 class => 'DBIx::Class',
  63.                 role_relation => 'roles',
  64.                 role_field => 'role',
  65.                 use_userdata_from_session => '1',
  66.                 user_model      => 'DB::User',
  67.             },
  68.             credential => {
  69.                 #class           => 'YubiKey',
  70.                 #api_id          => '****',
  71.                 #api_key         => '*****',
  72.                 #id_for_store    => 'ykid',
  73.                 class               => 'Password',
  74.                 password_type       => 'self_check',
  75.             },
  76.         },
  77.     },
  78.    
  79.     'Model::DB' => {
  80.         connect_info => {
  81.             #dsn => 'dbi:SQLite:dbname=test.db',
  82.             dsn => 'dbi:Pg:host=*****;dbname=*****',
  83.             user => '***',
  84.             password => '***',
  85.             AutoCommit => q{1},
  86.             name_sep => q{.},
  87.             quote_char => q{"},
  88.            #on_connect_do => q{PRAGMA foreign_keys = ON},
  89.            #on_connect_call => 'use_foreign_keys',
  90.        }
  91.    },
  92.    
  93.    "Plugin::StackTrace" => {
  94.        enable => 1,
  95.        reverse => 1,
  96.        verbose => 2,
  97.    },
  98.    
  99.    #"Plugin::Scheduler" => {
  100.    #    logging => 1,
  101.    #    time_zone => 'America/Chicago',
  102.    #},
  103. );
  104.  
  105. # Start the application
  106. __PACKAGE__->setup();
  107.  
  108.  
  109. =head1 NAME
  110.  
  111. AVC - A Catalyst based AV equipment rental system.
  112.  
  113. =head1 SYNOPSIS
  114.  
  115.    To start the development/testing server, run:
  116.      perl script/avc_server.pl
  117.  
  118. =head1 DESCRIPTION
  119.  
  120. [enter your description here]
  121.  
  122. =head1 SEE ALSO
  123.  
  124. L<AVC::Controller::Root>, L<Catalyst>
  125.  
  126. =head1 AUTHOR
  127.  
  128. Matt Sickler
  129.  
  130. =head1 LICENSE
  131.  
  132. This library is free software. You can redistribute it and/or modify
  133. it under the same terms as Perl itself.
  134.  
  135. =cut
  136.  
  137. 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement