X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB.pm;h=f90a9c6371a72710287499afbbe3c12384d2abd6;hb=3a94f4d2dd9a835d4a7007e1b999ea00b3c4e1cd;hp=b48a49e70bb4a708775a35487f4fe4da28ff42d3;hpb=ea502a0bc9fddc65bd56bd49255b28cf36050796;p=kivitendo-erp.git diff --git a/SL/DB.pm b/SL/DB.pm index b48a49e70..f90a9c637 100644 --- a/SL/DB.pm +++ b/SL/DB.pm @@ -13,6 +13,22 @@ __PACKAGE__->use_private_registry; my (%_db_registered, %_initial_sql_executed); +sub dbi_connect { + shift; + + return DBI->connect(@_) unless $::lx_office_conf{debug} && $::lx_office_conf{debug}->{dbix_log4perl}; + + require Log::Log4perl; + require DBIx::Log4perl; + + my $filename = $LXDebug::file_name; + my $config = $::lx_office_conf{debug}->{dbix_log4perl_config}; + $config =~ s/LXDEBUGFILE/${filename}/g; + + Log::Log4perl->init(\$config); + return DBIx::Log4perl->connect(@_); +} + sub create { my $domain = shift || SL::DB->default_domain; my $type = shift || SL::DB->default_type;