Filename | /usr/local/src/github.com/foswiki/core/lib/Foswiki/LoginManager/Session.pm |
Statements | Executed 16 statements in 601µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 6.68ms | 7.45ms | BEGIN@22 | Foswiki::LoginManager::Session::
1 | 1 | 1 | 44µs | 114ms | load | Foswiki::LoginManager::Session::
1 | 1 | 1 | 25µs | 34µs | BEGIN@19 | Foswiki::LoginManager::Session::
1 | 1 | 1 | 22µs | 44µs | BEGIN@20 | Foswiki::LoginManager::Session::
1 | 1 | 1 | 10µs | 10µs | query | Foswiki::LoginManager::Session::
0 | 0 | 0 | 0s | 0s | _ip_matches | Foswiki::LoginManager::Session::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | |||||
3 | =begin TML | ||||
4 | |||||
5 | ---+!! package Foswiki::LoginManager::Session | ||||
6 | |||||
7 | Class to provide CGI::Session like infra-structure, compatible with | ||||
8 | Runtime Engine mechanisms other than CGI. | ||||
9 | |||||
10 | It inherits from CGI::Session and redefine methods that uses %ENV directly, | ||||
11 | replacing by calls to Foswiki::Request object, that is passed to constructor. | ||||
12 | |||||
13 | It also redefines =name= method, to avoid creating CGI object. | ||||
14 | |||||
15 | =cut | ||||
16 | |||||
17 | package Foswiki::LoginManager::Session; | ||||
18 | |||||
19 | 2 | 47µs | 2 | 42µs | # spent 34µs (25+8) within Foswiki::LoginManager::Session::BEGIN@19 which was called:
# once (25µs+8µs) by Foswiki::LoginManager::BEGIN@1 at line 19 # spent 34µs making 1 call to Foswiki::LoginManager::Session::BEGIN@19
# spent 8µs making 1 call to strict::import |
20 | 2 | 49µs | 2 | 66µs | # spent 44µs (22+22) within Foswiki::LoginManager::Session::BEGIN@20 which was called:
# once (22µs+22µs) by Foswiki::LoginManager::BEGIN@1 at line 20 # spent 44µs making 1 call to Foswiki::LoginManager::Session::BEGIN@20
# spent 22µs making 1 call to warnings::import |
21 | |||||
22 | 2 | 432µs | 1 | 7.45ms | # spent 7.45ms (6.68+767µs) within Foswiki::LoginManager::Session::BEGIN@22 which was called:
# once (6.68ms+767µs) by Foswiki::LoginManager::BEGIN@1 at line 22 # spent 7.45ms making 1 call to Foswiki::LoginManager::Session::BEGIN@22 |
23 | 1 | 9µs | our @ISA = ('CGI::Session'); | ||
24 | |||||
25 | 1 | 2µs | *VERSION = \$CGI::Session::VERSION; | ||
26 | 1 | 1µs | *NAME = \$CGI::Session::NAME; | ||
27 | |||||
28 | # spent 114ms (44µs+114) within Foswiki::LoginManager::Session::load which was called:
# once (44µs+114ms) by CGI::Session::new at line 67 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session.pm | ||||
29 | 3 | 41µs | my $this = shift; | ||
30 | |||||
31 | # SMELL: This breaks mod_perl Foswikibug:Item691 | ||||
32 | # local %ENV = %ENV; | ||||
33 | 1 | 7µs | $ENV{REMOTE_ADDR} = @_ == 1 ? $_[0]->remoteAddress : $_[1]->remoteAddress; # spent 7µs making 1 call to Foswiki::Request::remoteAddress | ||
34 | 1 | 114ms | $this->SUPER::load(@_); # spent 114ms making 1 call to CGI::Session::load | ||
35 | } | ||||
36 | |||||
37 | # spent 10µs within Foswiki::LoginManager::Session::query which was called:
# once (10µs+0s) by CGI::Session::load at line 731 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session.pm | ||||
38 | 2 | 4µs | my $self = shift; | ||
39 | |||||
40 | 1 | 9µs | if ( $self->{_QUERY} ) { | ||
41 | return $self->{_QUERY}; | ||||
42 | } | ||||
43 | return $self->{_QUERY} = Foswiki::Request->new(); | ||||
44 | } | ||||
45 | |||||
46 | sub _ip_matches { | ||||
47 | return ( | ||||
48 | $_[0]->{_DATA}->{_SESSION_REMOTE_ADDR} eq $_[0]->query->remoteAddress ); | ||||
49 | } | ||||
50 | |||||
51 | 1 | 7µs | 1; | ||
52 | __END__ |