don't run objavi2.py javascript
[objavi2.git] / perl / setlib.cfg
blobd838a8587d0b7df8ba470296d871b2a3b3c532ea
2 # TWiki Collaboration Platform, http://TWiki.org/
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version. For
8 # more details read LICENSE in the root of this distribution.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 # setlib.cfg: determines the defaults for TWiki and Perl library paths
17 ###########################################################################
18 # DO NOT CHANGE THIS FILE - instead, create a file called LocalLib.cfg    #
19 # using the LocalLib.cfg.txt template file and customise your settings in #
20 # there. They will override any settings in this file.                    #
21 ###########################################################################
23 # for development, you can enable ASSERTS by adding
24 # $ENV{TWIKI_ASSERTS} = 1;
25 # to your bin/LocalLib.cfg
27 use vars qw( $twikiLibPath @localPerlLibPath );
29 eval 'require "LocalLib.cfg"';
31 unless (( defined ($twikiLibPath) ) and (-e $twikiLibPath)) {
32         use Cwd qw( abs_path );
33         ( $twikiLibPath ) = ($twikiLibPath = Cwd::abs_path( "../lib" )) =~ /(.*)/;
35 if ($twikiLibPath eq "") {
36     $twikiLibPath = "../lib";
37     warn "using relative path for libs - some plugins may break";
40 #    Path to local Perl modules
41 my $defaultingCPANBASE = !defined($CPANBASE);
42 $CPANBASE = "$twikiLibPath/CPAN/lib/" unless $CPANBASE;
43 if ( -e $CPANBASE ) {
44         require Config;
45         my $VER = $Config::Config{version};
46         my $SITEARCH = $Config::Config{archname};
47         push @localPerlLibPath, ( "$CPANBASE/arch", "$CPANBASE/$VER/$SITEARCH", "$CPANBASE/$VER", "$CPANBASE" );
50 # Prepend to @INC, the Perl search path for modules
51 unshift @INC, $twikiLibPath;
52 if ($defaultingCPANBASE) {
53         push @INC, @localPerlLibPath if defined @localPerlLibPath;
54 } else {
55         unshift @INC, @localPerlLibPath if defined @localPerlLibPath;
58 1;                              # Return success for module loading