4 dbh->{'private_profile'} = {} if UNIVERSAL::can(dbh, 'sprintProfile');
6 my $locale = $FS::CurrentUser::CurrentUser->option('locale')
7 || FS::Conf->new->config('locale')
10 $lh = FS::L10N->get_handle($locale) || die "Unknown locale $locale";
15 if ( UNIVERSAL::can(dbh, 'sprintProfile') ) {
19 if ( lc($r->content_type) =~ /^text\/html/
20 && $FS::CurrentUser::CurrentUser->option('show_db_profile')
24 ## barely worth it, just in case someone tries to use profiling on a
26 #eval "use Text::Wrapper;";
29 my $text = dbh->sprintProfile();
32 $profile = '<PRE>'. encode_entities( $text ). "\n\n". '</PRE>';
36 #well, could do this without sprintProfile, but definiately don't want it on
37 #unless DBIx::Profile is loaded
38 if ( $FS::CurrentUser::CurrentUser->option('save_db_profile') ) {
39 #my $file = %%%FREESIDE_LOG%%%; #substitute here? maybe get from FS.pm?
40 my $file = '/usr/local/etc/freeside/'; #bah
41 $file .= "dbix_profile.$$.". time;
42 dbh->setLogFile($file);
46 dbh->{'private_profile'} = {};
48 s/(<\/BODY>[\s\n]*<\/HTML>[\s\n]*)$/$profile$1/i;