bin/setlib.cfg
changeset 0 414e01d06fd5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/bin/setlib.cfg	Sat Jan 26 15:50:53 2008 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +#
     1.5 +# TWiki Collaboration Platform, http://TWiki.org/
     1.6 +#
     1.7 +# This program is free software; you can redistribute it and/or
     1.8 +# modify it under the terms of the GNU General Public License
     1.9 +# as published by the Free Software Foundation; either version 2
    1.10 +# of the License, or (at your option) any later version. For
    1.11 +# more details read LICENSE in the root of this distribution.
    1.12 +#
    1.13 +# This program is distributed in the hope that it will be useful,
    1.14 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    1.16 +#
    1.17 +# setlib.cfg: determines the defaults for TWiki and Perl library paths
    1.18 +#
    1.19 +
    1.20 +###########################################################################
    1.21 +# DO NOT CHANGE THIS FILE - instead, create a file called LocalLib.cfg    #
    1.22 +# using the LocalLib.cfg.txt template file and customise your settings in #
    1.23 +# there. They will override any settings in this file.                    #
    1.24 +###########################################################################
    1.25 +
    1.26 +# for development, you can enable ASSERTS by adding
    1.27 +# $ENV{TWIKI_ASSERTS} = 1;
    1.28 +# to your bin/LocalLib.cfg
    1.29 +
    1.30 +use vars qw( $twikiLibPath @localPerlLibPath );
    1.31 +
    1.32 +eval 'require "LocalLib.cfg"';
    1.33 +
    1.34 +unless (( defined ($twikiLibPath) ) and (-e $twikiLibPath)) {
    1.35 +	use Cwd qw( abs_path );
    1.36 +	( $twikiLibPath ) = ($twikiLibPath = Cwd::abs_path( "../lib" )) =~ /(.*)/;
    1.37 +}
    1.38 +if ($twikiLibPath eq "") {
    1.39 +    $twikiLibPath = "../lib";
    1.40 +    warn "using relative path for libs - some plugins may break";
    1.41 +}
    1.42 +
    1.43 +#    Path to local Perl modules
    1.44 +my $defaultingCPANBASE = !defined($CPANBASE);
    1.45 +$CPANBASE = "$twikiLibPath/CPAN/lib/" unless $CPANBASE;
    1.46 +if ( -e $CPANBASE ) {
    1.47 +	require Config;
    1.48 +	my $VER = $Config::Config{version};
    1.49 +	my $SITEARCH = $Config::Config{archname};
    1.50 +	push @localPerlLibPath, ( "$CPANBASE/arch", "$CPANBASE/$VER/$SITEARCH", "$CPANBASE/$VER", "$CPANBASE" );
    1.51 +}
    1.52 +
    1.53 +# Prepend to @INC, the Perl search path for modules
    1.54 +unshift @INC, $twikiLibPath;
    1.55 +if ($defaultingCPANBASE) {
    1.56 +	push @INC, @localPerlLibPath if defined @localPerlLibPath;
    1.57 +} else {
    1.58 +	unshift @INC, @localPerlLibPath if defined @localPerlLibPath;
    1.59 +}
    1.60 +
    1.61 +1;			    	# Return success for module loading
    1.62 +