1 package LJ
::LocalCache
;
10 # LJ::LocalCache::get_cache()->set("ml.${lncode}.${dmid}.${itcode}", $text, 30*60);
14 my @SUBCLASSES = LJ
::ModuleLoader
->module_subclasses(__PACKAGE__
);
28 if (LJ
::is_enabled
("local_cache")) {
29 %modules_info = map { $_ => NOT_LOADED
} @SUBCLASSES;
34 # this function will disable a module from using
35 # even it is already loaded
36 sub __critical_error
{
38 $modules_info{$module} = CRITICAL_ERROR
;
43 my $status = $modules_info{$module};
45 return "LJ::LocalCache::$module" if $status == LOAD_SUCCESSFUL
;
46 return 'LJ::LocalCache' if $status == LOAD_FAILED
||
47 $status == CRITICAL_ERROR
;
53 $modules_info{$module} = LOAD_FAILED
;
54 return 'LJ::LocalCache';
62 $handler ||= $LJ::LOCAL_CACHE_DEFAULT_HANDLER
;
64 return 'LJ::LocalCache' if !LJ
::is_enabled
("local_cache");
66 return __get_package
("LJ::LocalCache::$handler");
70 my ($class, $key, $expire) = @_;
75 my ($class, $key) = @_;
80 my ($class, $keys, $not_fetched_keys) = @_;
81 @
$not_fetched_keys = @
$keys;
86 my ($class, $key, $value, $expire) = @_;
91 my ($class, $key, $value, $expire) = @_;
96 my ($class, $key) = @_;
101 my ($class, $key, $value) = @_;
106 my ($class, $key, $value) = @_;
111 my ($class, $key) = @_;
116 my ($class, $key, $value) = @_;
121 my ($class, $key, $value) = @_;
126 my ($class, $key) = @_;
131 my ($class, $key) = @_;