Let CHI modules other than just DBI get their hands on dbh and perhaps other things in the future;

add an "args" : [ "dbh" ] entry to the "cache" : { } config block
This commit is contained in:
Scott Walters 2011-03-10 20:06:41 -05:00
parent ee40a71770
commit 1942ccc9b6
2 changed files with 8 additions and 1 deletions

View file

@ -6,6 +6,7 @@
- added: LastModifiedBy macro
- added: Group Manager form control
- fixed #12050: Thing query caching #1
- added: Let CHI cache request $dbh via an "args" : [ "dbh" ] cache conf
7.10.11
- fixed #12057: WebGUI::Search, assetIds search clause

View file

@ -99,7 +99,13 @@ sub new {
# Default values
my $resolveConf = sub {
my ($config) = @_;
if ( $config->{driver} =~ /DBI/ ) {
if (
$config->{driver} =~ /DBI/ or (
$config->{args} and # "args" : [ "dbh" ] in the "cache": { } block?
ref $config->{args} eq 'ARRAY' and
grep($_ eq 'dbh', @{ $config->{args} })
)
) {
$config->{ dbh } = $session->db->dbh;
}
if ( $config->{driver} =~ /File|FastMmap|BerkeleyDB/ ) {