Filename | /usr/share/koha/lib/C4/Debug.pm |
Statements | Executed 21 statements in 438µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 31µs | 38µs | BEGIN@20 | C4::Debug::
1 | 1 | 1 | 30µs | 30µs | BEGIN@29 | C4::Debug::
1 | 1 | 1 | 23µs | 28µs | BEGIN@37 | C4::Debug::
1 | 1 | 1 | 11µs | 90µs | BEGIN@26 | C4::Debug::
1 | 1 | 1 | 11µs | 35µs | BEGIN@23 | C4::Debug::
1 | 1 | 1 | 11µs | 25µs | BEGIN@21 | C4::Debug::
2 | 2 | 1 | 5µs | 5µ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 | 43µs | 2 | 45µs | # spent 38µs (31+7) within C4::Debug::BEGIN@20 which was called:
# once (31µs+7µs) by C4::Context::BEGIN@105 at line 20 # spent 38µs making 1 call to C4::Debug::BEGIN@20
# spent 7µs making 1 call to strict::import |
21 | 3 | 26µs | 2 | 40µs | # spent 25µs (11+14) within C4::Debug::BEGIN@21 which was called:
# once (11µs+14µs) by C4::Context::BEGIN@105 at line 21 # spent 25µs making 1 call to C4::Debug::BEGIN@21
# spent 14µs making 1 call to warnings::import |
22 | |||||
23 | 3 | 35µs | 2 | 60µs | # spent 35µs (11+25) within C4::Debug::BEGIN@23 which was called:
# once (11µs+25µs) by C4::Context::BEGIN@105 at line 23 # spent 35µs making 1 call to C4::Debug::BEGIN@23
# spent 24µs making 1 call to Exporter::import |
24 | |||||
25 | # use CGI; | ||||
26 | 3 | 56µs | 2 | 169µs | # spent 90µs (11+79) within C4::Debug::BEGIN@26 which was called:
# once (11µs+79µs) by C4::Context::BEGIN@105 at line 26 # spent 90µs making 1 call to C4::Debug::BEGIN@26
# spent 79µs making 1 call to vars::import |
27 | # use vars qw(@EXPORT_OK %EXPORT_TAGS); | ||||
28 | |||||
29 | # spent 30µs within C4::Debug::BEGIN@29 which was called:
# once (30µs+0s) by C4::Context::BEGIN@105 at line 35 | ||||
30 | 3 | 33µ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 | 186µs | 1 | 30µs | } # spent 30µs making 1 call to C4::Debug::BEGIN@29 |
36 | |||||
37 | # spent 28µs (23+5) within C4::Debug::BEGIN@37 which was called:
# once (23µs+5µ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 | 26µ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 | 4µs | unless ($debug =~ /^\d$/) { # spent 4µs making 1 call to C4::Debug::CORE:match | ||
58 | warn "Invalid \$debug value attempted: $debug"; | ||||
59 | $debug=1; | ||||
60 | } | ||||
61 | 1 | 1µs | unless ($cgi_debug =~ /^\d$/) { # spent 1µ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 | 30µs | 1 | 28µs | } # spent 28µ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 | 2µs | 1; | ||
74 | __END__ | ||||
sub C4::Debug::CORE:match; # opcode |