source: branches/Release01x01/CompareRevisionsAddOn/bin/compare @ 9941

Revision 9941, 1.8 KB checked in by OlivierRaginel, 3 years ago (diff)

Item9983: su_exec environment do not expose FILE, but FindBin is clever enough to find it anyway. Should work everywhere. Tried Linux, OS-X and XP

  • Property svn:executable set to *
Line 
1#!/usr/bin/perl -wT
2# See bottom of file for license and copyright information
3use strict;
4use warnings;
5
6use File::Spec;
7use FindBin qw( $Bin $Script );
8
9BEGIN {
10    if ( defined $ENV{GATEWAY_INTERFACE} || defined $ENV{MOD_PERL} ) {
11        $Foswiki::cfg{Engine} = 'Foswiki::Engine::CGI';
12        use CGI::Carp qw(fatalsToBrowser);
13        $SIG{__DIE__} = \&CGI::Carp::confess;
14    }
15    else {
16        $Foswiki::cfg{Engine} = 'Foswiki::Engine::CLI';
17        require Carp;
18        $SIG{__DIE__} = \&Carp::confess;
19    }
20    my @path = File::Spec->splitpath($Bin);
21    my $setlib = File::Spec->catfile( @path, 'setlib.cfg' );
22    require $setlib;
23    $Script =~ s/\..*$//;    # Remove optional file extension
24    $ENV{FOSWIKI_ACTION} = $Script;
25}
26
27use Foswiki     ();
28use Foswiki::UI ();
29$Foswiki::engine->run();
30__END__
31Foswiki - The Free and Open Source Wiki, http://foswiki.org/
32
33Copyright (C) 2008-2010 Foswiki Contributors. Foswiki Contributors
34are listed in the AUTHORS file in the root of this distribution.
35NOTE: Please extend that file, not this notice.
36
37Additional copyrights apply to some or all of the code in this
38file as follows:
39
40Copyright (C) 1999-2007 Peter Thoeny, peter@thoeny.org
41and TWiki Contributors. All Rights Reserved. TWiki Contributors
42are listed in the AUTHORS file in the root of this distribution.
43
44This program is free software; you can redistribute it and/or
45modify it under the terms of the GNU General Public License
46as published by the Free Software Foundation; either version 2
47of the License, or (at your option) any later version. For
48more details read LICENSE in the root of this distribution.
49
50This program is distributed in the hope that it will be useful,
51but WITHOUT ANY WARRANTY; without even the implied warranty of
52MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
53
54As per the GPL, removal of this notice is prohibited.
Note: See TracBrowser for help on using the repository browser.