Apache-Session-MongoDB
view release on metacpan or search on metacpan
with the major components (compiler, kernel, and so on) of the operating system
on which the executable runs, unless that component itself accompanies the
executable.
If distribution of executable or object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the source
code from the same place counts as distribution of the source code, even though
third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as
expressly provided under this License. Any attempt otherwise to copy, modify,
sublicense or distribute the Program is void, and will automatically terminate
your rights under this License. However, parties who have received copies, or
rights, from you under this License will not have their licenses terminated so long
as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it.
However, nothing else grants you permission to modify or distribute the Program
or its derivative works. These actions are prohibited by law if you do not accept
this License. Therefore, by modifying or distributing the Program (or any work
based on the Program), you indicate your acceptance of this License to do so,
lib/Apache/Session/MongoDB.pm view on Meta::CPAN
}
sub _col {
my ( $self, $args ) = @_;
my $conn_args;
foreach my $w (
qw(host auth_mechanism auth_mechanism_properties bson_codec
connect_timeout_ms db_name heartbeat_frequency_ms j local_threshold_ms
max_time_ms password port read_pref_mode read_pref_tag_sets
replica_set_name server_selection_timeout_ms server_selection_try_once
socket_check_interval_ms socket_timeout_ms ssl username w wtimeout
read_concern_level)
)
{
$conn_args->{$w} = $args->{$w} || $default->{$w};
delete $conn_args->{$w} unless ( defined $conn_args->{$w} );
}
my $s = MongoDB->connect( $args->{host} || $default->{host}, $conn_args )
or die('Unable to connect to MongoDB server');
return $s->get_database( $args->{db_name} || $default->{db_name} )
->get_collection( $args->{collection} || $default->{collection} );
lib/Apache/Session/MongoDB.pm view on Meta::CPAN
};
=head1 DESCRIPTION
This module is an implementation of Apache::Session. It uses the MongoDB
backing store and no locking.
=head1 PARAMETERS
You can set the followong parameters host, db_name, collection, auth_mechanism,
auth_mechanism_properties, connect_timeout_ms, ssl, username and password.
See L<MongoDB> for more
=head1 SEE ALSO
L<MongoDB>, L<Apache::Session>
=head1 AUTHOR
Xavier Guimard, E<lt>x.guimard@free.frE<gt>
lib/Apache/Session/Store/MongoDB.pm view on Meta::CPAN
sub connection {
my ( $self, $session ) = splice @_;
return
if ( defined $self->{collection} );
my $conn_args;
foreach my $w (
qw(host auth_mechanism auth_mechanism_properties bson_codec
connect_timeout_ms db_name heartbeat_frequency_ms j local_threshold_ms
max_time_ms password port read_pref_mode read_pref_tag_sets
replica_set_name server_selection_timeout_ms server_selection_try_once
socket_check_interval_ms socket_timeout_ms ssl username w wtimeout
read_concern_level)
)
{
$conn_args->{$w} = $session->{args}->{$w} || $default->{$w};
delete $conn_args->{$w} unless ( defined $conn_args->{$w} );
}
my $s =
MongoDB->connect( $session->{args}->{host} || $default->{host},
$conn_args )
or die('Unable to connect to MongoDB server');
( run in 0.648 second using v1.01-cache-2.11-cpan-acf6aa7dc9e )