Filename | /var/www/foswikidev/core/lib/Foswiki/Plugin.pm |
Statements | Executed 11923 statements in 19.6ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1632 | 1 | 1 | 9.64ms | 37.7ms | invoke (recurses: max depth 1, inclusive time 136µs) | Foswiki::Plugin::
42 | 1 | 1 | 5.31ms | 65.6ms | registerHandlers | Foswiki::Plugin::
42 | 1 | 1 | 2.27ms | 117ms | new | Foswiki::Plugin::
42 | 1 | 1 | 1.84ms | 2.87ms | load | Foswiki::Plugin::
1 | 1 | 1 | 822µs | 900µs | BEGIN@15 | Foswiki::Plugin::
42 | 1 | 1 | 443µs | 59.0ms | __ANON__[:257] | Foswiki::Plugin::
1 | 1 | 1 | 357µs | 402µs | BEGIN@14 | Foswiki::Plugin::
42 | 1 | 1 | 354µs | 354µs | finish | Foswiki::Plugin::
1 | 1 | 1 | 247µs | 293µs | BEGIN@16 | Foswiki::Plugin::
56 | 3 | 1 | 219µs | 801µs | topicWeb | Foswiki::Plugin::
42 | 1 | 1 | 106µs | 11.9ms | registerSettings | Foswiki::Plugin::
1 | 1 | 1 | 12µs | 25µs | BEGIN@8 | Foswiki::Plugin::
1 | 1 | 1 | 12µs | 110µs | BEGIN@11 | Foswiki::Plugin::
1 | 1 | 1 | 11µs | 34µs | BEGIN@10 | Foswiki::Plugin::
1 | 1 | 1 | 10µs | 19µs | BEGIN@217 | Foswiki::Plugin::
1 | 1 | 1 | 10µs | 21µs | BEGIN@249 | Foswiki::Plugin::
1 | 1 | 1 | 10µs | 19µs | BEGIN@256 | Foswiki::Plugin::
1 | 1 | 1 | 9µs | 22µs | BEGIN@122 | Foswiki::Plugin::
1 | 1 | 1 | 8µs | 20µs | BEGIN@197 | Foswiki::Plugin::
1 | 1 | 1 | 8µs | 18µs | BEGIN@211 | Foswiki::Plugin::
1 | 1 | 1 | 8µs | 12µs | BEGIN@9 | Foswiki::Plugin::
1 | 1 | 1 | 8µs | 18µs | BEGIN@309 | Foswiki::Plugin::
1 | 1 | 1 | 8µs | 17µs | BEGIN@124 | Foswiki::Plugin::
1 | 1 | 1 | 7µs | 16µs | BEGIN@199 | Foswiki::Plugin::
1 | 1 | 1 | 7µs | 16µs | BEGIN@329 | Foswiki::Plugin::
1 | 1 | 1 | 7µs | 16µs | BEGIN@319 | Foswiki::Plugin::
1 | 1 | 1 | 7µs | 15µs | BEGIN@331 | Foswiki::Plugin::
1 | 1 | 1 | 7µs | 15µs | BEGIN@311 | Foswiki::Plugin::
1 | 1 | 1 | 7µs | 15µs | BEGIN@321 | Foswiki::Plugin::
1 | 1 | 1 | 4µs | 4µs | BEGIN@13 | Foswiki::Plugin::
1 | 1 | 1 | 4µs | 4µs | BEGIN@18 | Foswiki::Plugin::
0 | 0 | 0 | 0s | 0s | __ANON__[:260] | Foswiki::Plugin::
0 | 0 | 0 | 0s | 0s | __ANON__[:263] | Foswiki::Plugin::
0 | 0 | 0 | 0s | 0s | __ANON__[:266] | Foswiki::Plugin::
0 | 0 | 0 | 0s | 0s | __ANON__[:270] | 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 | 25µs | 2 | 37µs | # spent 25µs (12+12) within Foswiki::Plugin::BEGIN@8 which was called:
# once (12µs+12µs) by Foswiki::Plugins::BEGIN@21 at line 8 # spent 25µs making 1 call to Foswiki::Plugin::BEGIN@8
# spent 12µs making 1 call to strict::import |
9 | 2 | 24µs | 2 | 16µs | # spent 12µs (8+4) within Foswiki::Plugin::BEGIN@9 which was called:
# once (8µs+4µs) by Foswiki::Plugins::BEGIN@21 at line 9 # spent 12µs making 1 call to Foswiki::Plugin::BEGIN@9
# spent 4µs making 1 call to warnings::import |
10 | 2 | 27µs | 2 | 58µs | # spent 34µs (11+23) within Foswiki::Plugin::BEGIN@10 which was called:
# once (11µs+23µs) by Foswiki::Plugins::BEGIN@21 at line 10 # spent 34µs making 1 call to Foswiki::Plugin::BEGIN@10
# spent 23µs making 1 call to Exporter::import |
11 | 2 | 29µs | 2 | 209µs | # spent 110µs (12+98) within Foswiki::Plugin::BEGIN@11 which was called:
# once (12µs+98µs) by Foswiki::Plugins::BEGIN@21 at line 11 # spent 110µs making 1 call to Foswiki::Plugin::BEGIN@11
# spent 98µs making 1 call to Error::import |
12 | |||||
13 | 2 | 19µs | 1 | 4µs | # spent 4µs within Foswiki::Plugin::BEGIN@13 which was called:
# once (4µs+0s) by Foswiki::Plugins::BEGIN@21 at line 13 # spent 4µs making 1 call to Foswiki::Plugin::BEGIN@13 |
14 | 2 | 130µs | 1 | 402µs | # spent 402µs (357+46) within Foswiki::Plugin::BEGIN@14 which was called:
# once (357µs+46µs) by Foswiki::Plugins::BEGIN@21 at line 14 # spent 402µs making 1 call to Foswiki::Plugin::BEGIN@14 |
15 | 2 | 123µs | 1 | 900µs | # spent 900µs (822+78) within Foswiki::Plugin::BEGIN@15 which was called:
# once (822µs+78µs) by Foswiki::Plugins::BEGIN@21 at line 15 # spent 900µs making 1 call to Foswiki::Plugin::BEGIN@15 |
16 | 2 | 111µs | 1 | 293µs | # spent 293µs (247+46) within Foswiki::Plugin::BEGIN@16 which was called:
# once (247µs+46µs) by Foswiki::Plugins::BEGIN@21 at line 16 # spent 293µs making 1 call to Foswiki::Plugin::BEGIN@16 |
17 | |||||
18 | # spent 4µs within Foswiki::Plugin::BEGIN@18 which was called:
# once (4µs+0s) by Foswiki::Plugins::BEGIN@21 at line 23 | ||||
19 | 1 | 5µs | if ( $Foswiki::cfg{UseLocale} ) { | ||
20 | require locale; | ||||
21 | import locale(); | ||||
22 | } | ||||
23 | 1 | 249µs | 1 | 4µs | } # spent 4µs making 1 call to Foswiki::Plugin::BEGIN@18 |
24 | |||||
25 | 1 | 5µs | our @registrableHandlers = ( # Foswiki::Plugins::VERSION: | ||
26 | 'afterAttachmentSaveHandler', # 1.022 DEPRECATED | ||||
27 | 'afterUploadHandler', # 2.1 | ||||
28 | 'afterCommonTagsHandler', # 1.024 | ||||
29 | 'afterEditHandler', # 1.010 | ||||
30 | 'afterRenameHandler', # 1.110 | ||||
31 | 'afterSaveHandler', # 1.020 | ||||
32 | 'beforeAttachmentSaveHandler', # 1.022 DEPRECATED | ||||
33 | 'beforeCommonTagsHandler', # 1.024 | ||||
34 | 'beforeEditHandler', # 1.010 | ||||
35 | 'beforeMergeHandler', # 1.200 | ||||
36 | 'beforeSaveHandler', # 1.010 | ||||
37 | 'beforeUploadHandler', # 2.1 | ||||
38 | 'commonTagsHandler', # 1.000 | ||||
39 | 'completePageHandler', # 1.100 | ||||
40 | 'earlyInitPlugin', # 1.020 | ||||
41 | 'endRenderingHandler', # 1.000 DEPRECATED | ||||
42 | 'finishPlugin', # 2.100 | ||||
43 | 'initPlugin', # 1.000 | ||||
44 | 'initializeUserHandler', # 1.010 | ||||
45 | 'insidePREHandler', # 1.000 DEPRECATED | ||||
46 | 'modifyHeaderHandler', # 1.026 | ||||
47 | 'mergeHandler', # 1.026 | ||||
48 | 'outsidePREHandler', # 1.000 DEPRECATED | ||||
49 | 'postRenderingHandler', # 1.026 | ||||
50 | 'preRenderingHandler', # 1.026 | ||||
51 | 'redirectCgiQueryHandler', # 1.010 DEPRECATED | ||||
52 | 'registrationHandler', # 1.010 | ||||
53 | 'renderFormFieldForEditHandler', # ? | ||||
54 | 'renderWikiWordHandler', # 1.023 | ||||
55 | 'startRenderingHandler', # 1.000 DEPRECATED | ||||
56 | 'validateRegistrationHandler', # 2.3 | ||||
57 | 'writeHeaderHandler', # 1.010 DEPRECATED | ||||
58 | ); | ||||
59 | |||||
60 | # deprecated handlers | ||||
61 | 1 | 4µs | our %deprecated = ( | ||
62 | afterAttachmentSaveHandler => 1, | ||||
63 | beforeAttachmentSaveHandler => 1, | ||||
64 | endRenderingHandler => 1, | ||||
65 | insidePREHandler => 1, | ||||
66 | outsidePREHandler => 1, | ||||
67 | redirectCgiQueryHandler => 1, | ||||
68 | startRenderingHandler => 1, | ||||
69 | writeHeaderHandler => 1, | ||||
70 | ); | ||||
71 | |||||
72 | =begin TML | ||||
73 | |||||
74 | ---++ ClassMethod new( $session, $name, [, $module] ) | ||||
75 | |||||
76 | * =$session= - Foswiki object | ||||
77 | * =$name= - name of the plugin e.g. MyPlugin | ||||
78 | * =$module= - name of implementing package; optional, used for tests. | ||||
79 | Normally =load= is used to discover the module from the config. | ||||
80 | |||||
81 | =cut | ||||
82 | |||||
83 | # spent 117ms (2.27+115) within Foswiki::Plugin::new which was called 42 times, avg 2.80ms/call:
# 42 times (2.27ms+115ms) by Foswiki::Plugins::preload at line 195 of /var/www/foswikidev/core/lib/Foswiki/Plugins.pm, avg 2.80ms/call | ||||
84 | 42 | 42µs | my ( $class, $session, $name, $module ) = @_; | ||
85 | ASSERT( UNTAINTED($name), "Name $name is tainted!" ) if DEBUG; | ||||
86 | 42 | 202µs | my $this = bless( | ||
87 | { | ||||
88 | session => $session, | ||||
89 | name => $name || '', | ||||
90 | module => $module, # if undef, use discovery | ||||
91 | errors => [] | ||||
92 | }, | ||||
93 | $class | ||||
94 | ); | ||||
95 | |||||
96 | 42 | 54µs | my $p = $Foswiki::cfg{Plugins}{$name}{Module}; | ||
97 | |||||
98 | 42 | 10µs | unless ($p) { | ||
99 | 20 | 6µs | $p = "Foswiki::Plugins::$name"; | ||
100 | push( | ||||
101 | 20 | 4µs | @{ $this->{errors} }, | ||
102 | "$p has been guessed. '\$Foswiki::cfg{Plugins}{$name}{Module}' should be defined in LocalSite.cfg" | ||||
103 | ) if DEBUG; | ||||
104 | } | ||||
105 | |||||
106 | 42 | 1.41ms | eval "use $p"; # spent 223µs executing statements in 2 string evals (merged) # includes 1.75ms spent executing 2 calls to 2 subs defined therein. # spent 200µs executing statements in 2 string evals (merged) # includes 2.40ms spent executing 2 calls to 2 subs defined therein. # spent 182µs executing statements in 2 string evals (merged) # includes 1.56ms spent executing 2 calls to 2 subs defined therein. # spent 121µs executing statements in string eval # includes 7.75ms spent executing 1 call to 1 sub defined therein. # spent 116µs executing statements in string eval # includes 409µs spent executing 1 call to 1 sub defined therein. # spent 116µs executing statements in string eval # includes 2.65ms spent executing 1 call to 1 sub defined therein. # spent 114µs executing statements in string eval # includes 759µs spent executing 1 call to 1 sub defined therein. # spent 113µs executing statements in 2 string evals (merged) # includes 1.07ms spent executing 2 calls to 2 subs defined therein. # spent 109µs executing statements in string eval # includes 726µs spent executing 1 call to 1 sub defined therein. # spent 106µs executing statements in string eval # includes 1.65ms spent executing 1 call to 1 sub defined therein. # spent 102µs executing statements in string eval # includes 627µs spent executing 1 call to 1 sub defined therein. # spent 101µs executing statements in string eval # includes 1.93ms spent executing 1 call to 1 sub defined therein. # spent 100µs executing statements in string eval # includes 2.54ms spent executing 1 call to 1 sub defined therein. # spent 100µs executing statements in string eval # includes 486µs spent executing 1 call to 1 sub defined therein. # spent 99µs executing statements in string eval # includes 1.41ms spent executing 1 call to 1 sub defined therein. # spent 98µs executing statements in string eval # includes 559µs spent executing 1 call to 1 sub defined therein. # spent 98µs executing statements in string eval # includes 910µs spent executing 1 call to 1 sub defined therein. # spent 97µs executing statements in string eval # includes 1.40ms spent executing 1 call to 1 sub defined therein. # spent 96µs executing statements in string eval # includes 512µs spent executing 1 call to 1 sub defined therein. # spent 94µs executing statements in string eval # includes 381µs spent executing 1 call to 1 sub defined therein. # spent 94µs executing statements in string eval # includes 1.21ms spent executing 1 call to 1 sub defined therein. # spent 93µs executing statements in string eval # includes 2.02ms spent executing 1 call to 1 sub defined therein. # spent 93µs executing statements in string eval # includes 1.76ms spent executing 1 call to 1 sub defined therein. # spent 92µs executing statements in string eval # includes 5.52ms spent executing 1 call to 1 sub defined therein. # spent 92µs executing statements in string eval # includes 774µs spent executing 1 call to 1 sub defined therein. # spent 92µs executing statements in string eval # includes 1.18ms spent executing 1 call to 1 sub defined therein. # spent 91µs executing statements in string eval # includes 1.53ms spent executing 1 call to 1 sub defined therein. # spent 91µs executing statements in string eval # includes 1.15ms spent executing 1 call to 1 sub defined therein. # spent 90µs executing statements in string eval # includes 366µs spent executing 1 call to 1 sub defined therein. # spent 90µs executing statements in string eval # includes 1.08ms spent executing 1 call to 1 sub defined therein. # spent 90µs executing statements in string eval # includes 1.39ms spent executing 1 call to 1 sub defined therein. # spent 89µs executing statements in string eval # includes 2.73ms spent executing 1 call to 1 sub defined therein. # spent 88µs executing statements in string eval # includes 859µs spent executing 1 call to 1 sub defined therein. # spent 86µs executing statements in string eval # includes 261µs spent executing 1 call to 1 sub defined therein. # spent 84µs executing statements in string eval # includes 194µs spent executing 1 call to 1 sub defined therein. # spent 83µs executing statements in string eval # includes 235µs spent executing 1 call to 1 sub defined therein. # spent 82µs executing statements in string eval # includes 387µs spent executing 1 call to 1 sub defined therein. # spent 81µs executing statements in string eval # includes 409µs spent executing 1 call to 1 sub defined therein. | ||
107 | 42 | 17µs | if ($@) { | ||
108 | push( | ||||
109 | @{ $this->{errors} }, | ||||
110 | "$p could not be loaded. Errors were:\n$@\n----" | ||||
111 | ); | ||||
112 | $this->{disabled} = 1; | ||||
113 | $this->{reason} = 'no_load_plugin'; | ||||
114 | } | ||||
115 | else { | ||||
116 | 42 | 49µs | $this->{module} = $p; | ||
117 | } | ||||
118 | 42 | 24µs | my $fn = "${p}::preload"; | ||
119 | 42 | 125µs | if ( !$this->{disabled} && defined &$fn ) { | ||
120 | |||||
121 | # A preload handler can simply die if it doesn't like what it sees | ||||
122 | 2 | 37µs | 2 | 35µs | # spent 22µs (9+13) within Foswiki::Plugin::BEGIN@122 which was called:
# once (9µs+13µs) by Foswiki::Plugins::BEGIN@21 at line 122 # spent 22µs making 1 call to Foswiki::Plugin::BEGIN@122
# spent 13µs making 1 call to strict::unimport |
123 | &$fn($session); | ||||
124 | 2 | 267µs | 2 | 26µs | # spent 17µs (8+9) within Foswiki::Plugin::BEGIN@124 which was called:
# once (8µs+9µs) by Foswiki::Plugins::BEGIN@21 at line 124 # spent 17µs making 1 call to Foswiki::Plugin::BEGIN@124
# spent 9µs making 1 call to strict::import |
125 | } | ||||
126 | |||||
127 | 42 | 148µs | return $this; | ||
128 | } | ||||
129 | |||||
130 | =begin TML | ||||
131 | |||||
132 | ---++ ObjectMethod finish() | ||||
133 | Break circular references. | ||||
134 | |||||
135 | =cut | ||||
136 | |||||
137 | # Note to developers; please undef *all* fields in the object explicitly, | ||||
138 | # whether they are references or not. That way this method is "golden | ||||
139 | # documentation" of the live fields in the object. | ||||
140 | # spent 354µs within Foswiki::Plugin::finish which was called 42 times, avg 8µs/call:
# 42 times (354µs+0s) by Foswiki::Plugins::finish at line 113 of /var/www/foswikidev/core/lib/Foswiki/Plugins.pm, avg 8µs/call | ||||
141 | 42 | 8µs | my $this = shift; | ||
142 | |||||
143 | 42 | 80µs | undef $this->{name}; | ||
144 | 42 | 22µs | undef $this->{topicWeb}; | ||
145 | 42 | 56µs | undef $this->{module}; | ||
146 | 42 | 47µs | undef $this->{errors}; | ||
147 | 42 | 56µs | undef $this->{disabled}; | ||
148 | 42 | 10µs | undef $this->{reason}; | ||
149 | 42 | 8µs | undef $this->{no_topic}; | ||
150 | 42 | 27µs | undef $this->{description}; | ||
151 | 42 | 73µs | undef $this->{session}; | ||
152 | } | ||||
153 | |||||
154 | # Load and verify a plugin, invoking any early registration | ||||
155 | # handlers. Return the user resulting from the user handler call. | ||||
156 | # spent 2.87ms (1.84+1.03) within Foswiki::Plugin::load which was called 42 times, avg 68µs/call:
# 42 times (1.84ms+1.03ms) by Foswiki::Plugins::load at line 230 of /var/www/foswikidev/core/lib/Foswiki/Plugins.pm, avg 68µs/call | ||||
157 | 42 | 16µs | my ($this) = @_; | ||
158 | |||||
159 | 42 | 16µs | return if $this->{disabled}; | ||
160 | |||||
161 | 42 | 669µs | my $noTopic = eval '$' . $this->{module} . '::NO_PREFS_IN_TOPIC'; # spent 6µs executing statements in string eval
# spent 4µ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 3µs executing statements in 2 string evals (merged)
# spent 3µs executing statements in 2 string evals (merged)
# spent 3µ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
# 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 | ||
162 | 42 | 27µs | $this->{no_topic} = $noTopic; | ||
163 | 42 | 14µs | $this->{topicWeb} = undef; # not known yet | ||
164 | |||||
165 | 42 | 7µs | unless ($noTopic) { | ||
166 | 7 | 13µs | 7 | 699µs | if ( !$this->topicWeb() ) { # spent 699µs making 7 calls to Foswiki::Plugin::topicWeb, avg 100µs/call |
167 | |||||
168 | # not found | ||||
169 | push( | ||||
170 | @{ $this->{errors} }, | ||||
171 | 'Plugins: could not fully register ' | ||||
172 | . $this->{name} | ||||
173 | . ', no plugin topic' | ||||
174 | ); | ||||
175 | $noTopic = 1; | ||||
176 | } | ||||
177 | } | ||||
178 | |||||
179 | # Get the description from the code, if present. if it's not there, it'll | ||||
180 | # be loaded as a preference from the plugin topic later | ||||
181 | 42 | 579µs | $this->{description} = eval '$' . $this->{module} . '::SHORTDESCRIPTION'; # spent 4µs executing statements in 2 string evals (merged)
# spent 3µs executing statements in 2 string evals (merged)
# 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 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 | ||
182 | |||||
183 | # Set the session for this call stack | ||||
184 | 42 | 18µs | local $Foswiki::Plugins::SESSION = $this->{session}; | ||
185 | ASSERT( $Foswiki::Plugins::SESSION->isa('Foswiki') ) if DEBUG; | ||||
186 | |||||
187 | 42 | 18µs | my $sub = $this->{module} . "::initPlugin"; | ||
188 | 42 | 61µs | if ( !defined(&$sub) ) { | ||
189 | push( @{ $this->{errors} }, $sub . ' is not defined' ); | ||||
190 | $this->{disabled} = 1; | ||||
191 | $this->{reason} = 'no_initPlugin'; | ||||
192 | return; | ||||
193 | } | ||||
194 | |||||
195 | 42 | 10µs | $sub = $this->{module} . '::earlyInitPlugin'; | ||
196 | 42 | 89µs | if ( defined(&$sub) ) { | ||
197 | 2 | 34µs | 2 | 30µs | # spent 20µs (8+11) within Foswiki::Plugin::BEGIN@197 which was called:
# once (8µs+11µs) by Foswiki::Plugins::BEGIN@21 at line 197 # spent 20µs making 1 call to Foswiki::Plugin::BEGIN@197
# spent 11µs making 1 call to strict::unimport |
198 | my $error = &$sub(); | ||||
199 | 2 | 66µs | 2 | 25µs | # spent 16µs (7+9) within Foswiki::Plugin::BEGIN@199 which was called:
# once (7µs+9µs) by Foswiki::Plugins::BEGIN@21 at line 199 # spent 16µs making 1 call to Foswiki::Plugin::BEGIN@199
# spent 9µs making 1 call to strict::import |
200 | if ($error) { | ||||
201 | push( @{ $this->{errors} }, $sub . ' failed: ' . $error ); | ||||
202 | $this->{disabled} = 1; | ||||
203 | $this->{reason} = 'no_earlyInitPlugin'; | ||||
204 | return; | ||||
205 | } | ||||
206 | } | ||||
207 | |||||
208 | 42 | 5µs | my $user; | ||
209 | 42 | 13µs | $sub = $this->{module} . '::initializeUserHandler'; | ||
210 | 42 | 54µs | if ( defined(&$sub) ) { | ||
211 | 2 | 47µs | 2 | 27µs | # spent 18µs (8+9) within Foswiki::Plugin::BEGIN@211 which was called:
# once (8µs+9µs) by Foswiki::Plugins::BEGIN@21 at line 211 # spent 18µs making 1 call to Foswiki::Plugin::BEGIN@211
# spent 10µs making 1 call to strict::unimport |
212 | 2 | 17µs | 6 | 332µs | $user = &$sub( # spent 300µs making 2 calls to Foswiki::Request::url, avg 150µs/call
# spent 17µs making 1 call to Foswiki::Plugins::HomePagePlugin::initializeUserHandler
# spent 12µs making 1 call to Foswiki::Plugins::ModifyLoginPlugin::initializeUserHandler
# spent 3µs making 2 calls to Foswiki::Request::pathInfo, avg 1µs/call |
213 | $this->{session}->{remoteUser}, | ||||
214 | $this->{session}->{request}->url(), | ||||
215 | $this->{session}->{request}->path_info() | ||||
216 | ); | ||||
217 | 2 | 167µs | 2 | 28µs | # spent 19µs (10+9) within Foswiki::Plugin::BEGIN@217 which was called:
# once (10µs+9µs) by Foswiki::Plugins::BEGIN@21 at line 217 # spent 19µs making 1 call to Foswiki::Plugin::BEGIN@217
# spent 9µs making 1 call to strict::import |
218 | } | ||||
219 | |||||
220 | #print STDERR "Compile $this->{module}: ".timestr(timediff(new Benchmark, $begin))."\n"; | ||||
221 | |||||
222 | 42 | 118µs | return $user; | ||
223 | } | ||||
224 | |||||
225 | # register plugin settings | ||||
226 | # spent 11.9ms (106µs+11.8) within Foswiki::Plugin::registerSettings which was called 42 times, avg 285µs/call:
# 42 times (106µs+11.8ms) by Foswiki::Plugins::settings at line 273 of /var/www/foswikidev/core/lib/Foswiki/Plugins.pm, avg 285µs/call | ||||
227 | 42 | 13µs | my ( $this, $plugins ) = @_; | ||
228 | |||||
229 | 42 | 10µs | return if $this->{disabled}; | ||
230 | |||||
231 | 42 | 14µs | my $prefs = $this->{session}->{prefs}; | ||
232 | 42 | 88µs | 14 | 11.8ms | if ( !$this->{no_topic} ) { # spent 11.8ms making 7 calls to Foswiki::Prefs::setPluginPreferences, avg 1.69ms/call
# spent 12µs making 7 calls to Foswiki::Plugin::topicWeb, avg 2µs/call |
233 | $prefs->setPluginPreferences( $this->topicWeb(), $this->{name} ); | ||||
234 | } | ||||
235 | } | ||||
236 | |||||
237 | # invoke plugin initialisation and register handlers. | ||||
238 | # spent 65.6ms (5.31+60.3) within Foswiki::Plugin::registerHandlers which was called 42 times, avg 1.56ms/call:
# 42 times (5.31ms+60.3ms) by Foswiki::Plugins::enable at line 307 of /var/www/foswikidev/core/lib/Foswiki/Plugins.pm, avg 1.56ms/call | ||||
239 | 42 | 17µs | my ( $this, $plugins ) = @_; | ||
240 | |||||
241 | 42 | 11µs | return if $this->{disabled}; | ||
242 | |||||
243 | 42 | 19µs | my $p = $this->{module}; | ||
244 | 42 | 12µs | my $sub = $p . "::initPlugin"; | ||
245 | 42 | 16µs | my $users = $Foswiki::Plugins::SESSION->{users}; | ||
246 | 42 | 6µs | my $status = 0; | ||
247 | 42 | 6µs | my $exception = ''; | ||
248 | # spent 59.0ms (443µs+58.6) within Foswiki::Plugin::__ANON__[/var/www/foswikidev/core/lib/Foswiki/Plugin.pm:257] which was called 42 times, avg 1.41ms/call:
# 42 times (443µs+58.6ms) by Error::subs::try at line 419 of Error.pm, avg 1.41ms/call | ||||
249 | 2 | 58µs | 2 | 31µs | # spent 21µs (10+10) within Foswiki::Plugin::BEGIN@249 which was called:
# once (10µs+10µs) by Foswiki::Plugins::BEGIN@21 at line 249 # spent 21µs making 1 call to Foswiki::Plugin::BEGIN@249
# spent 10µs making 1 call to strict::unimport |
250 | 42 | 374µs | 126 | 58.6ms | $status = &$sub( # spent 15.0ms making 1 call to Foswiki::Plugins::SmiliesPlugin::initPlugin
# spent 10.7ms making 1 call to Foswiki::Plugins::InterwikiPlugin::initPlugin
# spent 6.69ms making 1 call to Foswiki::Plugins::JHotDrawPlugin::initPlugin
# spent 6.02ms making 1 call to Foswiki::Plugins::UpdatesPlugin::initPlugin
# spent 5.49ms making 1 call to Foswiki::Plugins::DirectedGraphPlugin::initPlugin
# spent 3.70ms making 1 call to Foswiki::Plugins::ConfigurePlugin::initPlugin
# spent 2.88ms making 1 call to Foswiki::Plugins::JQueryPlugin::initPlugin
# spent 2.30ms making 1 call to Foswiki::Plugins::FindElsewherePlugin::initPlugin
# spent 1.81ms making 1 call to Foswiki::Plugins::ActionTrackerPlugin::initPlugin
# spent 794µs making 1 call to Foswiki::Plugins::AutoViewTemplatePlugin::initPlugin
# spent 552µs making 1 call to Foswiki::Plugins::CommentPlugin::initPlugin
# spent 223µs making 1 call to Foswiki::Plugins::JEditableContribPlugin::initPlugin
# spent 176µs making 1 call to Foswiki::Plugins::RevCommentPlugin::initPlugin
# spent 175µs making 1 call to Foswiki::Plugins::WysiwygPlugin::initPlugin
# spent 159µs making 1 call to Foswiki::Plugins::RenderFormPlugin::initPlugin
# spent 154µs making 1 call to Foswiki::Plugins::SpreadSheetPlugin::initPlugin
# spent 146µs making 1 call to Foswiki::Plugins::TwistyPlugin::initPlugin
# spent 131µs making 42 calls to Foswiki::Users::getLoginName, avg 3µs/call
# spent 129µs making 1 call to Foswiki::Plugins::MultiTopicSavePlugin::initPlugin
# spent 109µs making 1 call to Foswiki::Plugins::SubscribePlugin::initPlugin
# spent 106µs making 1 call to Foswiki::Plugins::RevisionLinkPlugin::initPlugin
# spent 102µs making 1 call to Foswiki::Plugins::ChartPlugin::initPlugin
# spent 100µs making 1 call to Foswiki::Plugins::NatEditPlugin::initPlugin
# spent 96µs making 1 call to Foswiki::Plugins::EditTablePlugin::initPlugin
# spent 93µs making 1 call to Foswiki::Plugins::RenderPlugin::initPlugin
# spent 91µs making 42 calls to Foswiki::Plugin::topicWeb, avg 2µs/call
# spent 88µs making 1 call to Foswiki::Plugins::TimeCalcPlugin::initPlugin
# spent 72µs making 1 call to Foswiki::Plugins::RenderListPlugin::initPlugin
# spent 64µs making 1 call to Foswiki::Plugins::AttachContentPlugin::initPlugin
# spent 61µs making 1 call to Foswiki::Plugins::DelayMacroPlugin::initPlugin
# spent 60µs making 1 call to Foswiki::Plugins::ChecklistPlugin::initPlugin
# spent 58µs making 1 call to Foswiki::Plugins::ExpandTopicContentPlugin::initPlugin
# spent 50µs making 1 call to Foswiki::Plugins::TablePlugin::initPlugin
# spent 42µs making 1 call to Foswiki::Plugins::ExtendedWebListPlugin::initPlugin
# spent 40µs making 1 call to Foswiki::Plugins::HistoryPlugin::initPlugin
# spent 33µs making 1 call to Foswiki::Plugins::MailerContribPlugin::initPlugin
# spent 29µs making 1 call to Foswiki::Plugins::SetFormValuesPlugin::initPlugin
# spent 26µs making 1 call to Foswiki::Plugins::HolidaylistPlugin::initPlugin
# spent 21µs making 1 call to Foswiki::Plugins::CompareRevisionsAddonPlugin::initPlugin
# spent 20µs making 1 call to Foswiki::Plugins::ModifyLoginPlugin::initPlugin
# spent 20µs making 1 call to Foswiki::Plugins::PreferencesPlugin::initPlugin
# spent 15µs making 1 call to Foswiki::Plugins::SlideShowPlugin::initPlugin
# spent 15µs making 1 call to Foswiki::Plugins::TinyMCEPlugin::initPlugin
# spent 5µs making 1 call to Foswiki::Plugins::HomePagePlugin::initPlugin |
251 | $Foswiki::Plugins::SESSION->{topicName}, | ||||
252 | $Foswiki::Plugins::SESSION->{webName}, | ||||
253 | $users->getLoginName( $Foswiki::Plugins::SESSION->{user} ), | ||||
254 | $this->topicWeb() | ||||
255 | ); | ||||
256 | 2 | 297µs | 2 | 28µs | # spent 19µs (10+9) within Foswiki::Plugin::BEGIN@256 which was called:
# once (10µs+9µs) by Foswiki::Plugins::BEGIN@21 at line 256 # spent 19µs making 1 call to Foswiki::Plugin::BEGIN@256
# spent 9µs making 1 call to strict::import |
257 | } | ||||
258 | catch Foswiki::AccessControlException with { | ||||
259 | shift->throw(); # propagate | ||||
260 | } | ||||
261 | catch Foswiki::OopsException with { | ||||
262 | shift->throw(); # propagate | ||||
263 | } | ||||
264 | catch Foswiki::ValidationException with { | ||||
265 | shift->throw(); # propagate | ||||
266 | } | ||||
267 | otherwise { | ||||
268 | my $e = shift; | ||||
269 | $exception = $e->text() . ' ' . $e->stacktrace(); | ||||
270 | 42 | 937µs | 336 | 545µs | }; # spent 310µs making 126 calls to Error::catch, avg 2µs/call
# spent 120µs making 42 calls to Error::subs::otherwise, avg 3µs/call
# spent 115µs making 126 calls to Error::subs::with, avg 913ns/call
# spent 59.4ms making 42 calls to Error::subs::try, avg 1.41ms/call, recursion: max depth 1, sum of overlapping time 59.4ms |
271 | |||||
272 | 42 | 6µs | unless ($status) { | ||
273 | if ( !$exception ) { | ||||
274 | $exception = <<MESSAGE; | ||||
275 | $sub did not return true. | ||||
276 | Check your Foswiki warning and error logs for more information. | ||||
277 | MESSAGE | ||||
278 | } | ||||
279 | push( @{ $this->{errors} }, $exception ); | ||||
280 | $this->{disabled} = 1; | ||||
281 | $this->{reason} = 'plugin_ret_0'; | ||||
282 | return; | ||||
283 | } | ||||
284 | |||||
285 | 42 | 1.02ms | my $compat = eval '\%' . $p . '::FoswikiCompatibility'; # spent 5µs executing statements in 2 string evals (merged)
# spent 4µs executing statements in 2 string evals (merged)
# spent 4µs executing statements in 2 string evals (merged)
# spent 4µs executing statements in 2 string evals (merged)
# 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
# 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 | ||
286 | 42 | 40µs | foreach my $h (@registrableHandlers) { | ||
287 | 1344 | 384µs | my $sub = $p . '::' . $h; | ||
288 | 1344 | 2.00ms | if ( defined(&$sub) ) { | ||
289 | 87 | 47µs | 1 | 9µs | if ( $deprecated{$h} # spent 9µs making 1 call to version::vxs::VCMP |
290 | && $compat | ||||
291 | && $compat->{$h} | ||||
292 | && $compat->{$h} <= $Foswiki::Plugins::VERSION ) | ||||
293 | { | ||||
294 | |||||
295 | # Compatibility handler not required in this version | ||||
296 | 1 | 2µs | next; | ||
297 | } | ||||
298 | 86 | 125µs | 86 | 198µs | $plugins->addListener( $h, $this ); # spent 198µs making 86 calls to Foswiki::Plugins::addListener, avg 2µs/call |
299 | } | ||||
300 | } | ||||
301 | 42 | 166µs | 42 | 117µs | $this->{session}->enterContext( $this->{name} . 'Enabled' ); # spent 117µs making 42 calls to Foswiki::enterContext, avg 3µs/call |
302 | } | ||||
303 | |||||
304 | # Invoke a handler | ||||
305 | # spent 37.7ms (9.64+28.1) within Foswiki::Plugin::invoke which was called 1632 times, avg 23µs/call:
# 1632 times (9.64ms+28.1ms) by Foswiki::Plugins::dispatch at line 380 of /var/www/foswikidev/core/lib/Foswiki/Plugins.pm, avg 23µs/call | ||||
306 | 1632 | 311µs | my $this = shift; # remove from parameter vector | ||
307 | 1632 | 234µs | my $handlerName = shift; | ||
308 | 1632 | 809µs | my $handler = $this->{module} . '::' . $handlerName; | ||
309 | 2 | 32µs | 2 | 29µs | # spent 18µs (8+10) within Foswiki::Plugin::BEGIN@309 which was called:
# once (8µs+10µs) by Foswiki::Plugins::BEGIN@21 at line 309 # spent 18µs making 1 call to Foswiki::Plugin::BEGIN@309
# spent 10µs making 1 call to strict::unimport |
310 | 1632 | 6.18ms | 1632 | 28.2ms | return &$handler(@_); # spent 11.6ms making 5 calls to Foswiki::Plugins::TablePlugin::preRenderingHandler, avg 2.31ms/call
# spent 6.07ms making 5 calls to Foswiki::Plugins::SmiliesPlugin::preRenderingHandler, avg 1.21ms/call
# spent 3.13ms making 108 calls to Foswiki::Plugins::DirectedGraphPlugin::commonTagsHandler, avg 29µs/call
# spent 627µs making 100 calls to Foswiki::Plugins::WysiwygPlugin::beforeCommonTagsHandler, avg 6µs/call
# spent 581µs making 108 calls to Foswiki::Plugins::ChecklistPlugin::commonTagsHandler, avg 5µs/call
# spent 576µs making 100 calls to Foswiki::Plugins::TablePlugin::afterCommonTagsHandler, avg 6µs/call
# spent 497µs making 5 calls to Foswiki::Plugins::InterwikiPlugin::preRenderingHandler, avg 99µs/call
# spent 485µs making 108 calls to Foswiki::Plugins::RevCommentPlugin::commonTagsHandler, avg 4µs/call
# spent 438µs making 108 calls to Foswiki::Plugins::CompareRevisionsAddonPlugin::commonTagsHandler, avg 4µs/call
# spent 425µs making 5 calls to Foswiki::Plugins::ChecklistPlugin::endRenderingHandler, avg 85µs/call
# spent 425µs making 108 calls to Foswiki::Plugins::RenderFormPlugin::commonTagsHandler, avg 4µs/call
# spent 418µs making 108 calls to Foswiki::Plugins::ActionTrackerPlugin::commonTagsHandler, avg 4µs/call
# spent 370µs making 108 calls to Foswiki::Plugins::SpreadSheetPlugin::commonTagsHandler, avg 3µs/call
# spent 370µs making 100 calls to Foswiki::Plugins::AttachContentPlugin::beforeCommonTagsHandler, avg 4µs/call
# spent 353µs making 108 calls to Foswiki::Plugins::ChartPlugin::commonTagsHandler, avg 3µs/call
# spent 338µs making 108 calls to Foswiki::Plugins::EditTablePlugin::commonTagsHandler, avg 3µs/call
# spent 320µs making 100 calls to Foswiki::Plugins::PreferencesPlugin::beforeCommonTagsHandler, avg 3µs/call
# spent 313µs making 100 calls to Foswiki::Plugins::EditTablePlugin::beforeCommonTagsHandler, avg 3µs/call
# spent 288µs making 108 calls to Foswiki::Plugins::SlideShowPlugin::commonTagsHandler, avg 3µs/call
# spent 200µs making 5 calls to Foswiki::Plugins::ChecklistPlugin::postRenderingHandler, avg 40µs/call
# spent 169µs making 1 call to Foswiki::Plugins::JQueryPlugin::finishPlugin
# spent 69µs making 5 calls to Foswiki::Plugins::EditTablePlugin::postRenderingHandler, avg 14µs/call
# spent 66µs making 5 calls to Foswiki::Plugins::PreferencesPlugin::postRenderingHandler, avg 13µs/call
# spent 37µs making 1 call to Foswiki::Plugins::WysiwygPlugin::modifyHeaderHandler
# spent 35µs making 5 calls to Foswiki::Plugins::FindElsewherePlugin::Core::preRenderingHandler, avg 7µs/call
# spent 32µs making 5 calls to Foswiki::Plugins::RenderListPlugin::preRenderingHandler, avg 6µs/call
# spent 19µs making 5 calls to Foswiki::Plugins::WysiwygPlugin::postRenderingHandler, avg 4µs/call |
311 | 2 | 44µs | 2 | 24µs | # spent 15µs (7+9) within Foswiki::Plugin::BEGIN@311 which was called:
# once (7µs+9µs) by Foswiki::Plugins::BEGIN@21 at line 311 # spent 15µs making 1 call to Foswiki::Plugin::BEGIN@311
# spent 8µs making 1 call to strict::import |
312 | } | ||||
313 | |||||
314 | # Get the VERSION number of the specified plugin. | ||||
315 | # SMELL: may die if the plugin doesn't compile | ||||
316 | sub getVersion { | ||||
317 | my $this = shift; | ||||
318 | |||||
319 | 2 | 33µs | 2 | 26µs | # spent 16µs (7+9) within Foswiki::Plugin::BEGIN@319 which was called:
# once (7µs+9µs) by Foswiki::Plugins::BEGIN@21 at line 319 # spent 16µs making 1 call to Foswiki::Plugin::BEGIN@319
# spent 9µs making 1 call to strict::unimport |
320 | return ${ $this->{module} . '::VERSION' } || ''; | ||||
321 | 2 | 45µs | 2 | 24µs | # spent 15µs (7+8) within Foswiki::Plugin::BEGIN@321 which was called:
# once (7µs+8µs) by Foswiki::Plugins::BEGIN@21 at line 321 # spent 15µs making 1 call to Foswiki::Plugin::BEGIN@321
# spent 8µs making 1 call to strict::import |
322 | } | ||||
323 | |||||
324 | # Get the RELEASE of the specified plugin. | ||||
325 | # SMELL: may die if the plugin doesn't compile | ||||
326 | sub getRelease { | ||||
327 | my $this = shift; | ||||
328 | |||||
329 | 2 | 32µs | 2 | 24µs | # spent 16µs (7+9) within Foswiki::Plugin::BEGIN@329 which was called:
# once (7µs+9µs) by Foswiki::Plugins::BEGIN@21 at line 329 # spent 16µs making 1 call to Foswiki::Plugin::BEGIN@329
# spent 9µs making 1 call to strict::unimport |
330 | return ${ $this->{module} . '::RELEASE' } || ''; | ||||
331 | 2 | 340µs | 2 | 23µs | # spent 15µs (7+8) within Foswiki::Plugin::BEGIN@331 which was called:
# once (7µs+8µs) by Foswiki::Plugins::BEGIN@21 at line 331 # spent 15µs making 1 call to Foswiki::Plugin::BEGIN@331
# spent 8µs making 1 call to strict::import |
332 | } | ||||
333 | |||||
334 | # Get the description string for the given plugin | ||||
335 | sub getDescription { | ||||
336 | my $this = shift; | ||||
337 | |||||
338 | unless ( defined $this->{description} ) { | ||||
339 | my $pref = uc( $this->{name} ) . '_SHORTDESCRIPTION'; | ||||
340 | my $prefs = $this->{session}->{prefs}; | ||||
341 | $this->{description} = $prefs->getPreference($pref) || ''; | ||||
342 | } | ||||
343 | if ( $this->{disabled} ) { | ||||
344 | my $reason = ''; | ||||
345 | if ( $this->{reason} ) { | ||||
346 | $reason = | ||||
347 | $this->{session}->inlineAlert( 'alerts', $this->{reason} ); | ||||
348 | } | ||||
349 | return | ||||
350 | ' ' | ||||
351 | . $this->{name} . ': ' | ||||
352 | . $this->{session}->inlineAlert( 'alerts', 'plugin_disabled' ) | ||||
353 | . $reason; | ||||
354 | } | ||||
355 | |||||
356 | my $release = $this->getRelease(); | ||||
357 | my $version = $this->getVersion(); | ||||
358 | $version =~ s/\$Rev: (\d+) \$/$1/g; | ||||
359 | $version = $release . ', ' . $version if $release; | ||||
360 | |||||
361 | my $web = $this->topicWeb(); | ||||
362 | my $result = ' ' . ( $web ? "$web." : '!' ) . $this->{name} . ' '; | ||||
363 | $result .= CGI::span( { class => 'foswikiGrayText foswikiSmall' }, | ||||
364 | '(' . $version . ')' ); | ||||
365 | $result .= ': ' . $this->{description}; | ||||
366 | return $result; | ||||
367 | } | ||||
368 | |||||
369 | =begin TML | ||||
370 | |||||
371 | ---++ ObjectMethod topicWeb() -> $webname | ||||
372 | |||||
373 | Find the web that has the topic for this plugin by searching the | ||||
374 | {Plugins}{WebSearchPath}. Returns undef if $NO_PREFS_IN_TOPIC=1 | ||||
375 | |||||
376 | =cut | ||||
377 | |||||
378 | # spent 801µs (219+582) within Foswiki::Plugin::topicWeb which was called 56 times, avg 14µs/call:
# 42 times (91µs+0s) by Foswiki::Plugin::__ANON__[/var/www/foswikidev/core/lib/Foswiki/Plugin.pm:257] at line 250, avg 2µs/call
# 7 times (117µs+582µs) by Foswiki::Plugin::load at line 166, avg 100µs/call
# 7 times (12µs+0s) by Foswiki::Plugin::registerSettings at line 232, avg 2µs/call | ||||
379 | 56 | 14µs | my $this = shift; | ||
380 | |||||
381 | 56 | 43µs | unless ( defined( $this->{topicWeb} ) || $this->{no_topic} ) { | ||
382 | |||||
383 | # Find the plugin topic, if required | ||||
384 | 7 | 2µs | my $session = $this->{session}; | ||
385 | |||||
386 | 7 | 26µs | foreach | ||
387 | my $web ( split( /[, ]+/, $Foswiki::cfg{Plugins}{WebSearchPath} ), | ||||
388 | $session->{webName} ) | ||||
389 | { | ||||
390 | 7 | 12µs | 7 | 35µs | $web = Foswiki::Sandbox::untaintUnchecked($web); # Item11953 # spent 35µs making 7 calls to Foswiki::Sandbox::untaintUnchecked, avg 5µs/call |
391 | 7 | 14µs | 7 | 547µs | if ( $session->topicExists( $web, $this->{name} ) ) { # spent 547µs making 7 calls to Foswiki::topicExists, avg 78µs/call |
392 | 7 | 5µs | $this->{topicWeb} = $web; | ||
393 | 7 | 6µs | last; | ||
394 | } | ||||
395 | } | ||||
396 | } | ||||
397 | |||||
398 | # If there is no web (probably because NO_PREFS_IN_TOPIC is set) | ||||
399 | # then default to the system web name. | ||||
400 | 56 | 142µs | return $this->{topicWeb} || $Foswiki::cfg{SystemWebName}; | ||
401 | } | ||||
402 | |||||
403 | 1 | 6µs | 1; | ||
404 | __END__ |