removed the need for Data::Serializer

This commit is contained in:
JT Smith 2004-06-08 18:37:11 +00:00
parent 88b421853c
commit 6613992f3d
6 changed files with 4 additions and 48 deletions

View file

@ -22,7 +22,6 @@ use HTTP::Request;
use LWP::UserAgent;
use WebGUI::ErrorHandler;
use WebGUI::Session;
use Data::Serializer;
=head1 NAME
@ -97,20 +96,6 @@ sub get {
#-------------------------------------------------------------------
=head2 getDataStructure ( )
Retrieves an datastructure from the filesystem cache.
=cut
sub getDataStructure {
my ($serializer);
$serializer = Data::Serializer->new(serializer => 'Storable');
return $serializer->deserialize($_[0]->{_cache}->get($_[0]->{_key}));
}
#-------------------------------------------------------------------
=head2 new ( key [, namespace ] )
Constructor.
@ -164,35 +149,6 @@ sub set {
$_[0]->{_cache}->set($_[0]->{_key},$_[1],$ttl);
}
#-------------------------------------------------------------------
=head2 setDataStructure ( content [, ttl ] )
Saves a (complex) datastructure to the filesystem cache. This is the way to go is you want to cache
something other then a scalar. You can put any hash, array or object in here. You can also cache a scalar
with this method but if you only need to cache a scalar, though, it's better to use set because set saves
diskspace, memory and processing time.
=over
=item content
A reference to whatever data structure you want to cache.
=item ttl
The time to live for this data structure. This is the amount of time (in seconds) that the structure will remain
in the cache. Defaults to "60".
=back
=cut
sub setDataStructure {
my $ttl = $_[2] || 60;
$serializer = Data::Serializer->new(serializer => 'Storable');
$_[0]->{_cache}->set($_[0]->{_key},$serializer->serialize($_[1]),$ttl);
}
#-------------------------------------------------------------------

View file

@ -28,7 +28,6 @@ use WebGUI::SQL;
use WebGUI::Template;
use WebGUI::Utility;
use WebGUI::DateTime;
use Data::Serializer;
our @ISA = qw(WebGUI::Persistent::Tree);