1#!/usr/bin/perl -wT 2# 3# TWiki Enterprise Collaboration Platform, http://TWiki.org/ 4# 5# Copyright (C) 1999-2018 Peter Thoeny, peter[at]thoeny.org and 6# TWiki Contributors. All Rights Reserved. TWiki Contributors are 7# listed in the AUTHORS file in the root of this distribution. 8# 9# This program is free software; you can redistribute it and/or 10# modify it under the terms of the GNU General Public License 11# as published by the Free Software Foundation; either version 3 12# of the License, or (at your option) any later version. For 13# more details read LICENSE in the root of this distribution. 14# 15# This program is distributed in the hope that it will be useful, 16# but WITHOUT ANY WARRANTY; without even the implied warranty of 17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18# 19# As per the GPL, removal of this notice is prohibited. 20 21 22use strict; 23use warnings; 24 25BEGIN { 26 require Carp; 27 $SIG{__DIE__} = \&Carp::confess; 28 if ( defined $ENV{GATEWAY_INTERFACE} or defined $ENV{MOD_PERL} ) { 29 $TWiki::cfg{Engine} = 'TWiki::Engine::CGI'; 30 } 31 else { 32 $TWiki::cfg{Engine} = 'TWiki::Engine::CLI'; 33 } 34 $ENV{TWIKI_ACTION} = 'rest'; 35 @INC = ('.', grep { $_ ne '.' } @INC); 36 require 'setlib.cfg'; 37 38 if ($TWiki::cfg{Engine} eq 'TWiki::Engine::CGI') { 39 require CGI::Carp; 40 CGI::Carp->import(qw(fatalsToBrowser)); 41 $SIG{__DIE__} = \&CGI::Carp::confess; 42 } 43} 44 45use TWiki; 46use TWiki::UI; 47$TWiki::engine->run(); 48