/usr/share/perl5/Mason/Plugin/Cache/Component.pm is in libmason-plugin-cache-perl 0.05-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | package Mason::Plugin::Cache::Component;
BEGIN {
$Mason::Plugin::Cache::Component::VERSION = '0.05';
}
use Mason::PluginRole;
my %memoized;
method cache_memoized ($class:) {
$class = ref($class) || $class;
if (@_) { $memoized{$class} = $_[0] }
return $memoized{$class};
}
method cache_defaults ($class:) { $class->cmeta->interp->cache_defaults }
method cache_root_class ($class:) { $class->cmeta->interp->cache_root_class }
method cache_namespace ($class:) { $class->cmeta->path }
method cache ($class:) {
if ( !@_ && $class->cache_memoized ) {
return $class->cache_memoized;
}
my $cache_root_class = $class->cache_root_class;
my %options = ( %{ $class->cache_defaults }, @_ );
if ( !exists( $options{namespace} ) ) {
$options{namespace} = $class->cache_namespace;
}
my $cache = $cache_root_class->new(%options);
if ( !@_ ) {
$class->cache_memoized($cache);
}
return $cache;
}
1;
|