Filename | /usr/share/koha/lib/C4/Debug.pm |
Statements | Executed 21 statements in 645µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 28µs | 35µs | BEGIN@20 | C4::Debug::
1 | 1 | 1 | 27µs | 35µs | BEGIN@37 | C4::Debug::
1 | 1 | 1 | 25µs | 25µs | BEGIN@29 | C4::Debug::
1 | 1 | 1 | 18µs | 51µs | BEGIN@21 | C4::Debug::
1 | 1 | 1 | 18µs | 54µs | BEGIN@23 | C4::Debug::
1 | 1 | 1 | 17µs | 155µs | BEGIN@26 | C4::Debug::
2 | 2 | 1 | 7µs | 7µs | CORE:match (opcode) | C4::Debug::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package C4::Debug; | ||||
2 | |||||
3 | # Copyright 2000-2002 Katipo Communications | ||||
4 | # | ||||
5 | # This file is part of Koha. | ||||
6 | # | ||||
7 | # Koha is free software; you can redistribute it and/or modify it under the | ||||
8 | # terms of the GNU General Public License as published by the Free Software | ||||
9 | # Foundation; either version 2 of the License, or (at your option) any later | ||||
10 | # version. | ||||
11 | # | ||||
12 | # Koha is distributed in the hope that it will be useful, but WITHOUT ANY | ||||
13 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||||
14 | # A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||||
15 | # | ||||
16 | # You should have received a copy of the GNU General Public License along | ||||
17 | # with Koha; if not, write to the Free Software Foundation, Inc., | ||||
18 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||||
19 | |||||
20 | 3 | 46µs | 2 | 42µs | # spent 35µs (28+7) within C4::Debug::BEGIN@20 which was called:
# once (28µs+7µs) by C4::Context::BEGIN@105 at line 20 # spent 35µs making 1 call to C4::Debug::BEGIN@20
# spent 7µs making 1 call to strict::import |
21 | 3 | 55µs | 2 | 84µs | # spent 51µs (18+33) within C4::Debug::BEGIN@21 which was called:
# once (18µs+33µs) by C4::Context::BEGIN@105 at line 21 # spent 51µs making 1 call to C4::Debug::BEGIN@21
# spent 33µs making 1 call to warnings::import |
22 | |||||
23 | 3 | 52µs | 2 | 91µs | # spent 54µs (18+37) within C4::Debug::BEGIN@23 which was called:
# once (18µs+37µs) by C4::Context::BEGIN@105 at line 23 # spent 54µs making 1 call to C4::Debug::BEGIN@23
# spent 37µs making 1 call to Exporter::import |
24 | |||||
25 | # use CGI; | ||||
26 | 3 | 112µs | 2 | 294µs | # spent 155µs (17+139) within C4::Debug::BEGIN@26 which was called:
# once (17µs+139µs) by C4::Context::BEGIN@105 at line 26 # spent 155µs making 1 call to C4::Debug::BEGIN@26
# spent 139µs making 1 call to vars::import |
27 | # use vars qw(@EXPORT_OK %EXPORT_TAGS); | ||||
28 | |||||
29 | # spent 25µs within C4::Debug::BEGIN@29 which was called:
# once (25µs+0s) by C4::Context::BEGIN@105 at line 35 | ||||
30 | 3 | 24µs | $VERSION = 3.07.00.049; # set the version for version checking | ||
31 | @ISA = qw(Exporter); | ||||
32 | @EXPORT = qw($debug $cgi_debug); | ||||
33 | # @EXPOR_OK = qw(); | ||||
34 | # %EXPORT_TAGS = ( all=>[qw($debug $cgi_debug)], ); | ||||
35 | 1 | 271µs | 1 | 25µs | } # spent 25µs making 1 call to C4::Debug::BEGIN@29 |
36 | |||||
37 | # spent 35µs (27+7) within C4::Debug::BEGIN@37 which was called:
# once (27µs+7µs) by C4::Context::BEGIN@105 at line 66 | ||||
38 | # this stuff needs a begin block too, since dependencies might alter their compilations | ||||
39 | # for example, adding DataDumper | ||||
40 | |||||
41 | 5 | 32µs | $debug = $ENV{KOHA_DEBUG} || $ENV{DEBUG} || 0; | ||
42 | |||||
43 | # CGI->new conflicts w/ some upload functionality, | ||||
44 | # since we would get the "first" CGI object here. | ||||
45 | # Instead we have to parse for ourselves if we want QUERY_STRING triggers. | ||||
46 | # my $query = CGI->new(); # conflicts! | ||||
47 | # $cgi_debug = $ENV{KOHA_CGI_DEBUG} || $query->param('debug') || 0; | ||||
48 | |||||
49 | $cgi_debug = $ENV{KOHA_CGI_DEBUG} || 0; | ||||
50 | unless ($cgi_debug or not $ENV{QUERY_STRING}) { | ||||
51 | foreach (split /\&/, $ENV{QUERY_STRING}) { | ||||
52 | /^debug\=(.+)$/ or next; | ||||
53 | $cgi_debug = $1; | ||||
54 | last; | ||||
55 | } | ||||
56 | } | ||||
57 | 1 | 6µs | unless ($debug =~ /^\d$/) { # spent 6µs making 1 call to C4::Debug::CORE:match | ||
58 | warn "Invalid \$debug value attempted: $debug"; | ||||
59 | $debug=1; | ||||
60 | } | ||||
61 | 1 | 2µs | unless ($cgi_debug =~ /^\d$/) { # spent 2µs making 1 call to C4::Debug::CORE:match | ||
62 | $debug and | ||||
63 | warn "Invalid \$cgi_debug value attempted: $cgi_debug"; | ||||
64 | $cgi_debug=1; | ||||
65 | } | ||||
66 | 1 | 49µs | 1 | 35µs | } # spent 35µs making 1 call to C4::Debug::BEGIN@37 |
67 | |||||
68 | # sub import { | ||||
69 | # print STDERR __PACKAGE__ . " (Debug) import @_\n"; | ||||
70 | # C4::Debug->export_to_level(1, @_); | ||||
71 | # } | ||||
72 | |||||
73 | 1 | 4µs | 1; | ||
74 | __END__ | ||||
sub C4::Debug::CORE:match; # opcode |