Filename | /var/www/foswikidev/core/bin/setlib.cfg |
Statements | Executed 17 statements in 712µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 5.70ms | 6.15ms | BEGIN@28 | Foswiki::
1 | 1 | 1 | 33µs | 78µs | BEGIN@18 | Foswiki::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | # | ||||
3 | # setlib.cfg: determines the defaults for Foswiki and Perl library paths | ||||
4 | |||||
5 | ########################################################################### | ||||
6 | # DO NOT CHANGE THIS FILE - instead, create a file called LocalLib.cfg # | ||||
7 | # using the LocalLib.cfg.txt template file and customise your settings in # | ||||
8 | # there. They will override any settings in this file. # | ||||
9 | ########################################################################### | ||||
10 | |||||
11 | # for development, you can enable ASSERTS by adding | ||||
12 | # $ENV{FOSWIKI_ASSERTS} = 1; | ||||
13 | # to your bin/LocalLib.cfg | ||||
14 | |||||
15 | # Declare package Foswiki, so globals end up in $Foswiki space | ||||
16 | package Foswiki; | ||||
17 | |||||
18 | 2 | 143µs | 2 | 123µs | # spent 78µs (33+45) within Foswiki::BEGIN@18 which was called:
# once (33µs+45µs) by main::BEGIN@8 at line 18 # spent 78µs making 1 call to Foswiki::BEGIN@18
# spent 45µs making 1 call to vars::import |
19 | |||||
20 | 1 | 1µs | my $LocalLib = __FILE__; # the dir where this setlib.cfg resides | ||
21 | 1 | 6µs | $LocalLib =~ s/setlib.cfg$/LocalLib.cfg/; | ||
22 | 1 | 5µs | require $LocalLib if -r $LocalLib; | ||
23 | # if foswikiLibPath isn't defined, then see if $twikiLibPath is | ||||
24 | # for compatibility | ||||
25 | 1 | 700ns | $foswikiLibPath = $twikiLibPath unless defined( $foswikiLibPath ); | ||
26 | |||||
27 | 1 | 1µs | unless (( defined ($foswikiLibPath) ) and (-e $foswikiLibPath)) { | ||
28 | 2 | 482µs | 2 | 6.20ms | # spent 6.15ms (5.70+448µs) within Foswiki::BEGIN@28 which was called:
# once (5.70ms+448µs) by main::BEGIN@8 at line 28 # spent 6.15ms making 1 call to Foswiki::BEGIN@28
# spent 45µs making 1 call to Exporter::import |
29 | 1 | 500ns | my $bindir = __FILE__; | ||
30 | 1 | 2µs | $bindir =~ s/setlib.cfg$//; | ||
31 | 1 | 48µs | 1 | 29µs | ( $foswikiLibPath ) = ($foswikiLibPath = Cwd::abs_path( "$bindir../lib" )) =~ /(.*)/; # spent 29µs making 1 call to Cwd::abs_path |
32 | } | ||||
33 | 1 | 600ns | if ($foswikiLibPath eq "") { | ||
34 | $foswikiLibPath = "../lib"; | ||||
35 | warn "using relative path for libs - some plugins may break"; | ||||
36 | } | ||||
37 | |||||
38 | # Prepend to @INC, the Perl search path for modules | ||||
39 | 1 | 2µs | unshift @INC, $foswikiLibPath; | ||
40 | 1 | 500ns | unshift @INC, @localPerlLibPath if @localPerlLibPath; | ||
41 | # Append lib/CPAN/lib for absolutely needed dependencies | ||||
42 | 1 | 2µs | push @INC, "$foswikiLibPath/CPAN/lib"; | ||
43 | |||||
44 | 1 | 19µs | 1; # Return success for module loading | ||
45 | |||||
46 | __END__ |