replaced return; with return undef;
This commit is contained in:
parent
ffa90c5fbd
commit
fa09c41598
113 changed files with 287 additions and 286 deletions
|
|
@ -94,7 +94,7 @@ Retrieve content from the filesystem cache.
|
|||
|
||||
sub get {
|
||||
my $self = shift;
|
||||
return if ($self->session->config->get("disableCache"));
|
||||
return undef if ($self->session->config->get("disableCache"));
|
||||
# getting better performance using native dbi than webgui sql
|
||||
my $dbh = $self->session->db->dbh;
|
||||
my $sth = $dbh->prepare("select content from cache where namespace=? and cachekey=? and expires>?");
|
||||
|
|
@ -102,7 +102,7 @@ sub get {
|
|||
my $data = $sth->fetchrow_arrayref;
|
||||
$sth->finish;
|
||||
my $content = $data->[0];
|
||||
return unless ($content);
|
||||
return undef unless ($content);
|
||||
# Storable doesn't like non-reference arguments, so we wrap it in a scalar ref.
|
||||
return ${thaw($content)};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,12 +105,12 @@ Retrieve content from the filesystem cache.
|
|||
|
||||
sub get {
|
||||
my $self = shift;
|
||||
return if ($self->session->config->get("disableCache"));
|
||||
return undef if ($self->session->config->get("disableCache"));
|
||||
my $folder = $self->getFolder;
|
||||
if (-e $folder."/expires" && -e $folder."/cache" && open(my $FILE,"<",$folder."/expires")) {
|
||||
my $expires = <$FILE>;
|
||||
close($FILE);
|
||||
return if ($expires < $self->session->datetime->time());
|
||||
return undef if ($expires < $self->session->datetime->time());
|
||||
my $value;
|
||||
eval {$value = retrieve($folder."/cache")};
|
||||
if (ref $value eq "SCALAR") {
|
||||
|
|
@ -119,7 +119,7 @@ sub get {
|
|||
return $value;
|
||||
}
|
||||
}
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -171,7 +171,7 @@ sub getNamespaceSize {
|
|||
my $expiresModifier = shift || 0;
|
||||
$self->session->stow->set("cacheSize", 0);
|
||||
File::Find::find({no_chdir=>1, wanted=> sub {
|
||||
return unless $File::Find::name =~ m/^(.*)expires$/;
|
||||
return undef unless $File::Find::name =~ m/^(.*)expires$/;
|
||||
my $dir = $1;
|
||||
if (open(my $FILE,"<",$dir."/expires")) {
|
||||
my $expires = <$FILE>;
|
||||
|
|
@ -244,7 +244,7 @@ sub set {
|
|||
eval {mkpath($path,0)};
|
||||
if ($@) {
|
||||
$self->session->errorHandler->error("Couldn't create cache folder: ".$path." : ".$@);
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
my $value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue