Filename | /usr/share/perl5/CGI/Session/Driver.pm |
Statements | Executed 17 statements in 580µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 17µs | 46µs | new | CGI::Session::Driver::
1 | 1 | 1 | 11µs | 21µs | BEGIN@3 | CGI::Session::Driver::
1 | 1 | 1 | 9µs | 46µs | BEGIN@6 | CGI::Session::Driver::
1 | 1 | 1 | 9µs | 9µs | BEGIN@7 | CGI::Session::Driver::
0 | 0 | 0 | 0s | 0s | dump | CGI::Session::Driver::
0 | 0 | 0 | 0s | 0s | init | CGI::Session::Driver::
0 | 0 | 0 | 0s | 0s | remove | CGI::Session::Driver::
0 | 0 | 0 | 0s | 0s | retrieve | CGI::Session::Driver::
0 | 0 | 0 | 0s | 0s | store | CGI::Session::Driver::
0 | 0 | 0 | 0s | 0s | traverse | CGI::Session::Driver::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package CGI::Session::Driver; | ||||
2 | |||||
3 | 2 | 24µs | 2 | 32µs | # spent 21µs (11+11) within CGI::Session::Driver::BEGIN@3 which was called:
# once (11µs+11µs) by CGI::Session::Driver::DBI::BEGIN@9 at line 3 # spent 21µs making 1 call to CGI::Session::Driver::BEGIN@3
# spent 11µs making 1 call to strict::import |
4 | # | ||||
5 | |||||
6 | 2 | 34µs | 2 | 84µs | # spent 46µs (9+37) within CGI::Session::Driver::BEGIN@6 which was called:
# once (9µs+37µs) by CGI::Session::Driver::DBI::BEGIN@9 at line 6 # spent 46µs making 1 call to CGI::Session::Driver::BEGIN@6
# spent 37µs making 1 call to Exporter::import |
7 | 2 | 490µs | 1 | 9µs | # spent 9µs within CGI::Session::Driver::BEGIN@7 which was called:
# once (9µs+0s) by CGI::Session::Driver::DBI::BEGIN@9 at line 7 # spent 9µs making 1 call to CGI::Session::Driver::BEGIN@7 |
8 | |||||
9 | 1 | 600ns | $CGI::Session::Driver::VERSION = '4.43'; | ||
10 | 1 | 9µs | @CGI::Session::Driver::ISA = qw(CGI::Session::ErrorHandler); | ||
11 | |||||
12 | # spent 46µs (17+29) within CGI::Session::Driver::new which was called:
# once (17µs+29µs) by CGI::Session::_driver at line 117 of CGI/Session.pm | ||||
13 | 1 | 400ns | my $class = shift; | ||
14 | 1 | 400ns | my $args = shift || {}; | ||
15 | |||||
16 | 1 | 800ns | unless ( ref $args ) { | ||
17 | croak "$class->new(): Invalid argument type passed to driver"; | ||||
18 | } | ||||
19 | |||||
20 | # Set defaults. | ||||
21 | |||||
22 | 1 | 1µs | if (! $args->{TableName}) { | ||
23 | $args->{TableName} = 'sessions'; | ||||
24 | } | ||||
25 | |||||
26 | 1 | 800ns | if (! $args->{IdColName}) { | ||
27 | $args->{IdColName} = 'id'; | ||||
28 | } | ||||
29 | |||||
30 | 1 | 900ns | if (! $args->{DataColName}) { | ||
31 | $args->{DataColName} = 'a_session'; | ||||
32 | } | ||||
33 | |||||
34 | # perform a shallow copy of $args, to prevent modification | ||||
35 | 1 | 5µs | my $self = bless ({%$args}, $class); | ||
36 | 1 | 8µs | 1 | 29µs | return $self if $self->init(); # spent 29µs making 1 call to CGI::Session::Driver::mysql::init |
37 | return $self->set_error( "$class->init() returned false"); | ||||
38 | } | ||||
39 | |||||
40 | sub init { 1 } | ||||
41 | |||||
42 | sub retrieve { | ||||
43 | croak "retrieve(): " . ref($_[0]) . " failed to implement this method!"; | ||||
44 | } | ||||
45 | |||||
46 | sub store { | ||||
47 | croak "store(): " . ref($_[0]) . " failed to implement this method!"; | ||||
48 | } | ||||
49 | |||||
50 | sub remove { | ||||
51 | croak "remove(): " . ref($_[0]) . " failed to implement this method!"; | ||||
52 | } | ||||
53 | |||||
54 | sub traverse { | ||||
55 | croak "traverse(): " . ref($_[0]) . " failed to implement this method!"; | ||||
56 | } | ||||
57 | |||||
58 | sub dump { | ||||
59 | require Data::Dumper; | ||||
60 | my $d = Data::Dumper->new([$_[0]], [ref $_[0]]); | ||||
61 | return $d->Dump; | ||||
62 | } | ||||
63 | |||||
64 | |||||
65 | 1 | 4µs | 1; | ||
66 | |||||
67 | __END__; |