Filename | /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugin.pm |
Statements | Executed 43578 statements in 173ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
10316 | 1 | 1 | 137ms | 367ms | invoke (recurses: max depth 1, inclusive time 559µs) | Foswiki::Plugin::
19 | 1 | 1 | 6.82ms | 81.2s | registerHandlers | Foswiki::Plugin::
19 | 1 | 1 | 3.05ms | 44.3ms | load | Foswiki::Plugin::
1 | 1 | 1 | 1.49ms | 1.62ms | BEGIN@15 | Foswiki::Plugin::
19 | 1 | 1 | 575µs | 81.2s | __ANON__[:235] | Foswiki::Plugin::
1 | 1 | 1 | 501µs | 577µs | BEGIN@14 | Foswiki::Plugin::
19 | 1 | 1 | 469µs | 545µs | new | Foswiki::Plugin::
19 | 1 | 1 | 384µs | 384µs | finish | Foswiki::Plugin::
1 | 1 | 1 | 329µs | 405µs | BEGIN@16 | Foswiki::Plugin::
19 | 1 | 1 | 181µs | 181µs | topicWeb | Foswiki::Plugin::
19 | 1 | 1 | 158µs | 158µs | registerSettings | Foswiki::Plugin::
1 | 1 | 1 | 25µs | 32µs | BEGIN@8 | Foswiki::Plugin::
1 | 1 | 1 | 24µs | 60µs | BEGIN@176 | Foswiki::Plugin::
1 | 1 | 1 | 23µs | 58µs | BEGIN@10 | Foswiki::Plugin::
1 | 1 | 1 | 20µs | 49µs | BEGIN@306 | Foswiki::Plugin::
1 | 1 | 1 | 19µs | 48µs | BEGIN@189 | Foswiki::Plugin::
1 | 1 | 1 | 17µs | 469µs | BEGIN@11 | Foswiki::Plugin::
1 | 1 | 1 | 17µs | 48µs | BEGIN@286 | Foswiki::Plugin::
1 | 1 | 1 | 16µs | 34µs | BEGIN@9 | Foswiki::Plugin::
1 | 1 | 1 | 16µs | 43µs | BEGIN@296 | Foswiki::Plugin::
1 | 1 | 1 | 16µs | 44µs | BEGIN@288 | Foswiki::Plugin::
1 | 1 | 1 | 16µs | 45µs | BEGIN@227 | Foswiki::Plugin::
1 | 1 | 1 | 15µs | 45µs | BEGIN@178 | Foswiki::Plugin::
1 | 1 | 1 | 15µs | 44µs | BEGIN@234 | Foswiki::Plugin::
1 | 1 | 1 | 15µs | 43µs | BEGIN@308 | Foswiki::Plugin::
1 | 1 | 1 | 15µs | 43µs | BEGIN@298 | Foswiki::Plugin::
1 | 1 | 1 | 15µs | 43µs | BEGIN@195 | Foswiki::Plugin::
1 | 1 | 1 | 11µs | 11µs | BEGIN@13 | Foswiki::Plugin::
0 | 0 | 0 | 0s | 0s | __ANON__[:238] | Foswiki::Plugin::
0 | 0 | 0 | 0s | 0s | __ANON__[:241] | Foswiki::Plugin::
0 | 0 | 0 | 0s | 0s | __ANON__[:244] | Foswiki::Plugin::
0 | 0 | 0 | 0s | 0s | __ANON__[:248] | Foswiki::Plugin::
0 | 0 | 0 | 0s | 0s | getDescription | Foswiki::Plugin::
0 | 0 | 0 | 0s | 0s | getRelease | Foswiki::Plugin::
0 | 0 | 0 | 0s | 0s | getVersion | Foswiki::Plugin::
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. | ||||
6 | package Foswiki::Plugin; | ||||
7 | |||||
8 | 2 | 51µs | 2 | 40µs | # spent 32µs (25+7) within Foswiki::Plugin::BEGIN@8 which was called:
# once (25µs+7µs) by Foswiki::Plugins::BEGIN@21 at line 8 # spent 32µs making 1 call to Foswiki::Plugin::BEGIN@8
# spent 7µs making 1 call to strict::import |
9 | 2 | 47µs | 2 | 52µs | # spent 34µs (16+18) within Foswiki::Plugin::BEGIN@9 which was called:
# once (16µs+18µs) by Foswiki::Plugins::BEGIN@21 at line 9 # spent 34µs making 1 call to Foswiki::Plugin::BEGIN@9
# spent 18µs making 1 call to warnings::import |
10 | 2 | 51µs | 2 | 94µs | # spent 58µs (23+35) within Foswiki::Plugin::BEGIN@10 which was called:
# once (23µs+35µs) by Foswiki::Plugins::BEGIN@21 at line 10 # spent 58µs making 1 call to Foswiki::Plugin::BEGIN@10
# spent 35µs making 1 call to Assert::import |
11 | 2 | 55µs | 2 | 920µs | # spent 469µs (17+451) within Foswiki::Plugin::BEGIN@11 which was called:
# once (17µs+451µs) by Foswiki::Plugins::BEGIN@21 at line 11 # spent 469µs making 1 call to Foswiki::Plugin::BEGIN@11
# spent 451µs making 1 call to Error::import |
12 | |||||
13 | 2 | 44µs | 1 | 11µs | # spent 11µs within Foswiki::Plugin::BEGIN@13 which was called:
# once (11µs+0s) by Foswiki::Plugins::BEGIN@21 at line 13 # spent 11µs making 1 call to Foswiki::Plugin::BEGIN@13 |
14 | 2 | 332µs | 1 | 577µs | # spent 577µs (501+76) within Foswiki::Plugin::BEGIN@14 which was called:
# once (501µs+76µs) by Foswiki::Plugins::BEGIN@21 at line 14 # spent 577µs making 1 call to Foswiki::Plugin::BEGIN@14 |
15 | 2 | 225µs | 1 | 1.62ms | # spent 1.62ms (1.49+132µs) within Foswiki::Plugin::BEGIN@15 which was called:
# once (1.49ms+132µs) by Foswiki::Plugins::BEGIN@21 at line 15 # spent 1.62ms making 1 call to Foswiki::Plugin::BEGIN@15 |
16 | 2 | 893µs | 1 | 405µs | # spent 405µs (329+76) within Foswiki::Plugin::BEGIN@16 which was called:
# once (329µs+76µs) by Foswiki::Plugins::BEGIN@21 at line 16 # spent 405µs making 1 call to Foswiki::Plugin::BEGIN@16 |
17 | |||||
18 | 1 | 8µs | our @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 | ||||
53 | 1 | 7µs | our %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 545µs (469+75) within Foswiki::Plugin::new which was called 19 times, avg 29µs/call:
# 19 times (469µs+75µs) by Foswiki::Plugins::load at line 183 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins.pm, avg 29µs/call | ||||
76 | 76 | 446µs | my ( $class, $session, $name, $module ) = @_; | ||
77 | 19 | 75µs | ASSERT( UNTAINTED($name), "Name $name is tainted!" ) if DEBUG; # spent 75µs making 19 calls to Assert::ASSERTS_OFF, avg 4µs/call | ||
78 | my $this = bless( | ||||
79 | { | ||||
80 | session => $session, | ||||
81 | name => $name || '', | ||||
82 | module => $module, # if undef, use discovery | ||||
83 | }, | ||||
84 | $class | ||||
85 | ); | ||||
86 | |||||
87 | return $this; | ||||
88 | } | ||||
89 | |||||
90 | =begin TML | ||||
91 | |||||
92 | ---++ ObjectMethod finish() | ||||
93 | Break 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 384µs within Foswiki::Plugin::finish which was called 19 times, avg 20µs/call:
# 19 times (384µs+0s) by Foswiki::Plugins::finish at line 98 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins.pm, avg 20µs/call | ||||
101 | 171 | 407µs | my $this = shift; | ||
102 | |||||
103 | undef $this->{name}; | ||||
104 | undef $this->{topicWeb}; | ||||
105 | undef $this->{module}; | ||||
106 | undef $this->{errors}; | ||||
107 | undef $this->{disabled}; | ||||
108 | undef $this->{no_topic}; | ||||
109 | undef $this->{description}; | ||||
110 | undef $this->{session}; | ||||
111 | } | ||||
112 | |||||
113 | # Load and verify a plugin, invoking any early registration | ||||
114 | # handlers. Return the user resulting from the user handler call. | ||||
115 | # spent 44.3ms (3.05+41.3) within Foswiki::Plugin::load which was called 19 times, avg 2.33ms/call:
# 19 times (3.05ms+41.3ms) by Foswiki::Plugins::load at line 186 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins.pm, avg 2.33ms/call | ||||
116 | 323 | 1.72ms | my ($this) = @_; | ||
117 | my $p = $Foswiki::cfg{Plugins}{ $this->{name} }{Module}; | ||||
118 | |||||
119 | 38 | 1.02ms | if ( defined $p ) { | ||
120 | eval "use $p"; # spent 292µs executing statements in 2 string evals (merged) # includes 1.98ms spent executing 2 calls to 2 subs defined therein. # spent 213µs executing statements in string eval # includes 3.29ms spent executing 1 call to 1 sub defined therein. # spent 176µs executing statements in string eval # includes 854µs spent executing 1 call to 1 sub defined therein. # spent 175µs executing statements in string eval # includes 2.76ms spent executing 1 call to 1 sub defined therein. # spent 171µs executing statements in string eval # includes 1.58ms spent executing 1 call to 1 sub defined therein. # spent 169µs executing statements in string eval # includes 2.85ms spent executing 1 call to 1 sub defined therein. # spent 161µs executing statements in string eval # includes 649µs spent executing 1 call to 1 sub defined therein. # spent 157µs executing statements in string eval # includes 2.64ms spent executing 1 call to 1 sub defined therein. # spent 156µs executing statements in string eval # includes 1.43ms spent executing 1 call to 1 sub defined therein. # spent 151µs executing statements in string eval # includes 2.71ms spent executing 1 call to 1 sub defined therein. # spent 150µs executing statements in string eval # includes 3.82ms spent executing 1 call to 1 sub defined therein. # spent 145µs executing statements in string eval # includes 1.30ms spent executing 1 call to 1 sub defined therein. # spent 144µs executing statements in string eval # includes 2.03ms spent executing 1 call to 1 sub defined therein. # spent 142µs executing statements in string eval # includes 1.43ms spent executing 1 call to 1 sub defined therein. # spent 141µs executing statements in string eval # includes 599µs spent executing 1 call to 1 sub defined therein. # spent 140µs executing statements in string eval # includes 1.78ms spent executing 1 call to 1 sub defined therein. # spent 138µs executing statements in string eval # includes 525µs spent executing 1 call to 1 sub defined therein. # spent 133µs executing statements in string eval # includes 1.78ms spent executing 1 call to 1 sub defined therein. | ||||
121 | 19 | 55µs | if ($@) { | ||
122 | push( | ||||
123 | @{ $this->{errors} }, | ||||
124 | "$p could not be loaded. Errors were:\n$@\n----" | ||||
125 | ); | ||||
126 | $this->{disabled} = 1; | ||||
127 | return; | ||||
128 | } | ||||
129 | else { | ||||
130 | $this->{module} = $p; | ||||
131 | } | ||||
132 | } | ||||
133 | else { | ||||
134 | push( | ||||
135 | @{ $this->{errors} }, | ||||
136 | "$this->{name} could not be loaded. No \$Foswiki::cfg{Plugins}{$this->{name}}{Module} defined - re-run configure\n---" | ||||
137 | ); | ||||
138 | $this->{disabled} = 1; | ||||
139 | return; | ||||
140 | } | ||||
141 | |||||
142 | my $noTopic = eval '$' . $p . '::NO_PREFS_IN_TOPIC'; # spent 8µs executing statements in 2 string evals (merged)
# 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 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 4µs executing statements in string eval
# spent 4µs executing statements in string eval
# spent 4µs executing statements in string eval | ||||
143 | $this->{no_topic} = $noTopic; | ||||
144 | $this->{topicWeb} = undef; # not known yet | ||||
145 | |||||
146 | unless ($noTopic) { | ||||
147 | if ( !$this->topicWeb() ) { | ||||
148 | |||||
149 | # not found | ||||
150 | push( | ||||
151 | @{ $this->{errors} }, | ||||
152 | 'Plugins: could not fully register ' | ||||
153 | . $this->{name} | ||||
154 | . ', no plugin topic' | ||||
155 | ); | ||||
156 | $noTopic = 1; | ||||
157 | } | ||||
158 | } | ||||
159 | |||||
160 | # Get the description from the code, if present. if it's not there, it'll | ||||
161 | # be loaded as a preference from the plugin topic later | ||||
162 | $this->{description} = eval '$' . $p . '::SHORTDESCRIPTION'; # spent 8µ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 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 4µs executing statements in string eval
# spent 3µs executing statements in string eval | ||||
163 | |||||
164 | # Set the session for this call stack | ||||
165 | local $Foswiki::Plugins::SESSION = $this->{session}; | ||||
166 | |||||
167 | my $sub = $p . "::initPlugin"; | ||||
168 | if ( !defined(&$sub) ) { | ||||
169 | push( @{ $this->{errors} }, $sub . ' is not defined' ); | ||||
170 | $this->{disabled} = 1; | ||||
171 | return; | ||||
172 | } | ||||
173 | |||||
174 | $sub = $p . '::earlyInitPlugin'; | ||||
175 | if ( defined(&$sub) ) { | ||||
176 | 2 | 60µs | 2 | 97µs | # spent 60µs (24+36) within Foswiki::Plugin::BEGIN@176 which was called:
# once (24µs+36µs) by Foswiki::Plugins::BEGIN@21 at line 176 # spent 60µs making 1 call to Foswiki::Plugin::BEGIN@176
# spent 36µs making 1 call to strict::unimport |
177 | my $error = &$sub(); | ||||
178 | 2 | 127µs | 2 | 74µs | # spent 45µs (15+29) within Foswiki::Plugin::BEGIN@178 which was called:
# once (15µs+29µs) by Foswiki::Plugins::BEGIN@21 at line 178 # spent 45µs making 1 call to Foswiki::Plugin::BEGIN@178
# spent 29µs making 1 call to strict::import |
179 | if ($error) { | ||||
180 | push( @{ $this->{errors} }, $sub . ' failed: ' . $error ); | ||||
181 | $this->{disabled} = 1; | ||||
182 | return; | ||||
183 | } | ||||
184 | } | ||||
185 | |||||
186 | my $user; | ||||
187 | $sub = $p . '::initializeUserHandler'; | ||||
188 | if ( defined(&$sub) ) { | ||||
189 | 2 | 81µs | 2 | 78µs | # spent 48µs (19+29) within Foswiki::Plugin::BEGIN@189 which was called:
# once (19µs+29µs) by Foswiki::Plugins::BEGIN@21 at line 189 # spent 48µs making 1 call to Foswiki::Plugin::BEGIN@189
# spent 29µs making 1 call to strict::unimport |
190 | $user = &$sub( | ||||
191 | $this->{session}->{remoteUser}, | ||||
192 | $this->{session}->{request}->url(), | ||||
193 | $this->{session}->{request}->path_info() | ||||
194 | ); | ||||
195 | 2 | 297µs | 2 | 71µs | # spent 43µs (15+28) within Foswiki::Plugin::BEGIN@195 which was called:
# once (15µs+28µs) by Foswiki::Plugins::BEGIN@21 at line 195 # spent 43µs making 1 call to Foswiki::Plugin::BEGIN@195
# spent 28µs making 1 call to strict::import |
196 | } | ||||
197 | |||||
198 | #print STDERR "Compile $p: ".timestr(timediff(new Benchmark, $begin))."\n"; | ||||
199 | |||||
200 | return $user; | ||||
201 | } | ||||
202 | |||||
203 | # register plugin settings | ||||
204 | # spent 158µs within Foswiki::Plugin::registerSettings which was called 19 times, avg 8µs/call:
# 19 times (158µs+0s) by Foswiki::Plugins::settings at line 229 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins.pm, avg 8µs/call | ||||
205 | 76 | 181µs | my ( $this, $plugins ) = @_; | ||
206 | |||||
207 | return if $this->{disabled}; | ||||
208 | |||||
209 | my $prefs = $this->{session}->{prefs}; | ||||
210 | if ( !$this->{no_topic} ) { | ||||
211 | $prefs->setPluginPreferences( $this->topicWeb(), $this->{name} ); | ||||
212 | } | ||||
213 | } | ||||
214 | |||||
215 | # invoke plugin initialisation and register handlers. | ||||
216 | # spent 81.2s (6.82ms+81.2) within Foswiki::Plugin::registerHandlers which was called 19 times, avg 4.27s/call:
# 19 times (6.82ms+81.2s) by Foswiki::Plugins::enable at line 259 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins.pm, avg 4.27s/call | ||||
217 | 228 | 2.88ms | my ( $this, $plugins ) = @_; | ||
218 | |||||
219 | return if $this->{disabled}; | ||||
220 | |||||
221 | my $p = $this->{module}; | ||||
222 | my $sub = $p . "::initPlugin"; | ||||
223 | my $users = $Foswiki::Plugins::SESSION->{users}; | ||||
224 | my $status = 0; | ||||
225 | my $exception = ''; | ||||
226 | # spent 81.2s (575µs+81.2) within Foswiki::Plugin::__ANON__[/usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugin.pm:235] which was called 19 times, avg 4.27s/call:
# 19 times (575µs+81.2s) by Error::subs::try at line 416 of Error.pm, avg 4.27s/call | ||||
227 | 2 | 99µs | 2 | 74µs | # spent 45µs (16+29) within Foswiki::Plugin::BEGIN@227 which was called:
# once (16µs+29µs) by Foswiki::Plugins::BEGIN@21 at line 227 # spent 45µs making 1 call to Foswiki::Plugin::BEGIN@227
# spent 29µs making 1 call to strict::unimport |
228 | 19 | 579µs | 57 | 81.2s | $status = &$sub( # spent 60.9s making 1 call to Foswiki::Plugins::InterwikiPlugin::initPlugin
# spent 20.3s making 1 call to Foswiki::Plugins::SmiliesPlugin::initPlugin
# spent 9.16ms making 1 call to Foswiki::Plugins::JQueryPlugin::initPlugin
# spent 3.23ms making 1 call to Foswiki::Plugins::CommentPlugin::initPlugin
# spent 1.04ms making 1 call to Foswiki::Plugins::TwistyPlugin::initPlugin
# spent 745µs making 19 calls to Foswiki::Users::getLoginName, avg 39µs/call
# spent 583µs making 1 call to Foswiki::Plugins::WysiwygPlugin::initPlugin
# spent 491µs making 1 call to Foswiki::Plugins::TinyMCEPlugin::initPlugin
# spent 359µs making 1 call to Foswiki::Plugins::SpreadSheetPlugin::initPlugin
# spent 300µs making 1 call to Foswiki::Plugins::EditTablePlugin::initPlugin
# spent 273µs making 1 call to Foswiki::Plugins::AutoViewTemplatePlugin::initPlugin
# spent 195µs making 1 call to Foswiki::Plugins::TablePlugin::initPlugin
# spent 181µs making 19 calls to Foswiki::Plugin::topicWeb, avg 10µs/call
# spent 114µs making 1 call to Foswiki::Plugins::SubscribePlugin::initPlugin
# spent 97µs making 1 call to Foswiki::Plugins::MailerContribPlugin::initPlugin
# spent 81µs making 1 call to Foswiki::Plugins::HistoryPlugin::initPlugin
# spent 80µs making 1 call to Foswiki::Plugins::UpdatesPlugin::initPlugin
# spent 70µs making 1 call to Foswiki::Plugins::RenderListPlugin::initPlugin
# spent 21µs making 1 call to Foswiki::Plugins::SlideShowPlugin::initPlugin
# spent 18µs making 1 call to Foswiki::Plugins::PreferencesPlugin::initPlugin
# spent 14µs making 1 call to Foswiki::Plugins::CompareRevisionsAddonPlugin::initPlugin |
229 | $Foswiki::Plugins::SESSION->{topicName}, | ||||
230 | $Foswiki::Plugins::SESSION->{webName}, | ||||
231 | $users->getLoginName( $Foswiki::Plugins::SESSION->{user} ), | ||||
232 | $this->topicWeb() | ||||
233 | ); | ||||
234 | 2 | 532µs | 2 | 73µs | # spent 44µs (15+29) within Foswiki::Plugin::BEGIN@234 which was called:
# once (15µs+29µs) by Foswiki::Plugins::BEGIN@21 at line 234 # spent 44µs making 1 call to Foswiki::Plugin::BEGIN@234
# spent 29µs making 1 call to strict::import |
235 | } | ||||
236 | catch Foswiki::AccessControlException with { | ||||
237 | shift->throw(); # propagate | ||||
238 | } | ||||
239 | catch Foswiki::OopsException with { | ||||
240 | shift->throw(); # propagate | ||||
241 | } | ||||
242 | catch Foswiki::ValidationException with { | ||||
243 | shift->throw(); # propagate | ||||
244 | } | ||||
245 | otherwise { | ||||
246 | my $e = shift; | ||||
247 | $exception = $e->text() . ' ' . $e->stacktrace(); | ||||
248 | 152 | 1.40ms | }; # spent 757µs making 57 calls to Error::catch, avg 13µs/call
# spent 390µs making 19 calls to Error::subs::otherwise, avg 21µs/call
# spent 252µs making 57 calls to Error::subs::with, avg 4µs/call
# spent 81.2s making 19 calls to Error::subs::try, avg 4.27s/call, recursion: max depth 1, sum of overlapping time 81.2s | ||
249 | |||||
250 | unless ($status) { | ||||
251 | if ( !$exception ) { | ||||
252 | $exception = <<MESSAGE; | ||||
253 | $sub did not return true. | ||||
254 | Check your Foswiki warning and error logs for more information. | ||||
255 | MESSAGE | ||||
256 | } | ||||
257 | push( @{ $this->{errors} }, $exception ); | ||||
258 | $this->{disabled} = 1; | ||||
259 | return; | ||||
260 | } | ||||
261 | |||||
262 | my $compat = eval '\%' . $p . '::FoswikiCompatibility'; # spent 11µs executing statements in 2 string evals (merged)
# spent 10µs executing statements in string eval
# spent 10µs executing statements in string eval
# spent 7µs executing statements in string eval
# spent 6µs executing statements in string eval
# spent 6µs executing statements in string eval
# spent 6µs executing statements in string eval
# spent 5µs executing statements in string eval
# spent 5µs executing statements in string eval
# spent 5µs executing statements in string eval
# spent 5µs executing statements in string eval
# spent 5µs executing statements in string eval
# spent 5µs executing statements in string eval
# spent 5µs executing statements in string eval
# spent 5µs executing statements in string eval
# spent 5µs executing statements in string eval
# spent 5µs executing statements in string eval
# spent 5µs executing statements in string eval | ||||
263 | foreach my $h (@registrableHandlers) { | ||||
264 | 1178 | 3.21ms | my $sub = $p . '::' . $h; | ||
265 | 85 | 357µs | if ( defined(&$sub) ) { | ||
266 | 1 | 2µs | if ( $deprecated{$h} | ||
267 | && $compat | ||||
268 | && $compat->{$h} | ||||
269 | && $compat->{$h} <= $Foswiki::Plugins::VERSION ) | ||||
270 | { | ||||
271 | |||||
272 | # Compatibility handler not required in this version | ||||
273 | next; | ||||
274 | } | ||||
275 | 42 | 540µs | $plugins->addListener( $h, $this ); # spent 540µs making 42 calls to Foswiki::Plugins::addListener, avg 13µs/call | ||
276 | } | ||||
277 | } | ||||
278 | 19 | 249µs | $this->{session}->enterContext( $this->{name} . 'Enabled' ); # spent 249µs making 19 calls to Foswiki::enterContext, avg 13µs/call | ||
279 | } | ||||
280 | |||||
281 | # Invoke a handler | ||||
282 | # spent 367ms (137+230) within Foswiki::Plugin::invoke which was called 10316 times, avg 36µs/call:
# 10316 times (137ms+230ms) by Foswiki::Plugins::dispatch at line 331 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugins.pm, avg 36µs/call | ||||
283 | 41264 | 158ms | my $this = shift; # remove from parameter vector | ||
284 | my $handlerName = shift; | ||||
285 | my $handler = $this->{module} . '::' . $handlerName; | ||||
286 | 2 | 68µs | 2 | 78µs | # spent 48µs (17+30) within Foswiki::Plugin::BEGIN@286 which was called:
# once (17µs+30µs) by Foswiki::Plugins::BEGIN@21 at line 286 # spent 48µs making 1 call to Foswiki::Plugin::BEGIN@286
# spent 30µs making 1 call to strict::unimport |
287 | 10316 | 230ms | return &$handler(@_); # spent 49.3ms making 5 calls to Foswiki::Plugins::TablePlugin::preRenderingHandler, avg 9.86ms/call
# spent 32.8ms making 1131 calls to Foswiki::Plugins::TablePlugin::afterCommonTagsHandler, avg 29µs/call
# spent 30.1ms making 1131 calls to Foswiki::Plugins::WysiwygPlugin::beforeCommonTagsHandler, avg 27µs/call
# spent 19.4ms making 1151 calls to Foswiki::Plugins::SpreadSheetPlugin::commonTagsHandler, avg 17µs/call
# spent 17.0ms making 1131 calls to Foswiki::Plugins::PreferencesPlugin::beforeCommonTagsHandler, avg 15µs/call
# spent 16.7ms making 1151 calls to Foswiki::Plugins::CompareRevisionsAddonPlugin::commonTagsHandler, avg 14µs/call
# spent 15.3ms making 1131 calls to Foswiki::Plugins::EditTablePlugin::beforeCommonTagsHandler, avg 14µs/call
# spent 14.1ms making 1151 calls to Foswiki::Plugins::SmiliesPlugin::commonTagsHandler, avg 12µs/call
# spent 14.1ms making 1151 calls to Foswiki::Plugins::SlideShowPlugin::commonTagsHandler, avg 12µs/call
# spent 13.9ms making 1151 calls to Foswiki::Plugins::EditTablePlugin::commonTagsHandler, avg 12µs/call
# spent 5.79ms making 5 calls to Foswiki::Plugins::SmiliesPlugin::preRenderingHandler, avg 1.16ms/call
# spent 1.02ms making 5 calls to Foswiki::Plugins::InterwikiPlugin::preRenderingHandler, avg 203µs/call
# spent 235µs making 1 call to Foswiki::Plugins::JQueryPlugin::modifyHeaderHandler
# spent 160µs making 5 calls to Foswiki::Plugins::EditTablePlugin::postRenderingHandler, avg 32µs/call
# spent 159µs making 5 calls to Foswiki::Plugins::RenderListPlugin::startRenderingHandler, avg 32µs/call
# spent 141µs making 5 calls to Foswiki::Plugins::PreferencesPlugin::postRenderingHandler, avg 28µs/call
# spent 94µs making 1 call to Foswiki::Plugins::WysiwygPlugin::modifyHeaderHandler
# spent 40µs making 5 calls to Foswiki::Plugins::WysiwygPlugin::postRenderingHandler, avg 8µs/call | ||
288 | 2 | 76µs | 2 | 72µs | # spent 44µs (16+28) within Foswiki::Plugin::BEGIN@288 which was called:
# once (16µs+28µs) by Foswiki::Plugins::BEGIN@21 at line 288 # spent 44µs making 1 call to Foswiki::Plugin::BEGIN@288
# spent 28µs making 1 call to strict::import |
289 | } | ||||
290 | |||||
291 | # Get the VERSION number of the specified plugin. | ||||
292 | # SMELL: may die if the plugin doesn't compile | ||||
293 | sub getVersion { | ||||
294 | my $this = shift; | ||||
295 | |||||
296 | 2 | 65µs | 2 | 71µs | # spent 43µs (16+28) within Foswiki::Plugin::BEGIN@296 which was called:
# once (16µs+28µs) by Foswiki::Plugins::BEGIN@21 at line 296 # spent 43µs making 1 call to Foswiki::Plugin::BEGIN@296
# spent 28µs making 1 call to strict::unimport |
297 | return ${ $this->{module} . '::VERSION' } || ''; | ||||
298 | 2 | 88µs | 2 | 71µs | # spent 43µs (15+28) within Foswiki::Plugin::BEGIN@298 which was called:
# once (15µs+28µs) by Foswiki::Plugins::BEGIN@21 at line 298 # spent 43µs making 1 call to Foswiki::Plugin::BEGIN@298
# spent 28µs making 1 call to strict::import |
299 | } | ||||
300 | |||||
301 | # Get the RELEASE of the specified plugin. | ||||
302 | # SMELL: may die if the plugin doesn't compile | ||||
303 | sub getRelease { | ||||
304 | my $this = shift; | ||||
305 | |||||
306 | 2 | 68µs | 2 | 77µs | # spent 49µs (20+28) within Foswiki::Plugin::BEGIN@306 which was called:
# once (20µs+28µs) by Foswiki::Plugins::BEGIN@21 at line 306 # spent 49µs making 1 call to Foswiki::Plugin::BEGIN@306
# spent 28µs making 1 call to strict::unimport |
307 | return ${ $this->{module} . '::RELEASE' } || ''; | ||||
308 | 2 | 493µs | 2 | 71µs | # spent 43µs (15+28) within Foswiki::Plugin::BEGIN@308 which was called:
# once (15µs+28µs) by Foswiki::Plugins::BEGIN@21 at line 308 # spent 43µs making 1 call to Foswiki::Plugin::BEGIN@308
# spent 28µs making 1 call to strict::import |
309 | } | ||||
310 | |||||
311 | # Get the description string for the given plugin | ||||
312 | sub getDescription { | ||||
313 | my $this = shift; | ||||
314 | |||||
315 | unless ( defined $this->{description} ) { | ||||
316 | my $pref = uc( $this->{name} ) . '_SHORTDESCRIPTION'; | ||||
317 | my $prefs = $this->{session}->{prefs}; | ||||
318 | $this->{description} = $prefs->getPreference($pref) || ''; | ||||
319 | } | ||||
320 | if ( $this->{disabled} ) { | ||||
321 | return ' !' . $this->{name} . ': (disabled)'; | ||||
322 | } | ||||
323 | |||||
324 | my $release = $this->getRelease(); | ||||
325 | my $version = $this->getVersion(); | ||||
326 | $version =~ s/\$Rev: (\d+) \$/$1/g; | ||||
327 | $version = $release . ', ' . $version if $release; | ||||
328 | |||||
329 | my $web = $this->topicWeb(); | ||||
330 | my $result = ' ' . ( $web ? "$web." : '!' ) . $this->{name} . ' '; | ||||
331 | $result .= CGI::span( { class => 'foswikiGrayText foswikiSmall' }, | ||||
332 | '(' . $version . ')' ); | ||||
333 | $result .= ': ' . $this->{description}; | ||||
334 | return $result; | ||||
335 | } | ||||
336 | |||||
337 | =begin TML | ||||
338 | |||||
339 | ---++ ObjectMethod topicWeb() -> $webname | ||||
340 | |||||
341 | Find the web that has the topic for this plugin by searching the | ||||
342 | {Plugins}{WebSearchPath}. Returns undef if $NO_PREFS_IN_TOPIC=1 | ||||
343 | |||||
344 | =cut | ||||
345 | |||||
346 | # spent 181µs within Foswiki::Plugin::topicWeb which was called 19 times, avg 10µs/call:
# 19 times (181µs+0s) by Foswiki::Plugin::__ANON__[/usr/local/src/github.com/foswiki/core/lib/Foswiki/Plugin.pm:235] at line 228, avg 10µs/call | ||||
347 | 57 | 220µs | my $this = shift; | ||
348 | |||||
349 | unless ( defined( $this->{topicWeb} ) || $this->{no_topic} ) { | ||||
350 | |||||
351 | # Find the plugin topic, if required | ||||
352 | my $session = $this->{session}; | ||||
353 | |||||
354 | foreach | ||||
355 | my $web ( split( /[, ]+/, $Foswiki::cfg{Plugins}{WebSearchPath} ), | ||||
356 | $session->{webName} ) | ||||
357 | { | ||||
358 | if ( $session->topicExists( $web, $this->{name} ) ) { | ||||
359 | $this->{topicWeb} = $web; | ||||
360 | last; | ||||
361 | } | ||||
362 | } | ||||
363 | } | ||||
364 | |||||
365 | # If there is no web (probably because NO_PREFS_IN_TOPIC is set) | ||||
366 | # then default to the system web name. | ||||
367 | return $this->{topicWeb} || $Foswiki::cfg{SystemWebName}; | ||||
368 | } | ||||
369 | |||||
370 | 1 | 12µs | 1; | ||
371 | __END__ |