X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FSQLHelper.pm;h=21f5fa179b0799f05f3fe6f8cea79e1f80897d0e;hb=548845eceec03a727c1923d7fdd720b06ac7567f;hp=41c5a9f5c19f7c97e796c63d1b9ef3002c8c1074;hpb=5900dfff9a455bbb60b33919faa9299843c42fd3;p=koha_fer diff --git a/C4/SQLHelper.pm b/C4/SQLHelper.pm index 41c5a9f5c1..21f5fa179b 100644 --- a/C4/SQLHelper.pm +++ b/C4/SQLHelper.pm @@ -34,18 +34,19 @@ eval { import Memoize::Memcached qw(memoize_memcached); my $memcached = { - servers => [$servers], - key_prefix => C4::Context->config('memcached_namespace') || 'koha', - }; + servers => [$servers], + key_prefix => C4::Context->config('memcached_namespace') || 'koha', + expire_time => 600 + }; # cache for 10 mins - memoize_memcached( '_get_columns', memcached => $memcached, expire_time => 600000 ); #cache for 10 minutes - memoize_memcached( 'GetPrimaryKeys', memcached => $memcached, expire_time => 600000 ); #cache for 10 minutes + memoize_memcached( '_get_columns', memcached => $memcached ); + memoize_memcached( 'GetPrimaryKeys', memcached => $memcached ); } }; BEGIN { # set the version for version checking - $VERSION = 0.5; + $VERSION = 3.07.00.049; require Exporter; @ISA = qw(Exporter); @EXPORT_OK=qw( @@ -247,7 +248,7 @@ Get the Primary Key field names of the table =cut -sub GetPrimaryKeys($) { +sub GetPrimaryKeys { my $tablename=shift; my $hash_columns=_get_columns($tablename); return grep { $hash_columns->{$_}->{'Key'} =~/PRI/i} keys %$hash_columns; @@ -283,7 +284,7 @@ With =cut -sub _get_columns($) { +sub _get_columns { my ($tablename) = @_; unless ( exists( $hashref->{$tablename} ) ) { my $dbh = C4::Context->dbh; @@ -313,7 +314,7 @@ If it is not for research purpose, filter primary keys =cut -sub _filter_columns ($$;$) { +sub _filter_columns { my ($tablename,$research, $filtercolumns)=@_; if ($filtercolumns){ return (@$filtercolumns);