Commit info for scoop/lib/Scoop:
Modified Files:
Interface.pm
Log Message:
Macro changes to the core files. -- hulver
Index: Interface.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Interface.pm,v
retrieving revision 1.54
retrieving revision 1.55
diff -r1.54 -r1.55
90a91,121
> sub get_macros {
> # cloned from get_vars above.
>
> my $S = shift;
> my $time = time();
>
> if (my $cached = $S->cache->fetch_data({resource => 'macros',
> element => 'MACROS'})) {
> return %{$cached};
> }
>
> my ($rv, $sth) = $S->db_select({
> WHAT => '*',
> FROM => 'macros'});
>
> my $macros;
> if ($rv) {
> while (my $macro_record = $sth->fetchrow_hashref) {
> $macros->{$macro_record->{name}} = $macro_record->{value};
> }
> }
> $sth->finish();
>
> $S->cache->cache_data({resource => 'macros',
> element => 'MACROS',
> data => $macros});
>
> # Return value, not reference so that our changes won't infect the global cache
> return %{$macros};
> }
>