Filename | /var/www/foswikidev/core/lib/Foswiki/Macros/ADDTOZONE.pm |
Statements | Executed 66 statements in 343µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
5 | 1 | 1 | 58µs | 198µs | ADDTOZONE | Foswiki::
1 | 1 | 1 | 13µs | 26µs | BEGIN@4.71 | Foswiki::
1 | 1 | 1 | 12µs | 16µs | BEGIN@5.72 | Foswiki::
1 | 1 | 1 | 4µs | 4µs | BEGIN@7.73 | Foswiki::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | package Foswiki; | ||||
3 | |||||
4 | 2 | 27µs | 2 | 38µs | # spent 26µs (13+13) within Foswiki::BEGIN@4.71 which was called:
# once (13µs+13µs) by Foswiki::_expandMacroOnTopicRendering at line 4 # spent 26µs making 1 call to Foswiki::BEGIN@4.71
# spent 13µs making 1 call to strict::import |
5 | 2 | 46µs | 2 | 20µs | # spent 16µs (12+4) within Foswiki::BEGIN@5.72 which was called:
# once (12µs+4µs) by Foswiki::_expandMacroOnTopicRendering at line 5 # spent 16µs making 1 call to Foswiki::BEGIN@5.72
# spent 4µs making 1 call to warnings::import |
6 | |||||
7 | # spent 4µs within Foswiki::BEGIN@7.73 which was called:
# once (4µs+0s) by Foswiki::_expandMacroOnTopicRendering at line 12 | ||||
8 | 1 | 4µs | if ( $Foswiki::cfg{UseLocale} ) { | ||
9 | require locale; | ||||
10 | import locale(); | ||||
11 | } | ||||
12 | 1 | 209µs | 1 | 4µs | } # spent 4µs making 1 call to Foswiki::BEGIN@7.73 |
13 | |||||
14 | # spent 198µs (58+140) within Foswiki::ADDTOZONE which was called 5 times, avg 40µs/call:
# 5 times (58µs+140µs) by Foswiki::_expandMacroOnTopicRendering at line 3435 of /var/www/foswikidev/core/lib/Foswiki.pm, avg 40µs/call | ||||
15 | 5 | 3µs | my ( $this, $params, $topicObject ) = @_; | ||
16 | |||||
17 | 5 | 3µs | my $zones = $params->{_DEFAULT} || $params->{zone} || 'head'; | ||
18 | 5 | 4µs | my $id = $params->{id} || $params->{tag} || ''; | ||
19 | 5 | 3µs | my $topic = $params->{topic} || ''; | ||
20 | 5 | 1µs | my $section = $params->{section} || ''; | ||
21 | 5 | 2µs | my $requires = $params->{requires} || ''; | ||
22 | 5 | 2µs | my $text = $params->{text} || ''; | ||
23 | |||||
24 | # when there's a topic or a section parameter, then create an include | ||||
25 | # this overrides the text parameter | ||||
26 | 5 | 1µs | if ( $topic || $section ) { | ||
27 | my $web = $topicObject->web; | ||||
28 | $topic ||= $topicObject->topic; | ||||
29 | ( $web, $topic ) = $this->normalizeWebTopicName( $web, $topic ); | ||||
30 | |||||
31 | # generate TML only and delay expansion until the zone is rendered | ||||
32 | $text = '%INCLUDE{"' . $web . '.' . $topic . '"'; | ||||
33 | $text .= ' section="' . $section . '"' if $section; | ||||
34 | $text .= ' warn="off"}%'; | ||||
35 | } | ||||
36 | |||||
37 | 5 | 9µs | foreach my $zone ( split( /\s*,\s*/, $zones ) ) { | ||
38 | 5 | 2µs | if ( $zone eq 'body' ) { | ||
39 | |||||
40 | #print STDERR "WARNING: ADDTOZONE was called for zone 'body' ... rerouting it to zone 'script' ... please fix your templates\n"; | ||||
41 | $zone = 'script'; | ||||
42 | } | ||||
43 | 5 | 14µs | 5 | 140µs | $this->addToZone( $zone, $id, $text, $requires ); # spent 140µs making 5 calls to Foswiki::addToZone, avg 28µs/call |
44 | } | ||||
45 | |||||
46 | 5 | 12µs | return (DEBUG) ? "<!--A2Z:$id-->" : ''; | ||
47 | } | ||||
48 | |||||
49 | 1 | 2µs | 1; | ||
50 | __END__ |