← 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:31:39 2016

Filename/home/vagrant/kohaclone/Koha/Template/Plugin/Koha.pm
StatementsExecuted 15 statements in 633µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
33334µs13.8msKoha::Template::Plugin::Koha::::PreferenceKoha::Template::Plugin::Koha::Preference
11132µs123µsKoha::Template::Plugin::Koha::::BEGIN@20Koha::Template::Plugin::Koha::BEGIN@20
11117µs20µsKoha::Template::Plugin::Koha::::BEGIN@24Koha::Template::Plugin::Koha::BEGIN@24
11111µs846µsKoha::Template::Plugin::Koha::::BEGIN@22Koha::Template::Plugin::Koha::BEGIN@22
1117µs7µ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
202142µs2213µs
# spent 123µs (32+90) within Koha::Template::Plugin::Koha::BEGIN@20 which was called: # once (32µs+90µs) by Template::Plugins::_load at line 20
use Modern::Perl;
# spent 123µs making 1 call to Koha::Template::Plugin::Koha::BEGIN@20 # spent 90µs making 1 call to Modern::Perl::import
21
222232µs21.68ms
# spent 846µs (11+835) within Koha::Template::Plugin::Koha::BEGIN@22 which was called: # once (11µs+835µs) by Template::Plugins::_load at line 22
use base qw( Template::Plugin );
# spent 846µs making 1 call to Koha::Template::Plugin::Koha::BEGIN@22 # spent 835µs making 1 call to base::import
23
24238µs223µs
# spent 20µs (17+3) within Koha::Template::Plugin::Koha::BEGIN@24 which was called: # once (17µs+3µs) by Template::Plugins::_load at line 24
use C4::Context;
# spent 20µs making 1 call to Koha::Template::Plugin::Koha::BEGIN@24 # spent 3µs making 1 call to C4::Context::import
252160µs17µs
# spent 7µs within Koha::Template::Plugin::Koha::BEGIN@25 which was called: # once (7µs+0s) by Template::Plugins::_load at line 25
use Koha;
# spent 7µ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 13.8ms (34µs+13.7) within Koha::Template::Plugin::Koha::Preference which was called 3 times, avg 4.59ms/call: # once (12µs+7.81ms) by Template::Stash::XS::get at line 87 of koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc # once (15µs+3.30ms) by Template::Stash::XS::get at line 22 of koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc # once (7µs+2.64ms) 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 ) = @_;
45358µs313.7ms return C4::Context->preference( $pref );
# spent 13.7ms making 3 calls to C4::Context::preference, avg 4.58ms/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
6013µs1;