/[A3C]/lib/A3C/Cache.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/A3C/Cache.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 226 by dpavlin, Sun Jun 22 14:41:23 2008 UTC revision 227 by dpavlin, Fri Jun 27 17:53:30 2008 UTC
# Line 4  use strict; Line 4  use strict;
4  use warnings;  use warnings;
5    
6  use base qw(Jifty::Object Class::Accessor::Fast);  use base qw(Jifty::Object Class::Accessor::Fast);
7  __PACKAGE__->mk_accessors( qw(instance) );  __PACKAGE__->mk_accessors( qw(instance dir) );
8  use File::Slurp;  use File::Slurp;
9  use JSON::XS;  use JSON::XS;
10  use Carp qw/confess/;  use Carp qw/confess/;
# Line 23  B<Doesn't expire any file by itself!> Line 23  B<Doesn't expire any file by itself!>
23    
24  =head2 new  =head2 new
25    
26    my $cache = A3C::Cache->new({ instance => 'foobar' });    my $cache = A3C::Cache->new({ instance => 'foobar', dir => 'strix' });
27    
28  =head2 cache_path  =head2 cache_path
29    
# Line 40  sub cache_path { Line 40  sub cache_path {
40    
41          #warn "# cache_path",dump( @_ );          #warn "# cache_path",dump( @_ );
42    
43          my $path = Jifty::Util->absolute_path( 'var/strix' );          my $dir = $self->dir || 'strix';
44    
45            my $path = Jifty::Util->absolute_path( "var/$dir" );
46    
47          if ( ! -e $path ) {          if ( ! -e $path ) {
48                  mkdir $path || die "can't create $path: $!";                  mkdir $path || die "can't create $path: $!";

Legend:
Removed from v.226  
changed lines
  Added in v.227

  ViewVC Help
Powered by ViewVC 1.1.26