← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 17:10:45 2013
Reported on Tue Oct 15 17:12:41 2013

Filename/usr/share/koha/lib/C4/Linker.pm
StatementsExecuted 17 statements in 664µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11140µs51µsC4::Linker::::BEGIN@45C4::Linker::BEGIN@45
11130µs117µsC4::Linker::::BEGIN@47C4::Linker::BEGIN@47
11128µs174µsC4::Linker::::BEGIN@50C4::Linker::BEGIN@50
11123µs30µsC4::Linker::::BEGIN@48C4::Linker::BEGIN@48
11121µs55µsC4::Linker::::BEGIN@46C4::Linker::BEGIN@46
0000s0sC4::Linker::::_handle_auth_limitC4::Linker::_handle_auth_limit
0000s0sC4::Linker::::newC4::Linker::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package C4::Linker;
2
3# Copyright 2011 C & P Bibliography Services
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=head1 NAME
21
- -
45356µs263µs
# spent 51µs (40+11) within C4::Linker::BEGIN@45 which was called: # once (40µs+11µs) by C4::Biblio::BEGIN@38 at line 45
use strict;
# spent 51µs making 1 call to C4::Linker::BEGIN@45 # spent 11µs making 1 call to strict::import
46351µs290µs
# spent 55µs (21+35) within C4::Linker::BEGIN@46 which was called: # once (21µs+35µs) by C4::Biblio::BEGIN@38 at line 46
use warnings;
# spent 55µs making 1 call to C4::Linker::BEGIN@46 # spent 34µs making 1 call to warnings::import
47356µs2203µs
# spent 117µs (30+86) within C4::Linker::BEGIN@47 which was called: # once (30µs+86µs) by C4::Biblio::BEGIN@38 at line 47
use Carp;
# spent 117µs making 1 call to C4::Linker::BEGIN@47 # spent 86µs making 1 call to Exporter::import
48362µs236µs
# spent 30µs (23+6) within C4::Linker::BEGIN@48 which was called: # once (23µs+6µs) by C4::Biblio::BEGIN@38 at line 48
use C4::Context;
# spent 30µs making 1 call to C4::Linker::BEGIN@48 # spent 6µs making 1 call to C4::Context::import
49
503424µs2320µs
# spent 174µs (28+146) within C4::Linker::BEGIN@50 which was called: # once (28µs+146µs) by C4::Biblio::BEGIN@38 at line 50
use base qw(Class::Accessor);
# spent 174µs making 1 call to C4::Linker::BEGIN@50 # spent 146µs making 1 call to base::import
51
52110µs132µs__PACKAGE__->mk_accessors(qw( ));
# spent 32µs making 1 call to Class::Accessor::mk_accessors
53
54sub new {
55 my $class = shift;
56 my $param = shift;
57
58 my $self = {};
59
60 while ( my ( $key, $value ) = each %$param ) {
61 if ( $key eq 'auth_limit' && $value ) {
62 my $dbh = C4::Context->dbh;
63 my $sql =
64 "SELECT authid FROM auth_header WHERE $value ORDER BY authid ASC";
65 my $sth = $dbh->prepare($sql);
66 $sth->execute();
67 while ( my ($authid) = $sth->fetchrow_array() ) {
68 push @{ $self->{'auths_to_link'} }, $authid;
69 }
70 }
71 elsif ( $key eq 'options' && $value ) {
72 foreach my $opt ( split( /\|/, $value ) ) {
73 $self->{$opt} = 1;
74 }
75 }
76 elsif ($value) {
77 $self->{$key} = $value;
78 }
79 }
80
81 bless $self, $class;
82 return $self;
83}
84
85=head2 _handle_auth_limit
86
- -
93sub _handle_auth_limit {
94 my $self = shift;
95 my $authid = shift;
96
97 if ( defined $self->{'auths_to_link'} && defined $authid && !grep { $_ == $authid }
98 @{ $self->{'auths_to_link'} } )
99 {
100 undef $authid;
101 }
102 return $authid;
103}
104
105=head2 EXPORT
106
- -
11915µs1;
120
121__END__