Filename | /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/Driver.pm |
Statements | Executed 20 statements in 684µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 47µs | 80µs | new | CGI::Session::Driver::
1 | 1 | 1 | 28µs | 38µs | BEGIN@5 | CGI::Session::Driver::
1 | 1 | 1 | 18µs | 130µs | BEGIN@8 | CGI::Session::Driver::
1 | 1 | 1 | 11µs | 11µs | BEGIN@9 | 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 | # $Id: Driver.pm 447 2008-11-01 03:46:08Z markstos $ | ||||
4 | |||||
5 | 2 | 51µs | 2 | 47µs | # spent 38µs (28+9) within CGI::Session::Driver::BEGIN@5 which was called:
# once (28µs+9µs) by CGI::Session::Driver::file::BEGIN@10 at line 5 # spent 38µs making 1 call to CGI::Session::Driver::BEGIN@5
# spent 10µs making 1 call to strict::import |
6 | #use diagnostics; | ||||
7 | |||||
8 | 2 | 46µs | 2 | 242µs | # spent 130µs (18+112) within CGI::Session::Driver::BEGIN@8 which was called:
# once (18µs+112µs) by CGI::Session::Driver::file::BEGIN@10 at line 8 # spent 130µs making 1 call to CGI::Session::Driver::BEGIN@8
# spent 112µs making 1 call to Exporter::import |
9 | 2 | 522µs | 1 | 11µs | # spent 11µs within CGI::Session::Driver::BEGIN@9 which was called:
# once (11µs+0s) by CGI::Session::Driver::file::BEGIN@10 at line 9 # spent 11µs making 1 call to CGI::Session::Driver::BEGIN@9 |
10 | |||||
11 | 1 | 2µs | $CGI::Session::Driver::VERSION = '4.38'; | ||
12 | 1 | 11µs | @CGI::Session::Driver::ISA = qw(CGI::Session::ErrorHandler); | ||
13 | |||||
14 | # spent 80µs (47+32) within CGI::Session::Driver::new which was called:
# once (47µs+32µs) by CGI::Session::_driver at line 130 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session.pm | ||||
15 | 11 | 47µs | my $class = shift; | ||
16 | my $args = shift || {}; | ||||
17 | |||||
18 | unless ( ref $args ) { | ||||
19 | croak "$class->new(): Invalid argument type passed to driver"; | ||||
20 | } | ||||
21 | |||||
22 | # Set defaults. | ||||
23 | |||||
24 | if (! $args->{TableName}) { | ||||
25 | $args->{TableName} = 'sessions'; | ||||
26 | } | ||||
27 | |||||
28 | if (! $args->{IdColName}) { | ||||
29 | $args->{IdColName} = 'id'; | ||||
30 | } | ||||
31 | |||||
32 | if (! $args->{DataColName}) { | ||||
33 | $args->{DataColName} = 'a_session'; | ||||
34 | } | ||||
35 | |||||
36 | # perform a shallow copy of $args, to prevent modification | ||||
37 | my $self = bless ({%$args}, $class); | ||||
38 | 1 | 33µs | return $self if $self->init(); # spent 33µs making 1 call to CGI::Session::Driver::file::init | ||
39 | return $self->set_error( "%s->init() returned false", $class); | ||||
40 | } | ||||
41 | |||||
42 | sub init { 1 } | ||||
43 | |||||
44 | sub retrieve { | ||||
45 | croak "retrieve(): " . ref($_[0]) . " failed to implement this method!"; | ||||
46 | } | ||||
47 | |||||
48 | sub store { | ||||
49 | croak "store(): " . ref($_[0]) . " failed to implement this method!"; | ||||
50 | } | ||||
51 | |||||
52 | sub remove { | ||||
53 | croak "remove(): " . ref($_[0]) . " failed to implement this method!"; | ||||
54 | } | ||||
55 | |||||
56 | sub traverse { | ||||
57 | croak "traverse(): " . ref($_[0]) . " failed to implement this method!"; | ||||
58 | } | ||||
59 | |||||
60 | sub dump { | ||||
61 | require Data::Dumper; | ||||
62 | my $d = Data::Dumper->new([$_[0]], [ref $_[0]]); | ||||
63 | return $d->Dump; | ||||
64 | } | ||||
65 | |||||
66 | |||||
67 | 1 | 7µs | 1; | ||
68 | |||||
69 | __END__; |