have the UI use full country names, and state names outside the US...
[freeside.git] / FS / FS / ClientAPI_SessionCache.pm
1 package FS::ClientAPI_SessionCache;
2
3 use strict;
4 use vars qw($module);
5 use FS::UID qw(datasrc);
6
7 #ask FS::UID to run this stuff for us later
8 install_callback FS::UID sub { 
9   my $conf = new FS::Conf;
10   $module = $conf->config('selfservice_server-cache_module')
11             || 'Cache::SharedMemoryCache';
12 };
13
14 =head1 NAME
15
16 FS::ClientAPI_SessionCache;
17
18 =head1 SYNOPSIS
19
20 =head1 DESCRIPTION
21
22 Minimal Cache::Cache-alike interface for storing session cache information.
23 Backends to Cache::SharedMemoryCache, Cache::FileCache, or an internal
24 implementation which stores information in the clientapi_session and
25 clientapi_session_field database tables.
26
27 =head1 METHODS
28
29 =over 4
30
31 =item new
32
33 =cut
34
35 sub new {
36   my $proto = shift;
37   my $class = ref($proto) || $proto;
38   unless ( $module =~ /^_Database$/ ) {
39     eval "use $module;";
40     die $@ if $@;
41     my $self = $module->new(@_);
42     $self->set_cache_root('/usr/local/etc/freeside/clientapi_session.'.datasrc)
43       if $module =~ /^Cache::FileCache$/;
44     $self;
45   } else {
46     my $self = shift;
47     bless ($self, $class);
48   }
49 }
50
51 sub get {
52   my($self, $session_id) = @_;
53   die '_Database self-service session cache not yet implemented';
54 }
55
56 sub set {
57   my($self, $session_id, $session, $expiration) = @_;
58   die '_Database self-service session cache not yet implemented';
59 }
60
61 sub remove {
62   my($self, $session_id) = @_;
63   die '_Database self-service session cache not yet implemented';
64 }
65
66 =back
67
68 =head1 BUGS
69
70 Minimal documentation.
71
72 =head1 SEE ALSO
73
74 L<Cache::Cache>, L<FS::clientapi_session>, L<FS::clientapi_session_field>
75
76 =cut
77
78 1;