projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
typo, fix from mtou, thanks
[freeside.git]
/
httemplate
/
autohandler
diff --git
a/httemplate/autohandler
b/httemplate/autohandler
index
e6e50d5
..
bdea505
100644
(file)
--- a/
httemplate/autohandler
+++ b/
httemplate/autohandler
@@
-1,23
+1,35
@@
% $m->call_next;
% $m->call_next;
-
<%init>
dbh->{'private_profile'} = {} if UNIVERSAL::can(dbh, 'sprintProfile');
</%init>
<%init>
dbh->{'private_profile'} = {} if UNIVERSAL::can(dbh, 'sprintProfile');
</%init>
-
<%filter>
my $profile = '';
if ( UNIVERSAL::can(dbh, 'sprintProfile') ) {
<%filter>
my $profile = '';
if ( UNIVERSAL::can(dbh, 'sprintProfile') ) {
- #if contenttype is text/html!! **FIXME**
+ if ( lc($r->content_type) eq 'text/html' ) {
+
+ ## barely worth it, just in case someone tries to use profiling on a
+ ## non-RT install
+ #eval "use Text::Wrapper;";
+ #die $@ if $@;
- $profile = '<PRE>'. ("\n"x4096). encode_entities(dbh->sprintProfile()).
+ my $wrapper = new Text::Wrapper( columns => 80 );
+ my $text = dbh->sprintProfile();
+ #my $text = $wrapper->wrap( dbh->sprintProfile() );
+ $text =~ s/^/ /mg;
+
+ $profile = '<PRE>'.
+ encode_entities( $text ).
#"\n\n". &sprintAutoProfile(). '</PRE>';
"\n\n". '</PRE>';
#"\n\n". &sprintAutoProfile(). '</PRE>';
"\n\n". '</PRE>';
- #endif
+ }
dbh->{'private_profile'} = {};
}
s/(<\/BODY>[\s\n]*<\/HTML>[\s\n]*)$/$profile$1/i;
</%filter>
dbh->{'private_profile'} = {};
}
s/(<\/BODY>[\s\n]*<\/HTML>[\s\n]*)$/$profile$1/i;
</%filter>
+<%cleanup>
+ dbh->commit();
+</%cleanup>