Skip to content

Commit

Permalink
Item12892: simplify the store inheritance hierarcchy setup
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@17663 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed May 8, 2014
1 parent bd3d4a1 commit 8c86d57
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
30 changes: 9 additions & 21 deletions core/lib/Foswiki.pm
Expand Up @@ -1860,31 +1860,19 @@ sub new {

load_package($base);

if ( ( $Foswiki::cfg{Store}{ImplementationClasses}{Enabled} ) ) {

#TODO: sort it.
my @classes =
sort {
$Foswiki::cfg{Store}{ImplementationClasses}{$a}
<=> $Foswiki::cfg{Store}{ImplementationClasses}{$b}
} keys( %{ $Foswiki::cfg{Store}{ImplementationClasses} } );
foreach my $class ( @{ $Foswiki::cfg{Store}{ImplementationClasses} } ) {

# this allows us to add an arbitary set of mixins for things
# like recordChanges
my $length = scalar(@classes);
if ($length) {

#rejig the store impl's ISA to usse each Class in order.'
foreach my $class (@classes) {
next if ( $class eq 'Enabled' );
load_package($class);
no strict 'refs';
@{ $class . '::ISA' } = ($base);
use strict 'refs';
$base = $class;
}
}

# Rejig the store impl's ISA to use each Class in order.'
load_package($class);
no strict 'refs';
@{ $class . '::ISA' } = ($base);
use strict 'refs';
$base = $class;
}

$this->{store} = $base->new();
ASSERT( $this->{store}, "no $base object created" ) if DEBUG;

Expand Down
16 changes: 8 additions & 8 deletions core/lib/Foswiki.spec
Expand Up @@ -1322,18 +1322,18 @@ $Foswiki::cfg{PluralToSingular} = $TRUE;
#############################################################################
#---+ Store -- TABS
#---++ Store Implementation
# <p>Foswiki supports different back-end store implementations.</p>
# Foswiki supports different back-end store implementations.
# **SELECTCLASS Foswiki::Store::* **
# Store implementation.
$Foswiki::cfg{Store}{Implementation} = '';
# **BOOLEAN EXPERT**
# enabling this will allow customisation of the Foswiki Store implementation selected
# above.
# If any customisations are installed, you will see a list of full class names of classes
# that can selectivly overide the store. Each key will the full Class name, and its value
# will determine its order. Zero means disabled.
$Foswiki::cfg{Store}{ImplementationClasses}{Enabled} = $TRUE;
# **PERL EXPERT**
# Customisation of the Foswiki Store implementation selected above. This allows
# extension modules to hook into the store implementation at a very low level.
# Full class names of customisations must be added to the list, in the order in
# which they will appear in the inheritance hierarchy of the final store
# implementation.
$Foswiki::cfg{Store}{ImplementationClasses} = [];
# **BOOLEAN EXPERT**
# Set to enable (hierarchical) sub-webs. Without this setting, Foswiki will only
Expand Down

0 comments on commit 8c86d57

Please sign in to comment.