- Timestamp:
- 10/07/08 15:48:46 (3 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Method-Cached/trunk/lib/Method/Cached/Domain.pm
r20615 r20895 14 14 15 15 __PACKAGE__->mk_classaccessor('storage'); 16 __PACKAGE__->mk_classaccessor('key_r egularizer' => 'LIST');16 __PACKAGE__->mk_classaccessor('key_rule' => 'LIST'); 17 17 18 18 sub new { … … 20 20 my %args = (0 < @_ && ref $_[0] eq 'HASH') ? %{ $_[0] } : @_; 21 21 my $self = bless {}, $class; 22 my $storage_class = $args{storage_class}|| croak 'storage_class is necessary';23 my $storage_args = $args{storage_args}|| undef;24 my $key_r egularizer = $args{key_regularizer}|| undef;22 my $storage_class = $args{storage_class} || croak 'storage_class is necessary'; 23 my $storage_args = $args{storage_args} || undef; 24 my $key_rule = $args{key_rule} || undef; 25 25 if (blessed $storage_class) { 26 26 $self->storage($storage_class); … … 35 35 $self->storage($storage_class->new(@{ $storage_args || [] })); 36 36 } 37 $self->key_r egularizer($key_regularizer) if $key_regularizer;37 $self->key_rule($key_rule) if $key_rule; 38 38 $self; 39 39 } … … 43 43 my $registry = Method::Cached::MethodRegistry::refer($name); 44 44 Method::Cached::KeyRegularizer->regularize( 45 $registry->{key_r egularizer} || $self->key_regularizer|| undef,45 $registry->{key_rule} || $self->key_rule || undef, 46 46 $name, 47 47 @args, … … 82 82 my $domain = Method::Cached::Domain->new( 83 83 # The supported interface is Cache::Cache and Cache::Memcached. 84 storage_class => 'Cache::Memcached::Fast',85 storage_args => [84 storage_class => 'Cache::Memcached::Fast', 85 storage_args => [ 86 86 { 87 87 servers => [qw/ 127.0.0.1:11211 /], … … 91 91 }, 92 92 ], 93 key_r egularizer=> undef,93 key_rule => undef, 94 94 ); 95 95
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)