Filename | /var/www/foswikidev/core/lib/Foswiki/Plugins/RenderFormPlugin.pm |
Statements | Executed 342 statements in 844µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 4.88ms | 5.02ms | BEGIN@66 | Foswiki::Plugins::RenderFormPlugin::
108 | 1 | 1 | 425µs | 425µs | commonTagsHandler | Foswiki::Plugins::RenderFormPlugin::
1 | 1 | 1 | 15µs | 159µs | initPlugin | Foswiki::Plugins::RenderFormPlugin::
1 | 1 | 1 | 13µs | 27µs | BEGIN@21 | Foswiki::Plugins::RenderFormPlugin::
1 | 1 | 1 | 9µs | 50µs | BEGIN@23 | Foswiki::Plugins::RenderFormPlugin::
1 | 1 | 1 | 8µs | 137µs | _requireJSCalendarContrib | Foswiki::Plugins::RenderFormPlugin::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # RenderFormPlugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/ | ||||
2 | # | ||||
3 | # Copyright (C) 2008 Daniel Rohde | ||||
4 | # | ||||
5 | # For licensing info read LICENSE file in the Foswiki root. | ||||
6 | # This program is free software; you can redistribute it and/or | ||||
7 | # modify it under the terms of the GNU General Public License | ||||
8 | # as published by the Free Software Foundation; either version 2 | ||||
9 | # of the License, or (at your option) any later version. | ||||
10 | # | ||||
11 | # This program is distributed in the hope that it will be useful, | ||||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
14 | # GNU General Public License for more details, published at | ||||
15 | # http://www.gnu.org/copyleft/gpl.html | ||||
16 | # | ||||
17 | # As per the GPL, removal of this notice is prohibited. | ||||
18 | |||||
19 | package Foswiki::Plugins::RenderFormPlugin; | ||||
20 | |||||
21 | 2 | 33µs | 2 | 41µs | # spent 27µs (13+14) within Foswiki::Plugins::RenderFormPlugin::BEGIN@21 which was called:
# once (13µs+14µs) by Foswiki::Plugin::BEGIN@2.29 at line 21 # spent 27µs making 1 call to Foswiki::Plugins::RenderFormPlugin::BEGIN@21
# spent 14µs making 1 call to strict::import |
22 | |||||
23 | 2 | 156µs | 2 | 90µs | # spent 50µs (9+40) within Foswiki::Plugins::RenderFormPlugin::BEGIN@23 which was called:
# once (9µs+40µs) by Foswiki::Plugin::BEGIN@2.29 at line 23 # spent 50µs making 1 call to Foswiki::Plugins::RenderFormPlugin::BEGIN@23
# spent 40µs making 1 call to vars::import |
24 | |||||
25 | 1 | 700ns | $VERSION = '$Rev$'; | ||
26 | |||||
27 | 1 | 200ns | $RELEASE = '1.007 (18 Aug 2010)'; | ||
28 | |||||
29 | 1 | 100ns | $REVISION = | ||
30 | '1.007'; #Paul Harvey# fix plugin code to only require JSCalendarContrib once | ||||
31 | |||||
32 | #$REVISION = '1.006'; #Paul Harvey# added redirectto parameter | ||||
33 | #$REVISION = '1.005'; #Daniel Rohde# fixed performance problem | ||||
34 | #$REVISION = '1.004'; #Kenneth Lavrsen# Fixed a bug that causes JSCalendarContrib to stack overflow. Fix includes changing to official API way to add JSCalendar. | ||||
35 | #$REVISION = '1.003'; #Kenneth Lavrsen# Changed to Foswiki name space | ||||
36 | #$REVISION = '1.002'; #dro# added layout feature; fixed date field bug; added missing docs; | ||||
37 | #$REVISION = '1.001'; #dro# changed topicparent default; added and fixed docs; fixed date field bug; fixed non-word character in field names bug; | ||||
38 | #$REVISION = '1.000'; #dro# initial version | ||||
39 | |||||
40 | 1 | 200ns | $pluginName = 'RenderFormPlugin'; | ||
41 | |||||
42 | # spent 159µs (15+144) within Foswiki::Plugins::RenderFormPlugin::initPlugin which was called:
# once (15µs+144µs) by Foswiki::Plugin::__ANON__[/var/www/foswikidev/core/lib/Foswiki/Plugin.pm:257] at line 250 of /var/www/foswikidev/core/lib/Foswiki/Plugin.pm | ||||
43 | 1 | 1µs | my ( $topic, $web, $user, $installWeb ) = @_; | ||
44 | |||||
45 | # check for Plugins.pm versions | ||||
46 | 1 | 12µs | 1 | 7µs | if ( $Foswiki::Plugins::VERSION < 1.026 ) { # spent 7µs making 1 call to version::vxs::VCMP |
47 | Foswiki::Func::writeWarning( | ||||
48 | "Version mismatch between $pluginName and Plugins.pm"); | ||||
49 | return 0; | ||||
50 | } | ||||
51 | 1 | 3µs | 1 | 137µs | _requireJSCalendarContrib(); # spent 137µs making 1 call to Foswiki::Plugins::RenderFormPlugin::_requireJSCalendarContrib |
52 | |||||
53 | # Plugin correctly initialized | ||||
54 | 1 | 4µs | return 1; | ||
55 | } | ||||
56 | |||||
57 | # spent 425µs within Foswiki::Plugins::RenderFormPlugin::commonTagsHandler which was called 108 times, avg 4µs/call:
# 108 times (425µs+0s) by Foswiki::Plugin::invoke at line 310 of /var/www/foswikidev/core/lib/Foswiki/Plugin.pm, avg 4µs/call | ||||
58 | |||||
59 | # do not uncomment, use $_[0], $_[1]... instead | ||||
60 | ### my ( $text, $topic, $web ) = @_; | ||||
61 | |||||
62 | 108 | 23µs | Foswiki::Func::writeDebug( | ||
63 | "- ${pluginName}::commonTagsHandler( $_[2].$_[1] )") | ||||
64 | if $debug; | ||||
65 | |||||
66 | 2 | 218µs | 1 | 5.02ms | # spent 5.02ms (4.88+137µs) within Foswiki::Plugins::RenderFormPlugin::BEGIN@66 which was called:
# once (4.88ms+137µs) by Foswiki::Plugin::BEGIN@2.29 at line 66 # spent 5.02ms making 1 call to Foswiki::Plugins::RenderFormPlugin::BEGIN@66 |
67 | $_[0] =~ | ||||
68 | 108 | 97µs | s/\%RENDERFORM{(.*?)}\%/Foswiki::Plugins::RenderFormPlugin::Core::render($1,$_[1],$_[2])/ge; | ||
69 | 108 | 285µs | $_[0] =~ s/\%STARTRENDERFORMLAYOUT(.*?)STOPRENDERFORMLAYOUT\%//sg; | ||
70 | } | ||||
71 | |||||
72 | # spent 137µs (8+128) within Foswiki::Plugins::RenderFormPlugin::_requireJSCalendarContrib which was called:
# once (8µs+128µs) by Foswiki::Plugins::RenderFormPlugin::initPlugin at line 51 | ||||
73 | |||||
74 | # do not uncomment, use $_[0], $_[1]... instead | ||||
75 | #my $text = shift; | ||||
76 | # | ||||
77 | # | ||||
78 | 1 | 4µs | eval { | ||
79 | 1 | 1µs | require Foswiki::Contrib::JSCalendarContrib; | ||
80 | 1 | 2µs | 1 | 128µs | unless ($@) { # spent 128µs making 1 call to Foswiki::Contrib::JSCalendarContrib::addHEAD |
81 | Foswiki::Contrib::JSCalendarContrib::addHEAD('foswiki'); | ||||
82 | } | ||||
83 | }; | ||||
84 | } | ||||
85 | |||||
86 | 1 | 3µs | 1; |