| 1 | #!/usr/bin/perl -wT |
|---|
| 2 | # See bottom of file for license and copyright information |
|---|
| 3 | use strict; |
|---|
| 4 | use warnings; |
|---|
| 5 | |
|---|
| 6 | use File::Spec; |
|---|
| 7 | use FindBin qw( $Bin $Script ); |
|---|
| 8 | |
|---|
| 9 | BEGIN { |
|---|
| 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 | |
|---|
| 27 | use Foswiki (); |
|---|
| 28 | use Foswiki::UI (); |
|---|
| 29 | $Foswiki::engine->run(); |
|---|
| 30 | __END__ |
|---|
| 31 | Foswiki - The Free and Open Source Wiki, http://foswiki.org/ |
|---|
| 32 | |
|---|
| 33 | Copyright (C) 2008-2010 Foswiki Contributors. Foswiki Contributors |
|---|
| 34 | are listed in the AUTHORS file in the root of this distribution. |
|---|
| 35 | NOTE: Please extend that file, not this notice. |
|---|
| 36 | |
|---|
| 37 | Additional copyrights apply to some or all of the code in this |
|---|
| 38 | file as follows: |
|---|
| 39 | |
|---|
| 40 | Copyright (C) 1999-2007 Peter Thoeny, peter@thoeny.org |
|---|
| 41 | and TWiki Contributors. All Rights Reserved. TWiki Contributors |
|---|
| 42 | are listed in the AUTHORS file in the root of this distribution. |
|---|
| 43 | |
|---|
| 44 | This program is free software; you can redistribute it and/or |
|---|
| 45 | modify it under the terms of the GNU General Public License |
|---|
| 46 | as published by the Free Software Foundation; either version 2 |
|---|
| 47 | of the License, or (at your option) any later version. For |
|---|
| 48 | more details read LICENSE in the root of this distribution. |
|---|
| 49 | |
|---|
| 50 | This program is distributed in the hope that it will be useful, |
|---|
| 51 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 52 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|---|
| 53 | |
|---|
| 54 | As per the GPL, removal of this notice is prohibited. |
|---|