← Index
Performance Profile   « block view • line view • sub view »
For opac/opac-main.pl
  Run on Fri Jul 18 13:58:34 2008
Reported on Fri Jul 18 13:58:44 2008

Fileopac/opac-main.pl
Statements Executed13
Total Time0.000382 seconds

Subroutines — ordered by inclusive time then name
CallsInclusive
Time
Subroutine
00main::BEGIN

LineStmts.Exclusive
Time
Avg.Code
110.000180.00018#!/usr/bin/perl
2
3# This file is part of Koha.
4#
5# Koha is free software; you can redistribute it and/or modify it under the
6# terms of the GNU General Public License as published by the Free Software
7# Foundation; either version 2 of the License, or (at your option) any later
8# version.
9#
10# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along with
15# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
16# Suite 330, Boston, MA 02111-1307 USA
17
18
19use strict;
20
21
22use CGI;
2310.000040.00004my $input = new CGI;
# spent 0.00586s making 1 calls to CGI::new
24
2511e-061e-06my $memd;
26
27use C4::Auth;
28use C4::Output;
29use C4::VirtualShelves;
30use C4::Branch;
31use C4::Members;
32use C4::NewsChannels;
33use C4::Acquisition;
34
3510.000010.00001my $usecache=C4::Context->preference('usecache');
# spent 0.00046s making 1 calls to C4::Context::preference
36
3710.000020.00002my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
# spent 0.05004s making 1 calls to C4::Auth::get_template_and_user
38 {
39 template_name => "opac-main.tmpl",
40 type => "opac",
41 query => $input,
42 authnotrequired => 1,
43 flagsrequired => { borrow => 1 },
44 }
45);
46
4711e-061e-06if ($usecache){
4812e-062e-06 require Cache::Memcached;
4910.000010.00001 Cache::Memcached->import();
# spent 4e-06s making 1 calls to 1
5010.000010.00001 $memd = new Cache::Memcached(
# spent 0.00014s making 1 calls to Cache::Memcached::new
51 'servers'=>['127.0.0.1:11211'],
52 );
5310.000010.00001 my $page = $memd->get("koha:opacmain:$borrowernumber");
# spent 0.00060s making 1 calls to Cache::Memcached::get
5411e-061e-06 if ($page){
5510.000010.00001 output_html_with_http_headers $input, $cookie, $page;
# spent 0.00349s making 1 calls to C4::Output::output_html_with_http_headers
5610.000070.00007 exit;
57 }
58}
59
60
61my $dbh = C4::Context->dbh;
62my $borrower = GetMember( $borrowernumber, 'borrowernumber' );
63$template->param(
64 textmessaging => $borrower->{textmessaging},
65);
66
67# display news
68# use cookie setting for language, bug default to syspref if it's not set
69my $news_lang = $input->cookie('KohaOpacLanguage') || 'en';
70my $all_koha_news = &GetNewsToDisplay($news_lang);
71my $koha_news_count = scalar @$all_koha_news;
72
73$template->param(
74 koha_news => $all_koha_news,
75 koha_news_count => $koha_news_count
76);
77
78$template->param(
79 'Disable_Dictionary' => C4::Context->preference("Disable_Dictionary") )
80 if ( C4::Context->preference("Disable_Dictionary") );
81
82if ($usecache){
83 my $page = $template->output();
84 $memd->set("koha:opacmain:$borrowernumber", $page, 300);
85}
86C4::Output::output_html_with_http_headers $input, $cookie, $template->output;
87