Created
October 7, 2010 01:17
-
-
Save jjn1056/614390 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
package MyApp::Request::PSGI; | |
use strict; | |
use base qw(HTML::Mason::Request::PSGI); | |
sub session { | |
my $self = shift; | |
$self->cgi_request->query->env->{'psgix.session'}; | |
} | |
} | |
my @extra_comp_roots; | |
my $h = HTML::Mason::PSGIHandler->new( | |
comp_root => [ | |
[ dev_main => "/net/vfs/data/export/www/sites/$SANDBOX/$SITE" ], | |
[ dev_aux => "/net/vfs/data/export/www/sites/$SANDBOX/$SITE/comps" ], | |
[ dev_admin => "/net/vfs/data/export/www/sites/$SANDBOX/$SITE/78625/comps" ], # a special case | |
@extra_comp_roots, | |
[ dev_shared => "/net/vfs/data/export/www/sites/$SANDBOX/shared" ], | |
[ main => "/net/vfs/data/export/www/sites/integration/$SITE" ], | |
[ aux => "/net/vfs/data/export/www/sites/integration/$SITE/comps" ], | |
[ admin => "/net/vfs/data/export/www/sites/integration/admin/78625/comps" ], # a special case | |
[ shared => "/net/vfs/data/export/www/sites/integration/shared" ], | |
], | |
data_dir => "/home/$SANDBOX/var/$SITE", | |
error_mode => 'output', | |
dynamic_comp_root => 1, | |
request_class => 'MyApp::Request::PSGI', | |
#request_class => 'MasonX::Request::WithApacheSession', | |
#session_class => 'Apache::Session::Memcached', | |
#session_servers => $session_servers, | |
#session_use_cookie => 1, | |
#session_cookie_expires => '+30d', | |
#session_cookie_name => $per_site_conf->{ lc $SITE }->{session_cookie_name}, | |
#session_cookie_domain => '.XXXXXX.com', | |
allow_globals => [qw($dbh $sdbh $lightbox_dbh $download_codes_dbh $language $site)], | |
); | |
my $app = sub { | |
my $env = shift; | |
$h->handle_psgi($env); | |
}; | |
builder { | |
enable 'Session'; | |
$app; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment