From: <de...@de...> - 2008-02-28 06:35:44
|
Author: GilmarSantosJr Date: 2008-02-28 00:35:44 -0600 (Thu, 28 Feb 2008) New Revision: 16464 Trac url: http://develop.twiki.org/trac/changeset/16464 Removed: twiki/scratch/TWikiStandAlone/core/bin/twiki_cli.pl Modified: twiki/scratch/TWikiStandAlone/core/bin/attach twiki/scratch/TWikiStandAlone/core/bin/changes twiki/scratch/TWikiStandAlone/core/bin/edit twiki/scratch/TWikiStandAlone/core/bin/login twiki/scratch/TWikiStandAlone/core/bin/logon twiki/scratch/TWikiStandAlone/core/bin/manage twiki/scratch/TWikiStandAlone/core/bin/oops twiki/scratch/TWikiStandAlone/core/bin/preview twiki/scratch/TWikiStandAlone/core/bin/rdiff twiki/scratch/TWikiStandAlone/core/bin/rdiffauth twiki/scratch/TWikiStandAlone/core/bin/register twiki/scratch/TWikiStandAlone/core/bin/rename twiki/scratch/TWikiStandAlone/core/bin/resetpasswd twiki/scratch/TWikiStandAlone/core/bin/rest twiki/scratch/TWikiStandAlone/core/bin/save twiki/scratch/TWikiStandAlone/core/bin/search twiki/scratch/TWikiStandAlone/core/bin/statistics twiki/scratch/TWikiStandAlone/core/bin/twiki_cgi.pl twiki/scratch/TWikiStandAlone/core/bin/upload twiki/scratch/TWikiStandAlone/core/bin/view twiki/scratch/TWikiStandAlone/core/bin/viewauth twiki/scratch/TWikiStandAlone/core/bin/viewfile Log: Item4662: TWikiStandAlone * Enhance bin/twiki_cgi.pl * CLI keeps working, with scripts linking to twiki_cgi.pl * CGI engine is a perfect drop-in replacement for tradicional setup (no configuration changes needed) Modified: twiki/scratch/TWikiStandAlone/core/bin/attach =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/attach 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/attach 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/changes =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/changes 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/changes 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/edit =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/edit 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/edit 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/login =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/login 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/login 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/logon =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/logon 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/logon 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/manage =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/manage 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/manage 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/oops =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/oops 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/oops 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/preview =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/preview 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/preview 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/rdiff =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/rdiff 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/rdiff 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/rdiffauth =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/rdiffauth 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/rdiffauth 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/register =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/register 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/register 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/rename =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/rename 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/rename 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/resetpasswd =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/resetpasswd 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/resetpasswd 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/rest =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/rest 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/rest 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/save =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/save 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/save 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/search =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/search 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/search 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/statistics =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/statistics 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/statistics 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/twiki_cgi.pl =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/twiki_cgi.pl 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/twiki_cgi.pl 2008-02-28 06:35:44 UTC (rev 16464) @@ -22,15 +22,22 @@ use warnings; BEGIN { - $TWiki::cfg{Engine} = 'TWiki::Engine::CGI'; + if ( defined $ENV{GATEWAY_INTERFACE} ) { + $TWiki::cfg{Engine} = 'TWiki::Engine::CGI'; + my $action = (split m!/!, $ENV{SCRIPT_NAME})[-1]; + $ENV{PATH_INFO} = "/$action" . $ENV{PATH_INFO}; + use CGI::Carp qw(fatalsToBrowser); + $SIG{__DIE__} = \&CGI::Carp::confess; + } + else { + $TWiki::cfg{Engine} = 'TWiki::Engine::CLI'; + require Carp; + $SIG{__DIE__} = \&Carp::confess; + } @INC = ('.', grep { $_ ne '.' } @INC); require 'setlib.cfg'; } -use CGI::Carp qw(fatalsToBrowser); - -local $SIG{__DIE__} = \&CGI::Carp::confess; - use TWiki; use TWiki::UI; $TWiki::engine->run(); Deleted: twiki/scratch/TWikiStandAlone/core/bin/twiki_cli.pl =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/twiki_cli.pl 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/twiki_cli.pl 2008-02-28 06:35:44 UTC (rev 16464) @@ -1,36 +0,0 @@ -#!/usr/bin/perl -wT -# -# TWiki Enterprise Collaboration Platform, http://TWiki.org/ -# -# Copyright (C) 1999-2007 Peter Thoeny, pe...@th... -# and TWiki Contributors. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. For -# more details read LICENSE in the root of this distribution. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -# As per the GPL, removal of this notice is prohibited. - - -use strict; -use warnings; - -BEGIN { - $TWiki::cfg{Engine} = 'TWiki::Engine::CLI'; - @INC = ('.', grep { $_ ne '.' } @INC); - require 'setlib.cfg'; -} - -use Carp; - -local $SIG{__DIE__} = \&Carp::confess; - -use TWiki; -use TWiki::UI; -$TWiki::engine->run(); Modified: twiki/scratch/TWikiStandAlone/core/bin/upload =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/upload 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/upload 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/view =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/view 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/view 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/viewauth =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/viewauth 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/viewauth 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file Modified: twiki/scratch/TWikiStandAlone/core/bin/viewfile =================================================================== --- twiki/scratch/TWikiStandAlone/core/bin/viewfile 2008-02-28 05:44:07 UTC (rev 16463) +++ twiki/scratch/TWikiStandAlone/core/bin/viewfile 2008-02-28 06:35:44 UTC (rev 16464) @@ -1 +1 @@ -link twiki_cli.pl \ No newline at end of file +link twiki_cgi.pl \ No newline at end of file |