1Apache::Session::BrowseUasbelre:C:oRnetdriisb(u3t)ed PerAlpaDcohceu:m:eSnetsastiioonn::Browseable::Redis(3)
2
3
4

NAME

6       Apache::Session::Browseable::Redis - Add index and search methods to
7       Apache::Session::Redis
8

SYNOPSIS

10         use Apache::Session::Browseable::Redis;
11
12         my $args = {
13              server => '127.0.0.1:6379',
14
15              # Choose your browseable fileds
16              Index          => 'uid mail',
17         };
18
19         # Use it like Apache::Session
20         my %session;
21         tie %session, 'Apache::Session::Browseable::Redis', $id, $args;
22         $session{uid} = 'me';
23         $session{mail} = 'me@me.com';
24         $session{unindexedField} = 'zz';
25         untie %session;
26
27         # Apache::Session::Browseable add some global class methods
28         #
29         # 1) search on a field (indexed or not)
30         my $hash = Apache::Session::Browseable::Redis->searchOn( $args, 'uid', 'me' );
31         foreach my $id (keys %$hash) {
32           print $id . ":" . $hash->{$id}->{mail} . "\n";
33         }
34
35         # 2) Parse all sessions
36         # a. get all sessions
37         my $hash = Apache::Session::Browseable::Redis->get_key_from_all_sessions();
38
39         # b. get some fields from all sessions
40         my $hash = Apache::Session::Browseable::Redis->get_key_from_all_sessions('uid', 'mail')
41
42         # c. execute something with datas from each session :
43         #    Example : get uid and mail if mail domain is
44         my $hash = Apache::Session::Browseable::Redis->get_key_from_all_sessions(
45                     sub {
46                        my ( $session, $id ) = @_;
47                        if ( $session->{mail} =~ /mydomain.com$/ ) {
48                            return { $session->{uid}, $session->{mail} };
49                        }
50                     }
51         );
52         foreach my $id (keys %$hash) {
53           print $id . ":" . $hash->{$id}->{uid} . "=>" . $hash->{$id}->{mail} . "\n";
54         }
55

DESCRIPTION

57       Apache::Session::browseable provides some class methods to manipulate
58       all sessions and add the capability to index some fields to make
59       research faster.
60
61       This module use either Redis::Fast or Redis.
62

SEE ALSO

64       Apache::Session
65

AUTHOR

67       Xavier Guimard, <x.guimard@free.fr>
68
70       Copyright (C) 2009-2018 by Xavier Guimard
71
72       This library is free software; you can redistribute it and/or modify it
73       under the same terms as Perl itself, either Perl version 5.10.1 or, at
74       your option, any later version of Perl 5 you may have available.
75
76
77
78perl v5.28.1                      2019-02-A0p8ache::Session::Browseable::Redis(3)
Impressum