← Index
NYTProf Performance Profile   « line view »
For starman worker -M FindBin --max-requests 50 --workers 2 --user=kohadev-koha --group kohadev-koha --pid /var/run/koha/kohadev/plack.pid --daemonize --access-log /var/log/koha/kohadev/plack.log --error-log /var/log/koha/kohadev/plack-error.log -E deployment --socket /var/run/koha/kohadev/plack.sock /etc/koha/sites/kohadev/plack.psgi
  Run on Fri Jan 8 14:31:06 2016
Reported on Fri Jan 8 14:33:30 2016

Filename/home/vagrant/kohaclone/Koha/Template/Plugin/Koha.pm
StatementsExecuted 6 statements in 73µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111262µs380µsKoha::Template::Plugin::Koha::::BEGIN@20Koha::Template::Plugin::Koha::BEGIN@20
933100µs41.4msKoha::Template::Plugin::Koha::::PreferenceKoha::Template::Plugin::Koha::Preference
11129µs799µsKoha::Template::Plugin::Koha::::BEGIN@22Koha::Template::Plugin::Koha::BEGIN@22
11116µs19µsKoha::Template::Plugin::Koha::::BEGIN@24Koha::Template::Plugin::Koha::BEGIN@24
1116µs6µsKoha::Template::Plugin::Koha::::BEGIN@25Koha::Template::Plugin::Koha::BEGIN@25
0000s0sKoha::Template::Plugin::Koha::::VersionKoha::Template::Plugin::Koha::Version
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Koha::Template::Plugin::Koha;
2
3# Copyright ByWater Solutions 2013
4
5# This file is part of Koha.
6#
7# Koha is free software; you can redistribute it and/or modify it
8# under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 3 of the License, or
10# (at your option) any later version.
11#
12# Koha is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
202499µs
# spent 380µs (262+118) within Koha::Template::Plugin::Koha::BEGIN@20 which was called: # once (262µs+118µs) by Template::Plugins::_load at line 20
use Modern::Perl;
# spent 380µs making 1 call to Koha::Template::Plugin::Koha::BEGIN@20 # spent 118µs making 1 call to Modern::Perl::import
21
2221.57ms
# spent 799µs (29+770) within Koha::Template::Plugin::Koha::BEGIN@22 which was called: # once (29µs+770µs) by Template::Plugins::_load at line 22
use base qw( Template::Plugin );
# spent 799µs making 1 call to Koha::Template::Plugin::Koha::BEGIN@22 # spent 770µs making 1 call to base::import
23
24222µs
# spent 19µs (16+3) within Koha::Template::Plugin::Koha::BEGIN@24 which was called: # once (16µs+3µs) by Template::Plugins::_load at line 24
use C4::Context;
# spent 19µs making 1 call to Koha::Template::Plugin::Koha::BEGIN@24 # spent 3µs making 1 call to C4::Context::import
2516µs
# spent 6µs within Koha::Template::Plugin::Koha::BEGIN@25 which was called: # once (6µs+0s) by Template::Plugins::_load at line 25
use Koha;
# spent 6µs making 1 call to Koha::Template::Plugin::Koha::BEGIN@25
26
27=pod
28
29This plugin contains various Koha replated Template Toolkit functions
30to help streamline Koha and to move logic from the Perl code into the
31Templates when it makes sense to do so.
32
33To use, first, include the line '[% USE Koha %]' at the top
34of the template to enable the plugin.
35
36For example: [% IF Koha.Preference( 'MyPreference ) == 'SettingA' %]
37removes the necessity of setting a template variable in Perl code for
38each and every system preference, even if no evaluation of the setting
39is necessary.
40
41=cut
42
43
# spent 41.4ms (100µs+41.3) within Koha::Template::Plugin::Koha::Preference which was called 9 times, avg 4.60ms/call: # 4 times (48µs+21.6ms) by Template::Stash::XS::get at line 87 of koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc, avg 5.40ms/call # 4 times (41µs+16.8ms) by Template::Stash::XS::get at line 22 of koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc, avg 4.22ms/call # once (11µs+2.91ms) by Template::Stash::XS::get at line 174 of koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
sub Preference {
4432µs my ( $self, $pref ) = @_;
45371µs941.3ms return C4::Context->preference( $pref );
# spent 41.3ms making 9 calls to C4::Context::preference, avg 4.59ms/call
46}
47
48sub Version {
49 my $version_string = Koha::version();
50 my ( $major, $minor, $maintenance, $development ) = split( '\.', $version_string );
51
52 return {
53 major => $major,
54 release => $major . "." . $minor,
55 maintenance => $major . "." . $minor . "." . $maintenance,
56 development => ( $development ne '000' ) ? $development : undef,
57 };
58}
59
601;