← Index
NYTProf Performance Profile   « line view »
For ./view
  Run on Fri Jul 31 18:42:36 2015
Reported on Fri Jul 31 18:48:15 2015

Filename/var/www/foswikidev/core/lib/Foswiki/Plugins/JQueryPlugin/RENDER.pm
StatementsExecuted 12 statements in 406µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11123µs48µsFoswiki::Plugins::JQueryPlugin::RENDER::::newFoswiki::Plugins::JQueryPlugin::RENDER::new
11115µs27µsFoswiki::Plugins::JQueryPlugin::RENDER::::BEGIN@4Foswiki::Plugins::JQueryPlugin::RENDER::BEGIN@4
1119µs13µsFoswiki::Plugins::JQueryPlugin::RENDER::::BEGIN@5Foswiki::Plugins::JQueryPlugin::RENDER::BEGIN@5
1114µs4µsFoswiki::Plugins::JQueryPlugin::RENDER::::BEGIN@7Foswiki::Plugins::JQueryPlugin::RENDER::BEGIN@7
0000s0sFoswiki::Plugins::JQueryPlugin::RENDER::::restTmplFoswiki::Plugins::JQueryPlugin::RENDER::restTmpl
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# See bottom of file for license and copyright information
2
3package Foswiki::Plugins::JQueryPlugin::RENDER;
4228µs240µs
# spent 27µs (15+12) within Foswiki::Plugins::JQueryPlugin::RENDER::BEGIN@4 which was called: # once (15µs+12µs) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1.48 at line 4
use strict;
# spent 27µs making 1 call to Foswiki::Plugins::JQueryPlugin::RENDER::BEGIN@4 # spent 12µs making 1 call to strict::import
5224µs217µs
# spent 13µs (9+4) within Foswiki::Plugins::JQueryPlugin::RENDER::BEGIN@5 which was called: # once (9µs+4µs) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1.48 at line 5
use warnings;
# spent 13µs making 1 call to Foswiki::Plugins::JQueryPlugin::RENDER::BEGIN@5 # spent 4µs making 1 call to warnings::import
6
72324µs14µs
# spent 4µs within Foswiki::Plugins::JQueryPlugin::RENDER::BEGIN@7 which was called: # once (4µs+0s) by Foswiki::Plugins::JQueryPlugin::Plugins::BEGIN@1.48 at line 7
use Foswiki::Plugins::JQueryPlugin::Plugin ();
# spent 4µs making 1 call to Foswiki::Plugins::JQueryPlugin::RENDER::BEGIN@7
817µsour @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin );
9
10
# spent 48µs (23+25) within Foswiki::Plugins::JQueryPlugin::RENDER::new which was called: # once (23µs+25µs) by Foswiki::Plugins::JQueryPlugin::Plugins::load at line 290 of /var/www/foswikidev/core/lib/Foswiki/Plugins/JQueryPlugin/Plugins.pm
sub new {
111500ns my $class = shift;
121500ns my $session = shift || $Foswiki::Plugins::SESSION;
13
14116µs125µs my $this = bless(
# spent 25µs making 1 call to Foswiki::Plugins::JQueryPlugin::Plugin::new
15 $class->SUPER::new(
16 $session,
17 name => 'Render',
18 version => '1.0.0-beta',
19 author => 'Boris Moore',
20 homepage => 'http://www.jsviews.com',
21 javascript => [ 'jquery.render.js', 'jquery.template-loader.js' ],
22 ),
23 $class
24 );
25
2613µs return $this;
27}
28
29=begin TML
30
31---++ ClassMethod restTmpl( $session, $subject, $verb )
32
33rest handler to load foswiki templates
34
35=cut
36
37sub restTmpl {
38 my ( $this, $session, $subject, $verb ) = @_;
39
40 my $result = '';
41 my $request = Foswiki::Func::getRequestObject();
42 my $load = $request->param('load');
43 my $name = $request->param('name') || $load;
44 my $web = $session->{webName};
45 my $topic = $session->{topicName};
46 my $contentType = $request->param("contenttype");
47 my $cacheControl = $request->param("cachecontrol");
48 my $doRender =
49 Foswiki::Func::isTrue( scalar( $request->param('render') ), 0 );
50
51 $cacheControl = "max-age=28800" unless defined $cacheControl;
52
53 $result = Foswiki::Func::loadTemplate($load) if defined $load;
54
55 if ( defined $name ) {
56 my $attrs = new Foswiki::Attrs($name);
57 $result = $session->templates->tmplP($attrs);
58 }
59
60 $result = Foswiki::Func::expandCommonVariables( $result, $topic, $web )
61 || '';
62 $result = Foswiki::Func::renderText( $result, $web ) if $doRender;
63
64 my $response = $session->{response};
65
66 if ( $result eq "" ) {
67 $response->header( -status => 500 );
68 $session->writeCompletePage( "ERROR: template '$name' not found",
69 undef, $contentType );
70 }
71 else {
72 $response->header( -"Cache-Control" => $cacheControl ) if $cacheControl;
73 $session->writeCompletePage( $result, undef, $contentType );
74 }
75
76 return;
77}
78
7913µs1;
80
81__END__