|
From: Chris W. <la...@us...> - 2001-11-02 17:58:33
|
Update of /cvsroot/openinteract/OpenInteract/conf
In directory usw-pr-cvs1:/tmp/cvs-serv12046
Modified Files:
sample-Stash.pm
Log Message:
small changes
Index: sample-Stash.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/conf/sample-Stash.pm,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** sample-Stash.pm 2001/02/02 06:18:34 1.1.1.1
--- sample-Stash.pm 2001/11/02 17:58:30 1.2
***************
*** 1,4 ****
--- 1,6 ----
package OpenInteract::SampleStash;
+ # $Id$
+
use strict;
***************
*** 6,38 ****
$OpenInteract::SampleStash::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
! my $DEBUG = 1;
my %ITEMS = ();
# Specify the items that will survive the purge by clean_stash(),
# which is typically called at the end of every request.
- my %KEEP = ( cache => 1, 'ipc-cache' => 1, config => 1,
- template_object => 1, error_handlers => 1 );
! sub get_stash {
! my $class = shift;
! my $item = shift;
! return $ITEMS{ lc $item };
! }
! sub set_stash {
! my $class = shift;
! my $item = shift;
! my $obj = shift;
! return $ITEMS{ lc $item } = $obj;
! }
sub clean_stash {
! my $class = shift;
! foreach my $item ( keys %ITEMS ) {
! next if $KEEP{ $item };
! delete $ITEMS{ $item };
! }
}
!
1;
--- 8,31 ----
$OpenInteract::SampleStash::VERSION = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
! # This is where we do the stashing
!
my %ITEMS = ();
# Specify the items that will survive the purge by clean_stash(),
# which is typically called at the end of every request.
! my %KEEP = map { $_ => 1 }
! qw( cache ipc-cache config template_object error_handlers );
! sub get_stash { return $ITEMS{ lc $_[1] } }
!
! sub set_stash { return $ITEMS{ lc $_[1] } = $_[2] }
sub clean_stash {
! foreach my $item ( keys %ITEMS ) {
! delete $ITEMS{ $item } unless ( $KEEP{ $item } );
! }
}
!
1;
***************
*** 41,46 ****
=head1 NAME
! OpenInteract::SampleStash - Default stash class and an example of what
! one looks like
=head1 SYNOPSIS
--- 34,38 ----
=head1 NAME
! OpenInteract::SampleStash - Default stash class and an example of what one looks like
=head1 SYNOPSIS
***************
*** 51,54 ****
--- 43,49 ----
=head1 DESCRIPTION
+
+ Note: This class template is used when generating a new website via
+ 'oi_manage' and is not meant to be used directly.
The existence of the 'stash class' is necessitated by the fact that we
|