← Index
NYTProf Performance Profile   « line view »
For ./view
  Run on Fri Jul 31 19:05:14 2015
Reported on Fri Jul 31 19:08:09 2015

Filename/var/www/foswiki11/lib/Foswiki/Plugin.pm
StatementsExecuted 5481 statements in 21.8ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
37119.97ms92.2msFoswiki::Plugin::::loadFoswiki::Plugin::load
37116.42ms49.3msFoswiki::Plugin::::registerHandlersFoswiki::Plugin::registerHandlers
238111.52ms38.5msFoswiki::Plugin::::invokeFoswiki::Plugin::invoke (recurses: max depth 1, inclusive time 381µs)
111777µs851µsFoswiki::Plugin::::BEGIN@15Foswiki::Plugin::BEGIN@15
3611520µs41.3msFoswiki::Plugin::::__ANON__[:241]Foswiki::Plugin::__ANON__[:241]
3711358µs386µsFoswiki::Plugin::::newFoswiki::Plugin::new
3711343µs1.30sFoswiki::Plugin::::registerSettingsFoswiki::Plugin::registerSettings
3711316µs316µsFoswiki::Plugin::::finishFoswiki::Plugin::finish
111308µs358µsFoswiki::Plugin::::BEGIN@14Foswiki::Plugin::BEGIN@14
5031268µs784µsFoswiki::Plugin::::topicWebFoswiki::Plugin::topicWeb
111217µs261µsFoswiki::Plugin::::BEGIN@16Foswiki::Plugin::BEGIN@16
11112µs25µsFoswiki::Plugin::::BEGIN@8Foswiki::Plugin::BEGIN@8
11111µs23µsFoswiki::Plugin::::BEGIN@10Foswiki::Plugin::BEGIN@10
1119µs22µsFoswiki::Plugin::::BEGIN@181Foswiki::Plugin::BEGIN@181
1119µs14µsFoswiki::Plugin::::BEGIN@9Foswiki::Plugin::BEGIN@9
1118µs119µsFoswiki::Plugin::::BEGIN@11Foswiki::Plugin::BEGIN@11
1118µs19µsFoswiki::Plugin::::BEGIN@293Foswiki::Plugin::BEGIN@293
1118µs18µsFoswiki::Plugin::::BEGIN@233Foswiki::Plugin::BEGIN@233
1118µs17µsFoswiki::Plugin::::BEGIN@195Foswiki::Plugin::BEGIN@195
1117µs16µsFoswiki::Plugin::::BEGIN@183Foswiki::Plugin::BEGIN@183
1117µs16µsFoswiki::Plugin::::BEGIN@313Foswiki::Plugin::BEGIN@313
1117µs16µsFoswiki::Plugin::::BEGIN@201Foswiki::Plugin::BEGIN@201
1117µs16µsFoswiki::Plugin::::BEGIN@303Foswiki::Plugin::BEGIN@303
1117µs15µsFoswiki::Plugin::::BEGIN@240Foswiki::Plugin::BEGIN@240
1117µs16µsFoswiki::Plugin::::BEGIN@315Foswiki::Plugin::BEGIN@315
1117µs15µsFoswiki::Plugin::::BEGIN@295Foswiki::Plugin::BEGIN@295
1117µs15µsFoswiki::Plugin::::BEGIN@305Foswiki::Plugin::BEGIN@305
1114µs4µsFoswiki::Plugin::::BEGIN@13Foswiki::Plugin::BEGIN@13
0000s0sFoswiki::Plugin::::__ANON__[:244]Foswiki::Plugin::__ANON__[:244]
0000s0sFoswiki::Plugin::::__ANON__[:247]Foswiki::Plugin::__ANON__[:247]
0000s0sFoswiki::Plugin::::__ANON__[:250]Foswiki::Plugin::__ANON__[:250]
0000s0sFoswiki::Plugin::::__ANON__[:254]Foswiki::Plugin::__ANON__[:254]
0000s0sFoswiki::Plugin::::getDescriptionFoswiki::Plugin::getDescription
0000s0sFoswiki::Plugin::::getReleaseFoswiki::Plugin::getRelease
0000s0sFoswiki::Plugin::::getVersionFoswiki::Plugin::getVersion
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
3# PRIVATE CLASS Foswiki::Plugin
4#
5# Reference information for a single plugin.
6package Foswiki::Plugin;
7
8225µs238µs
# spent 25µs (12+13) within Foswiki::Plugin::BEGIN@8 which was called: # once (12µs+13µs) by Foswiki::Plugins::BEGIN@21 at line 8
use strict;
# spent 25µs making 1 call to Foswiki::Plugin::BEGIN@8 # spent 13µs making 1 call to strict::import
9223µs220µs
# spent 14µs (9+6) within Foswiki::Plugin::BEGIN@9 which was called: # once (9µs+6µs) by Foswiki::Plugins::BEGIN@21 at line 9
use warnings;
# spent 14µs making 1 call to Foswiki::Plugin::BEGIN@9 # spent 6µs making 1 call to warnings::import
10227µs234µs
# spent 23µs (11+12) within Foswiki::Plugin::BEGIN@10 which was called: # once (11µs+12µs) by Foswiki::Plugins::BEGIN@21 at line 10
use Assert;
# spent 23µs making 1 call to Foswiki::Plugin::BEGIN@10 # spent 12µs making 1 call to Assert::import
11229µs2230µs
# spent 119µs (8+111) within Foswiki::Plugin::BEGIN@11 which was called: # once (8µs+111µs) by Foswiki::Plugins::BEGIN@21 at line 11
use Error qw(:try);
# spent 119µs making 1 call to Foswiki::Plugin::BEGIN@11 # spent 111µs making 1 call to Error::import
12
13220µs14µs
# spent 4µs within Foswiki::Plugin::BEGIN@13 which was called: # once (4µs+0s) by Foswiki::Plugins::BEGIN@21 at line 13
use Foswiki::Plugins ();
# spent 4µs making 1 call to Foswiki::Plugin::BEGIN@13
142145µs1358µs
# spent 358µs (308+50) within Foswiki::Plugin::BEGIN@14 which was called: # once (308µs+50µs) by Foswiki::Plugins::BEGIN@21 at line 14
use Foswiki::AccessControlException ();
# spent 358µs making 1 call to Foswiki::Plugin::BEGIN@14
152135µs1851µs
# spent 851µs (777+74) within Foswiki::Plugin::BEGIN@15 which was called: # once (777µs+74µs) by Foswiki::Plugins::BEGIN@21 at line 15
use Foswiki::OopsException ();
# spent 851µs making 1 call to Foswiki::Plugin::BEGIN@15
162522µs1261µs
# spent 261µs (217+44) within Foswiki::Plugin::BEGIN@16 which was called: # once (217µs+44µs) by Foswiki::Plugins::BEGIN@21 at line 16
use Foswiki::ValidationException ();
# spent 261µs making 1 call to Foswiki::Plugin::BEGIN@16
17
1815µsour @registrableHandlers = ( # Foswiki::Plugins::VERSION:
19 'afterAttachmentSaveHandler', # 1.022 DEPRECATED
20 'afterUploadHandler', # 2.1
21 'afterCommonTagsHandler', # 1.024
22 'afterEditHandler', # 1.010
23 'afterRenameHandler', # 1.110
24 'afterSaveHandler', # 1.020
25 'beforeAttachmentSaveHandler', # 1.022 DEPRECATED
26 'beforeCommonTagsHandler', # 1.024
27 'beforeEditHandler', # 1.010
28 'beforeMergeHandler', # 1.200
29 'beforeSaveHandler', # 1.010
30 'beforeUploadHandler', # 2.1
31 'commonTagsHandler', # 1.000
32 'completePageHandler', # 1.100
33 'earlyInitPlugin', # 1.020
34 'endRenderingHandler', # 1.000 DEPRECATED
35 'finishPlugin', # 2.100
36 'initPlugin', # 1.000
37 'initializeUserHandler', # 1.010
38 'insidePREHandler', # 1.000 DEPRECATED
39 'modifyHeaderHandler', # 1.026
40 'mergeHandler', # 1.026
41 'outsidePREHandler', # 1.000 DEPRECATED
42 'postRenderingHandler', # 1.026
43 'preRenderingHandler', # 1.026
44 'redirectCgiQueryHandler', # 1.010 DEPRECATED
45 'registrationHandler', # 1.010
46 'renderFormFieldForEditHandler', # ?
47 'renderWikiWordHandler', # 1.023
48 'startRenderingHandler', # 1.000 DEPRECATED
49 'writeHeaderHandler', # 1.010 DEPRECATED
50);
51
52# deprecated handlers
5314µsour %deprecated = (
54 afterAttachmentSaveHandler => 1,
55 beforeAttachmentSaveHandler => 1,
56 endRenderingHandler => 1,
57 insidePREHandler => 1,
58 outsidePREHandler => 1,
59 redirectCgiQueryHandler => 1,
60 startRenderingHandler => 1,
61 writeHeaderHandler => 1,
62);
63
64=begin TML
65
66---++ ClassMethod new( $session, $name, [, $module] )
67
68 * =$session= - Foswiki object
69 * =$name= - name of the plugin e.g. MyPlugin
70 * =$module= - name of implementing package; optional, used for tests.
71 Normally =load= is used to discover the module from the config.
72
73=cut
74
75
# spent 386µs (358+28) within Foswiki::Plugin::new which was called 37 times, avg 10µs/call: # 37 times (358µs+28µs) by Foswiki::Plugins::load at line 186 of /var/www/foswiki11/lib/Foswiki/Plugins.pm, avg 10µs/call
sub new {
763737µs my ( $class, $session, $name, $module ) = @_;
773732µs3728µs ASSERT( UNTAINTED($name), "Name $name is tainted!" ) if DEBUG;
# spent 28µs making 37 calls to Assert::ASSERTS_OFF, avg 751ns/call
7837177µs my $this = bless(
79 {
80 session => $session,
81 name => $name || '',
82 module => $module, # if undef, use discovery
83 },
84 $class
85 );
86
873789µs return $this;
88}
89
90=begin TML
91
92---++ ObjectMethod finish()
93Break circular references.
94
95=cut
96
97# Note to developers; please undef *all* fields in the object explicitly,
98# whether they are references or not. That way this method is "golden
99# documentation" of the live fields in the object.
100
# spent 316µs within Foswiki::Plugin::finish which was called 37 times, avg 9µs/call: # 37 times (316µs+0s) by Foswiki::Plugins::finish at line 102 of /var/www/foswiki11/lib/Foswiki/Plugins.pm, avg 9µs/call
sub finish {
101379µs my $this = shift;
102
1033745µs undef $this->{name};
1043725µs undef $this->{topicWeb};
1053741µs undef $this->{module};
1063736µs undef $this->{errors};
1073744µs undef $this->{disabled};
1083713µs undef $this->{reason};
1093720µs undef $this->{no_topic};
1103742µs undef $this->{description};
1113778µs undef $this->{session};
112}
113
114# Load and verify a plugin, invoking any early registration
115# handlers. Return the user resulting from the user handler call.
116
# spent 92.2ms (9.97+82.2) within Foswiki::Plugin::load which was called 37 times, avg 2.49ms/call: # 37 times (9.97ms+82.2ms) by Foswiki::Plugins::load at line 190 of /var/www/foswiki11/lib/Foswiki/Plugins.pm, avg 2.49ms/call
sub load {
1173717µs my ($this) = @_;
1183755µs my $p = $Foswiki::cfg{Plugins}{ $this->{name} }{Module};
119
1203713µs if ( defined $p ) {
121371.16ms eval "use $p";
# spent 222µs executing statements in 2 string evals (merged)
# includes 1.76ms spent executing 2 calls to 2 subs defined therein. # spent 189µs executing statements in 2 string evals (merged)
# includes 2.50ms spent executing 2 calls to 2 subs defined therein. # spent 130µs executing statements in string eval
# includes 7.36ms spent executing 1 call to 1 sub defined therein. # spent 114µs executing statements in string eval
# includes 763µs spent executing 1 call to 1 sub defined therein. # spent 111µs executing statements in string eval
# includes 643µs spent executing 1 call to 1 sub defined therein. # spent 109µs executing statements in string eval
# includes 390µs spent executing 1 call to 1 sub defined therein. # spent 106µs executing statements in string eval
# includes 2.64ms spent executing 1 call to 1 sub defined therein. # spent 105µs executing statements in string eval
# includes 5.50ms spent executing 1 call to 1 sub defined therein. # spent 102µs executing statements in string eval
# includes 1.64ms spent executing 1 call to 1 sub defined therein. # spent 102µs executing statements in string eval
# includes 763µs spent executing 1 call to 1 sub defined therein. # spent 99µs executing statements in string eval
# includes 1.58ms spent executing 1 call to 1 sub defined therein. # spent 99µs executing statements in string eval
# includes 924µs spent executing 1 call to 1 sub defined therein. # spent 97µs executing statements in string eval
# includes 2.11ms spent executing 1 call to 1 sub defined therein. # spent 96µs executing statements in string eval
# includes 1.43ms spent executing 1 call to 1 sub defined therein. # spent 96µs executing statements in string eval
# includes 509µs spent executing 1 call to 1 sub defined therein. # spent 95µs executing statements in string eval
# includes 1.01ms spent executing 1 call to 1 sub defined therein. # spent 95µs executing statements in string eval
# includes 2.56ms spent executing 1 call to 1 sub defined therein. # spent 95µs executing statements in string eval
# includes 479µs spent executing 1 call to 1 sub defined therein. # spent 94µs executing statements in string eval
# includes 1.33ms spent executing 1 call to 1 sub defined therein. # spent 94µs executing statements in string eval
# includes 1.79ms spent executing 1 call to 1 sub defined therein. # spent 92µs executing statements in string eval
# includes 250µs spent executing 1 call to 1 sub defined therein. # spent 92µs executing statements in string eval
# includes 835µs spent executing 1 call to 1 sub defined therein. # spent 91µs executing statements in string eval
# includes 1.57ms spent executing 1 call to 1 sub defined therein. # spent 89µs executing statements in string eval
# includes 358µs spent executing 1 call to 1 sub defined therein. # spent 88µs executing statements in string eval
# includes 1.08ms spent executing 1 call to 1 sub defined therein. # spent 87µs executing statements in string eval
# includes 1.40ms spent executing 1 call to 1 sub defined therein. # spent 87µs executing statements in string eval
# includes 2.77ms spent executing 1 call to 1 sub defined therein. # spent 86µs executing statements in string eval
# includes 2.08ms spent executing 1 call to 1 sub defined therein. # spent 85µs executing statements in string eval
# includes 447µs spent executing 1 call to 1 sub defined therein. # spent 85µs executing statements in string eval
# includes 1.04ms spent executing 1 call to 1 sub defined therein. # spent 84µs executing statements in string eval
# includes 376µs spent executing 1 call to 1 sub defined therein. # spent 83µs executing statements in string eval
# includes 220µs spent executing 1 call to 1 sub defined therein. # spent 82µs executing statements in string eval
# includes 666µs spent executing 1 call to 1 sub defined therein. # spent 80µs executing statements in string eval
# includes 374µs spent executing 1 call to 1 sub defined therein. # spent 78µs executing statements in string eval
# includes 222µs spent executing 1 call to 1 sub defined therein.
1223716µs if ($@) {
123 push(
12416µs @{ $this->{errors} },
125 "$p could not be loaded. Errors were:\n$@\n----"
126 );
12711µs $this->{disabled} = 1;
12812µs $this->{reason} = 'no_load_plugin';
12913µs return;
130 }
131 else {
1323644µs $this->{module} = $p;
133 }
134 }
135 else {
136 push(
137 @{ $this->{errors} },
138"$this->{name} could not be loaded. No \$Foswiki::cfg{Plugins}{$this->{name}}{Module} defined - re-run configure\n---"
139 );
140 $this->{disabled} = 1;
141 $this->{reason} = 'no_plugin_module';
142 return;
143 }
144
14536690µs my $noTopic = eval '$' . $p . '::NO_PREFS_IN_TOPIC';
# spent 8µs executing statements in string eval # spent 3µs executing statements in 2 string evals (merged) # spent 3µs executing statements in 2 string evals (merged) # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval
1463628µs $this->{no_topic} = $noTopic;
1473617µs $this->{topicWeb} = undef; # not known yet
148
149369µs unless ($noTopic) {
150725µs7601µs if ( !$this->topicWeb() ) {
# spent 601µs making 7 calls to Foswiki::Plugin::topicWeb, avg 86µs/call
151
152 # not found
153 push(
154 @{ $this->{errors} },
155 'Plugins: could not fully register '
156 . $this->{name}
157 . ', no plugin topic'
158 );
159 $noTopic = 1;
160 }
161 }
162
163 # Get the description from the code, if present. if it's not there, it'll
164 # be loaded as a preference from the plugin topic later
16536535µs $this->{description} = eval '$' . $p . '::SHORTDESCRIPTION';
# spent 3µs executing statements in 2 string evals (merged) # spent 3µs executing statements in 2 string evals (merged) # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval # spent 1µs executing statements in string eval # spent 1µs executing statements in string eval # spent 1µs executing statements in string eval # spent 1µs executing statements in string eval # spent 1µs executing statements in string eval # spent 1µs executing statements in string eval # spent 1µs executing statements in string eval # spent 1µs executing statements in string eval # spent 1µs executing statements in string eval
166
167 # Set the session for this call stack
1683624µs local $Foswiki::Plugins::SESSION = $this->{session};
1693667µs3659µs ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG;
# spent 59µs making 36 calls to Assert::ASSERTS_OFF, avg 2µs/call
170
1713620µs my $sub = $p . "::initPlugin";
1723641µs if ( !defined(&$sub) ) {
173 push( @{ $this->{errors} }, $sub . ' is not defined' );
174 $this->{disabled} = 1;
175 $this->{reason} = 'no_initPlugin';
176 return;
177 }
178
179368µs $sub = $p . '::earlyInitPlugin';
1803681µs if ( defined(&$sub) ) {
181234µs234µs
# spent 22µs (9+12) within Foswiki::Plugin::BEGIN@181 which was called: # once (9µs+12µs) by Foswiki::Plugins::BEGIN@21 at line 181
no strict 'refs';
# spent 22µs making 1 call to Foswiki::Plugin::BEGIN@181 # spent 12µs making 1 call to strict::unimport
182 my $error = &$sub();
183272µs225µs
# spent 16µs (7+9) within Foswiki::Plugin::BEGIN@183 which was called: # once (7µs+9µs) by Foswiki::Plugins::BEGIN@21 at line 183
use strict 'refs';
# spent 16µs making 1 call to Foswiki::Plugin::BEGIN@183 # spent 9µs making 1 call to strict::import
184 if ($error) {
185 push( @{ $this->{errors} }, $sub . ' failed: ' . $error );
186 $this->{disabled} = 1;
187 $this->{reason} = 'no_earlyInitPlugin';
188 return;
189 }
190 }
191
192364µs my $user;
193369µs $sub = $p . '::initializeUserHandler';
1943649µs if ( defined(&$sub) ) {
195244µs227µs
# spent 17µs (8+10) within Foswiki::Plugin::BEGIN@195 which was called: # once (8µs+10µs) by Foswiki::Plugins::BEGIN@21 at line 195
no strict 'refs';
# spent 17µs making 1 call to Foswiki::Plugin::BEGIN@195 # spent 10µs making 1 call to strict::unimport
196112µs3194µs $user = &$sub(
# spent 184µs making 1 call to Foswiki::Request::url # spent 9µs making 1 call to Foswiki::Plugins::ModifyLoginPlugin::initializeUserHandler # spent 2µs making 1 call to Foswiki::Request::pathInfo
197 $this->{session}->{remoteUser},
198 $this->{session}->{request}->url(),
199 $this->{session}->{request}->path_info()
200 );
2012195µs224µs
# spent 16µs (7+8) within Foswiki::Plugin::BEGIN@201 which was called: # once (7µs+8µs) by Foswiki::Plugins::BEGIN@21 at line 201
use strict 'refs';
# spent 16µs making 1 call to Foswiki::Plugin::BEGIN@201 # spent 8µs making 1 call to strict::import
202 }
203
204 #print STDERR "Compile $p: ".timestr(timediff(new Benchmark, $begin))."\n";
205
20636104µs return $user;
207}
208
209# register plugin settings
210
# spent 1.30s (343µs+1.30) within Foswiki::Plugin::registerSettings which was called 37 times, avg 35.1ms/call: # 37 times (343µs+1.30s) by Foswiki::Plugins::settings at line 234 of /var/www/foswiki11/lib/Foswiki/Plugins.pm, avg 35.1ms/call
sub registerSettings {
2113746µs my ( $this, $plugins ) = @_;
212
2133736µs return if $this->{disabled};
214
2153640µs my $prefs = $this->{session}->{prefs};
21636287µs141.30s if ( !$this->{no_topic} ) {
# spent 1.30s making 7 calls to Foswiki::Prefs::setPluginPreferences, avg 185ms/call # spent 66µs making 7 calls to Foswiki::Plugin::topicWeb, avg 9µs/call
217 $prefs->setPluginPreferences( $this->topicWeb(), $this->{name} );
218 }
219}
220
221# invoke plugin initialisation and register handlers.
222
# spent 49.3ms (6.42+42.8) within Foswiki::Plugin::registerHandlers which was called 37 times, avg 1.33ms/call: # 37 times (6.42ms+42.8ms) by Foswiki::Plugins::enable at line 268 of /var/www/foswiki11/lib/Foswiki/Plugins.pm, avg 1.33ms/call
sub registerHandlers {
2233726µs my ( $this, $plugins ) = @_;
224
2253719µs return if $this->{disabled};
226
2273628µs my $p = $this->{module};
2283617µs my $sub = $p . "::initPlugin";
2293619µs my $users = $Foswiki::Plugins::SESSION->{users};
230367µs my $status = 0;
231367µs my $exception = '';
232
# spent 41.3ms (520µs+40.7) within Foswiki::Plugin::__ANON__[/var/www/foswiki11/lib/Foswiki/Plugin.pm:241] which was called 36 times, avg 1.15ms/call: # 36 times (520µs+40.7ms) by Error::subs::try at line 419 of Error.pm, avg 1.15ms/call
try {
233250µs228µs
# spent 18µs (8+10) within Foswiki::Plugin::BEGIN@233 which was called: # once (8µs+10µs) by Foswiki::Plugins::BEGIN@21 at line 233
no strict 'refs';
# spent 18µs making 1 call to Foswiki::Plugin::BEGIN@233 # spent 10µs making 1 call to strict::unimport
23436532µs10840.7ms $status = &$sub(
# spent 15.9ms making 1 call to Foswiki::Plugins::DirectedGraphPlugin::initPlugin # spent 9.13ms making 1 call to Foswiki::Plugins::SmiliesPlugin::initPlugin # spent 4.42ms making 1 call to Foswiki::Plugins::JQueryPlugin::initPlugin # spent 3.21ms making 1 call to Foswiki::Plugins::ActionTrackerPlugin::initPlugin # spent 3.11ms making 1 call to Foswiki::Plugins::InterwikiPlugin::initPlugin # spent 1.01ms making 1 call to Foswiki::Plugins::AutoViewTemplatePlugin::initPlugin # spent 350µs making 1 call to Foswiki::Plugins::TwistyPlugin::initPlugin # spent 312µs making 1 call to Foswiki::Plugins::PlantUMLPlugin::initPlugin # spent 251µs making 1 call to Foswiki::Plugins::WysiwygPlugin::initPlugin # spent 249µs making 1 call to Foswiki::Plugins::ChecklistPlugin::initPlugin # spent 237µs making 1 call to Foswiki::Plugins::SpreadSheetPlugin::initPlugin # spent 223µs making 1 call to Foswiki::Plugins::MultiTopicSavePlugin::initPlugin # spent 212µs making 1 call to Foswiki::Plugins::RevCommentPlugin::initPlugin # spent 188µs making 1 call to Foswiki::Plugins::ChartPlugin::initPlugin # spent 183µs making 1 call to Foswiki::Plugins::EditTablePlugin::initPlugin # spent 143µs making 1 call to Foswiki::Plugins::RenderPlugin::initPlugin # spent 142µs making 1 call to Foswiki::Plugins::RevisionLinkPlugin::initPlugin # spent 134µs making 1 call to Foswiki::Plugins::TimeCalcPlugin::initPlugin # spent 128µs making 1 call to Foswiki::Plugins::AttachContentPlugin::initPlugin # spent 123µs making 36 calls to Foswiki::Users::getLoginName, avg 3µs/call # spent 118µs making 36 calls to Foswiki::Plugin::topicWeb, avg 3µs/call # spent 114µs making 1 call to Foswiki::Plugins::DelayMacroPlugin::initPlugin # spent 106µs making 1 call to Foswiki::Plugins::JHotDrawPlugin::initPlugin # spent 104µs making 1 call to Foswiki::Plugins::ExpandTopicContentPlugin::initPlugin # spent 74µs making 1 call to Foswiki::Plugins::TinyMCEPlugin::initPlugin # spent 72µs making 1 call to Foswiki::Plugins::FindElsewherePlugin::initPlugin # spent 70µs making 1 call to Foswiki::Plugins::ExtendedWebListPlugin::initPlugin # spent 64µs making 1 call to Foswiki::Plugins::HistoryPlugin::initPlugin # spent 63µs making 1 call to Foswiki::Plugins::TablePlugin::initPlugin # spent 49µs making 1 call to Foswiki::Plugins::RenderListPlugin::initPlugin # spent 42µs making 1 call to Foswiki::Plugins::HolidaylistPlugin::initPlugin # spent 42µs making 1 call to Foswiki::Plugins::MailerContribPlugin::initPlugin # spent 38µs making 1 call to Foswiki::Plugins::CompareRevisionsAddonPlugin::initPlugin # spent 34µs making 1 call to Foswiki::Plugins::PreferencesPlugin::initPlugin # spent 27µs making 1 call to Foswiki::Plugins::ModifyLoginPlugin::initPlugin # spent 26µs making 1 call to Foswiki::Plugins::SetFormValuesPlugin::initPlugin # spent 22µs making 1 call to Foswiki::Plugins::SlideShowPlugin::initPlugin # spent 8µs making 1 call to Foswiki::Plugins::CommentPlugin::initPlugin
235 $Foswiki::Plugins::SESSION->{topicName},
236 $Foswiki::Plugins::SESSION->{webName},
237 $users->getLoginName( $Foswiki::Plugins::SESSION->{user} ),
238 $this->topicWeb()
239 );
2402306µs223µs
# spent 15µs (7+8) within Foswiki::Plugin::BEGIN@240 which was called: # once (7µs+8µs) by Foswiki::Plugins::BEGIN@21 at line 240
use strict 'refs';
# spent 15µs making 1 call to Foswiki::Plugin::BEGIN@240 # spent 8µs making 1 call to strict::import
241 }
242 catch Foswiki::AccessControlException with {
243 shift->throw(); # propagate
244 }
245 catch Foswiki::OopsException with {
246 shift->throw(); # propagate
247 }
248 catch Foswiki::ValidationException with {
249 shift->throw(); # propagate
250 }
251 otherwise {
252 my $e = shift;
253 $exception = $e->text() . ' ' . $e->stacktrace();
254361.13ms288679µs };
# spent 396µs making 108 calls to Error::catch, avg 4µs/call # spent 147µs making 36 calls to Error::subs::otherwise, avg 4µs/call # spent 137µs making 108 calls to Error::subs::with, avg 1µs/call # spent 41.7ms making 36 calls to Error::subs::try, avg 1.16ms/call, recursion: max depth 1, sum of overlapping time 41.7ms
255
256367µs unless ($status) {
257 if ( !$exception ) {
258 $exception = <<MESSAGE;
259$sub did not return true.
260Check your Foswiki warning and error logs for more information.
261MESSAGE
262 }
263 push( @{ $this->{errors} }, $exception );
264 $this->{disabled} = 1;
265 $this->{reason} = 'plugin_ret_0';
266 return;
267 }
268
269361.40ms my $compat = eval '\%' . $p . '::FoswikiCompatibility';
# spent 6µs executing statements in 2 string evals (merged) # spent 6µs executing statements in 2 string evals (merged) # spent 5µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 4µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 3µs executing statements in string eval # spent 2µs executing statements in string eval # spent 2µs executing statements in string eval
2703644µs foreach my $h (@registrableHandlers) {
2711116428µs my $sub = $p . '::' . $h;
27211162.31ms if ( defined(&$sub) ) {
2738175µs220µs if ( $deprecated{$h}
# spent 20µs making 2 calls to version::vxs::VCMP, avg 10µs/call
274 && $compat
275 && $compat->{$h}
276 && $compat->{$h} <= $Foswiki::Plugins::VERSION )
277 {
278
279 # Compatibility handler not required in this version
28024µs next;
281 }
28279159µs79260µs $plugins->addListener( $h, $this );
# spent 260µs making 79 calls to Foswiki::Plugins::addListener, avg 3µs/call
283 }
284 }
28536192µs36154µs $this->{session}->enterContext( $this->{name} . 'Enabled' );
# spent 154µs making 36 calls to Foswiki::enterContext, avg 4µs/call
286}
287
288# Invoke a handler
289
# spent 38.5ms (1.52+36.9) within Foswiki::Plugin::invoke which was called 238 times, avg 162µs/call: # 238 times (1.52ms+36.9ms) by Foswiki::Plugins::dispatch at line 341 of /var/www/foswiki11/lib/Foswiki/Plugins.pm, avg 162µs/call
sub invoke {
290238124µs my $this = shift; # remove from parameter vector
29123853µs my $handlerName = shift;
292238249µs my $handler = $this->{module} . '::' . $handlerName;
293234µs230µs
# spent 19µs (8+11) within Foswiki::Plugin::BEGIN@293 which was called: # once (8µs+11µs) by Foswiki::Plugins::BEGIN@21 at line 293
no strict 'refs';
# spent 19µs making 1 call to Foswiki::Plugin::BEGIN@293 # spent 11µs making 1 call to strict::unimport
2942381.75ms23837.3ms return &$handler(@_);
# spent 12.8ms making 5 calls to Foswiki::Plugins::TablePlugin::preRenderingHandler, avg 2.56ms/call # spent 9.63ms making 5 calls to Foswiki::Plugins::FindElsewherePlugin::startRenderingHandler, avg 1.93ms/call # spent 4.05ms making 5 calls to Foswiki::Plugins::SmiliesPlugin::preRenderingHandler, avg 810µs/call # spent 2.78ms making 13 calls to Foswiki::Plugins::CommentPlugin::commonTagsHandler, avg 214µs/call # spent 2.78ms making 13 calls to Foswiki::Plugins::DirectedGraphPlugin::commonTagsHandler, avg 214µs/call # spent 1.36ms making 5 calls to Foswiki::Plugins::InterwikiPlugin::preRenderingHandler, avg 271µs/call # spent 937µs making 13 calls to Foswiki::Plugins::ChecklistPlugin::commonTagsHandler, avg 72µs/call # spent 433µs making 5 calls to Foswiki::Plugins::ChecklistPlugin::postRenderingHandler, avg 87µs/call # spent 368µs making 13 calls to Foswiki::Plugins::PlantUMLPlugin::commonTagsHandler, avg 28µs/call # spent 256µs making 13 calls to Foswiki::Plugins::CompareRevisionsAddonPlugin::commonTagsHandler, avg 20µs/call # spent 214µs making 13 calls to Foswiki::Plugins::ActionTrackerPlugin::commonTagsHandler, avg 16µs/call # spent 197µs making 13 calls to Foswiki::Plugins::RevCommentPlugin::commonTagsHandler, avg 15µs/call # spent 170µs making 13 calls to Foswiki::Plugins::ChartPlugin::commonTagsHandler, avg 13µs/call # spent 162µs making 7 calls to Foswiki::Plugins::WysiwygPlugin::beforeCommonTagsHandler, avg 23µs/call # spent 162µs making 13 calls to Foswiki::Plugins::EditTablePlugin::commonTagsHandler, avg 12µs/call # spent 142µs making 1 call to Foswiki::Plugins::JQueryPlugin::finishPlugin # spent 131µs making 13 calls to Foswiki::Plugins::SpreadSheetPlugin::commonTagsHandler, avg 10µs/call # spent 112µs making 13 calls to Foswiki::Plugins::SmiliesPlugin::commonTagsHandler, avg 9µs/call # spent 108µs making 13 calls to Foswiki::Plugins::SlideShowPlugin::commonTagsHandler, avg 8µs/call # spent 84µs making 7 calls to Foswiki::Plugins::EditTablePlugin::beforeCommonTagsHandler, avg 12µs/call # spent 82µs making 7 calls to Foswiki::Plugins::TablePlugin::afterCommonTagsHandler, avg 12µs/call # spent 67µs making 7 calls to Foswiki::Plugins::AttachContentPlugin::beforeCommonTagsHandler, avg 10µs/call # spent 60µs making 7 calls to Foswiki::Plugins::PreferencesPlugin::beforeCommonTagsHandler, avg 9µs/call # spent 60µs making 1 call to Foswiki::Plugins::WysiwygPlugin::modifyHeaderHandler # spent 57µs making 5 calls to Foswiki::Plugins::PreferencesPlugin::postRenderingHandler, avg 11µs/call # spent 53µs making 5 calls to Foswiki::Plugins::EditTablePlugin::postRenderingHandler, avg 11µs/call # spent 51µs making 5 calls to Foswiki::Plugins::RenderListPlugin::preRenderingHandler, avg 10µs/call # spent 27µs making 5 calls to Foswiki::Plugins::WysiwygPlugin::postRenderingHandler, avg 5µs/call
295245µs224µs
# spent 15µs (7+8) within Foswiki::Plugin::BEGIN@295 which was called: # once (7µs+8µs) by Foswiki::Plugins::BEGIN@21 at line 295
use strict 'refs';
# spent 15µs making 1 call to Foswiki::Plugin::BEGIN@295 # spent 8µs making 1 call to strict::import
296}
297
298# Get the VERSION number of the specified plugin.
299# SMELL: may die if the plugin doesn't compile
300sub getVersion {
301 my $this = shift;
302
303235µs224µs
# spent 16µs (7+9) within Foswiki::Plugin::BEGIN@303 which was called: # once (7µs+9µs) by Foswiki::Plugins::BEGIN@21 at line 303
no strict 'refs';
# spent 16µs making 1 call to Foswiki::Plugin::BEGIN@303 # spent 9µs making 1 call to strict::unimport
304 return ${ $this->{module} . '::VERSION' } || '';
305241µs224µs
# spent 15µs (7+8) within Foswiki::Plugin::BEGIN@305 which was called: # once (7µs+8µs) by Foswiki::Plugins::BEGIN@21 at line 305
use strict 'refs';
# spent 15µs making 1 call to Foswiki::Plugin::BEGIN@305 # spent 8µs making 1 call to strict::import
306}
307
308# Get the RELEASE of the specified plugin.
309# SMELL: may die if the plugin doesn't compile
310sub getRelease {
311 my $this = shift;
312
313236µs225µs
# spent 16µs (7+9) within Foswiki::Plugin::BEGIN@313 which was called: # once (7µs+9µs) by Foswiki::Plugins::BEGIN@21 at line 313
no strict 'refs';
# spent 16µs making 1 call to Foswiki::Plugin::BEGIN@313 # spent 9µs making 1 call to strict::unimport
314 return ${ $this->{module} . '::RELEASE' } || '';
3152318µs224µs
# spent 16µs (7+9) within Foswiki::Plugin::BEGIN@315 which was called: # once (7µs+9µs) by Foswiki::Plugins::BEGIN@21 at line 315
use strict 'refs';
# spent 16µs making 1 call to Foswiki::Plugin::BEGIN@315 # spent 9µs making 1 call to strict::import
316}
317
318# Get the description string for the given plugin
319sub getDescription {
320 my $this = shift;
321
322 unless ( defined $this->{description} ) {
323 my $pref = uc( $this->{name} ) . '_SHORTDESCRIPTION';
324 my $prefs = $this->{session}->{prefs};
325 $this->{description} = $prefs->getPreference($pref) || '';
326 }
327 if ( $this->{disabled} ) {
328 my $reason = '';
329 if ( $this->{reason} ) {
330 $reason =
331 $this->{session}->inlineAlert( 'alerts', $this->{reason} );
332 }
333 return
334 ' '
335 . $this->{name} . ': '
336 . $this->{session}->inlineAlert( 'alerts', 'plugin_disabled' )
337 . $reason;
338 }
339
340 my $release = $this->getRelease();
341 my $version = $this->getVersion();
342 $version =~ s/\$Rev: (\d+) \$/$1/g;
343 $version = $release . ', ' . $version if $release;
344
345 my $web = $this->topicWeb();
346 my $result = ' ' . ( $web ? "$web." : '!' ) . $this->{name} . ' ';
347 $result .= CGI::span( { class => 'foswikiGrayText foswikiSmall' },
348 '(' . $version . ')' );
349 $result .= ': ' . $this->{description};
350 return $result;
351}
352
353=begin TML
354
355---++ ObjectMethod topicWeb() -> $webname
356
357Find the web that has the topic for this plugin by searching the
358{Plugins}{WebSearchPath}. Returns undef if $NO_PREFS_IN_TOPIC=1
359
360=cut
361
362
# spent 784µs (268+516) within Foswiki::Plugin::topicWeb which was called 50 times, avg 16µs/call: # 36 times (118µs+0s) by Foswiki::Plugin::__ANON__[/var/www/foswiki11/lib/Foswiki/Plugin.pm:241] at line 234, avg 3µs/call # 7 times (85µs+516µs) by Foswiki::Plugin::load at line 150, avg 86µs/call # 7 times (66µs+0s) by Foswiki::Plugin::registerSettings at line 216, avg 9µs/call
sub topicWeb {
3635019µs my $this = shift;
364
3655047µs unless ( defined( $this->{topicWeb} ) || $this->{no_topic} ) {
366
367 # Find the plugin topic, if required
36872µs my $session = $this->{session};
369
370720µs foreach
371 my $web ( split( /[, ]+/, $Foswiki::cfg{Plugins}{WebSearchPath} ),
372 $session->{webName} )
373 {
374714µs7516µs if ( $session->topicExists( $web, $this->{name} ) ) {
# spent 516µs making 7 calls to Foswiki::topicExists, avg 74µs/call
37574µs $this->{topicWeb} = $web;
37676µs last;
377 }
378 }
379 }
380
381 # If there is no web (probably because NO_PREFS_IN_TOPIC is set)
382 # then default to the system web name.
383506.80ms return $this->{topicWeb} || $Foswiki::cfg{SystemWebName};
384}
385
38616µs1;
387__END__