Filename | /var/www/foswikidev/core/lib/Foswiki/Plugins/CompareRevisionsAddonPlugin.pm |
Statements | Executed 235 statements in 740µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
108 | 1 | 1 | 419µs | 438µs | commonTagsHandler | Foswiki::Plugins::CompareRevisionsAddonPlugin::
1 | 1 | 1 | 19µs | 19µs | _handleRdiff2Compare | Foswiki::Plugins::CompareRevisionsAddonPlugin::
1 | 1 | 1 | 18µs | 31µs | BEGIN@15 | Foswiki::Plugins::CompareRevisionsAddonPlugin::
1 | 1 | 1 | 13µs | 21µs | initPlugin | Foswiki::Plugins::CompareRevisionsAddonPlugin::
1 | 1 | 1 | 10µs | 15µs | BEGIN@16 | Foswiki::Plugins::CompareRevisionsAddonPlugin::
1 | 1 | 1 | 8µs | 8µs | BEGIN@18 | Foswiki::Plugins::CompareRevisionsAddonPlugin::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | |||||
3 | =pod | ||||
4 | |||||
5 | ---+ package CompareRevisionsAddonPlugin | ||||
6 | |||||
7 | This is a helper plugin for the CompareRevisionsAddon package. | ||||
8 | |||||
9 | =cut | ||||
10 | |||||
11 | # change the package name and $pluginName!!! | ||||
12 | package Foswiki::Plugins::CompareRevisionsAddonPlugin; | ||||
13 | |||||
14 | # Always use strict to enforce variable scoping | ||||
15 | 2 | 29µs | 2 | 45µs | # spent 31µs (18+14) within Foswiki::Plugins::CompareRevisionsAddonPlugin::BEGIN@15 which was called:
# once (18µs+14µs) by Foswiki::Plugin::BEGIN@2.8 at line 15 # spent 31µs making 1 call to Foswiki::Plugins::CompareRevisionsAddonPlugin::BEGIN@15
# spent 14µs making 1 call to strict::import |
16 | 2 | 25µs | 2 | 19µs | # spent 15µs (10+4) within Foswiki::Plugins::CompareRevisionsAddonPlugin::BEGIN@16 which was called:
# once (10µs+4µs) by Foswiki::Plugin::BEGIN@2.8 at line 16 # spent 15µs making 1 call to Foswiki::Plugins::CompareRevisionsAddonPlugin::BEGIN@16
# spent 4µs making 1 call to warnings::import |
17 | |||||
18 | 2 | 251µs | 1 | 8µs | # spent 8µs within Foswiki::Plugins::CompareRevisionsAddonPlugin::BEGIN@18 which was called:
# once (8µs+0s) by Foswiki::Plugin::BEGIN@2.8 at line 18 # spent 8µs making 1 call to Foswiki::Plugins::CompareRevisionsAddonPlugin::BEGIN@18 |
19 | |||||
20 | # Keep this in sync with CompareRevsionsAddOn | ||||
21 | 1 | 800ns | our $VERSION = '1.114'; | ||
22 | 1 | 200ns | our $RELEASE = '1.114'; | ||
23 | |||||
24 | # Name of this Plugin, only used in this module | ||||
25 | 1 | 200ns | our $pluginName = 'CompareRevisionsAddonPlugin'; | ||
26 | |||||
27 | # We have no prefs in plugin topic | ||||
28 | 1 | 200ns | our $NO_PREFS_IN_TOPIC = 1; | ||
29 | |||||
30 | 1 | 100ns | our $debug = 0; | ||
31 | |||||
32 | # spent 21µs (13+9) within Foswiki::Plugins::CompareRevisionsAddonPlugin::initPlugin which was called:
# once (13µs+9µs) by Foswiki::Plugin::__ANON__[/var/www/foswikidev/core/lib/Foswiki/Plugin.pm:257] at line 250 of /var/www/foswikidev/core/lib/Foswiki/Plugin.pm | ||||
33 | 1 | 1µs | my ( $topic, $web, $user, $installWeb ) = @_; | ||
34 | |||||
35 | # check for Plugins.pm versions | ||||
36 | 1 | 15µs | 1 | 8µs | if ( $Foswiki::Plugins::VERSION < 1.026 ) { # spent 8µs making 1 call to version::vxs::VCMP |
37 | Foswiki::Func::writeWarning( | ||||
38 | "Version mismatch between $pluginName and Plugins.pm"); | ||||
39 | return 0; | ||||
40 | } | ||||
41 | |||||
42 | # Plugin correctly initialized | ||||
43 | 1 | 4µs | return 1; | ||
44 | } | ||||
45 | |||||
46 | # spent 438µs (419+19) within Foswiki::Plugins::CompareRevisionsAddonPlugin::commonTagsHandler which was called 108 times, avg 4µs/call:
# 108 times (419µs+19µs) by Foswiki::Plugin::invoke at line 310 of /var/www/foswikidev/core/lib/Foswiki/Plugin.pm, avg 4µs/call | ||||
47 | |||||
48 | # do not uncomment, use $_[0], $_[1]... instead | ||||
49 | ### my ( $text, $topic, $web ) = @_; | ||||
50 | |||||
51 | 108 | 17µs | Foswiki::Func::writeDebug( | ||
52 | "- ${pluginName}::commonTagsHandler( $_[2].$_[1] )") | ||||
53 | if $debug; | ||||
54 | |||||
55 | 109 | 367µs | 1 | 19µs | $_[0] =~ s/%RDIFF2COMPARE\{"?(.*?)"?\}%/&_handleRdiff2Compare($1)/ge; # spent 19µs making 1 call to Foswiki::Plugins::CompareRevisionsAddonPlugin::_handleRdiff2Compare |
56 | } | ||||
57 | |||||
58 | # spent 19µs within Foswiki::Plugins::CompareRevisionsAddonPlugin::_handleRdiff2Compare which was called:
# once (19µs+0s) by Foswiki::Plugins::CompareRevisionsAddonPlugin::commonTagsHandler at line 55 | ||||
59 | |||||
60 | 1 | 2µs | my $text = shift; | ||
61 | 1 | 15µs | $text =~ s{/rdiff $Foswiki::cfg{ScriptSuffix}/} | ||
62 | {/compare$Foswiki::cfg{ScriptSuffix}/}xmsg; | ||||
63 | 1 | 8µs | return $text; | ||
64 | |||||
65 | } | ||||
66 | |||||
67 | 1 | 4µs | 1; | ||
68 | __END__ |