- #$$ref = $cgi->header() . $$ref;
- #warn "Script_OnFlush called with dbh ". dbh. "\n";
- #if ( dbh->can('sprintProfile') ) {
- if ( UNIVERSAL::can(dbh, 'sprintProfile') ) {
- #warn "dbh can sprintProfile\n";
- if ( lc($Response->{ContentType}) eq 'text/html' ) { #con
- #warn "contenttype is sprintProfile\n";
- $$ref =~ s/<\/BODY>[\s\n]*<\/HTML>[\s\n]*$//i
- or warn "can't remove";
-
- #$$ref .= '<PRE>'. ("\n"x96). encode_entities(dbh->sprintProfile()). '</PRE>';
- # wtf? konqueror...
- $$ref .= '<PRE>'. ("\n"x4096). encode_entities(dbh->sprintProfile()).
- "\n\n". &sprintAutoProfile(). '</PRE>';
-
- $$ref .= '</BODY></HTML>';
- }
- dbh->{'private_profile'} = {};
- }
-}
-
-#if ( defined(@DBIx::Profile::ISA) && DBIx::Profile::db->can('sprintProfile') ) {
-#if ( defined(@DBIx::Profile::ISA) && UNIVERSAL::can('DBIx::Profile::db', 'sprintProfile') ) {
-if ( defined(@DBIx::Profile::ISA) ) {
-
- #warn "enabling profiling redirects";
- *CGI::redirect = sub {
- my( $self, $location) = @_;
- my $page =
- $cgi->header.
- qq!<HTML><BODY>Redirect to <A HREF="$location">$location</A>!.
- '<BR><BR><PRE>'.
- ( UNIVERSAL::can(dbh, 'sprintProfile')
- ? encode_entities(dbh->sprintProfile())
- : 'DBIx::Profile missing sprintProfile method;'.
- 'unpatched or too old?' ).
- "\n\n". &sprintAutoProfile(). '</PRE>'.
- '</BODY></HTML>';
- dbh->{'private_profile'} = {};
- return $page;
- };
-
-}
-
-sub by_total_time
-{
- return $a->{total_time_in_sub} <=> $b->{total_time_in_sub};
-}
-
-sub sprintAutoProfile {
- my %caller_info = %Devel::AutoProfiler::caller_info;
- return unless keys %caller_info;
-
- %Devel::AutoProfiler::caller_info = ();