Last change
on this file since 23465 was 23404, checked in by max, 14 years ago |
Magic one liner that stops the flash DOS CMD window problem!
|
-
Property svn:executable
set to
*
|
File size:
1.4 KB
|
Rev | Line | |
---|
[23404] | 1 | #!C:\\Perl\\bin\\perl -w
|
---|
[19293] | 2 | # Need to specify the full path of Perl above
|
---|
| 3 |
|
---|
| 4 | use strict;
|
---|
| 5 |
|
---|
[23404] | 6 | BEGIN {
|
---|
| 7 | # Line to stop annoying child DOS CMD windows from appearing
|
---|
| 8 | Win32::SetChildShowWindow(0)
|
---|
| 9 | if defined &Win32::SetChildShowWindow;
|
---|
| 10 | }
|
---|
[19293] | 11 |
|
---|
| 12 | # Set this to 1 to work around IIS 6 craziness
|
---|
| 13 | my $iis6_mode = 0;
|
---|
| 14 |
|
---|
| 15 |
|
---|
| 16 | # IIS 6: for some reason, IIS runs this script with the working directory set to the Greenstone
|
---|
| 17 | # directory rather than the cgi-bin directory, causing lots of stuff to fail
|
---|
| 18 | if ($iis6_mode)
|
---|
| 19 | {
|
---|
| 20 | # Change into cgi-bin directory
|
---|
| 21 | chdir("cgi-bin");
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 |
|
---|
| 25 | # We use require and an eval here (instead of "use") to catch any errors loading the module (for IIS)
|
---|
| 26 | eval("require \"gsdlCGI.pm\"");
|
---|
| 27 | if ($@)
|
---|
| 28 | {
|
---|
| 29 | print STDOUT "Content-type:text/plain\n\n";
|
---|
| 30 | print STDOUT "ERROR: $@\n";
|
---|
| 31 | exit 0;
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 | sub main
|
---|
| 36 | {
|
---|
| 37 | my $gsdl_cgi = new gsdlCGI();
|
---|
| 38 |
|
---|
| 39 |
|
---|
| 40 | # Load the Greenstone modules that we need to use
|
---|
| 41 | $gsdl_cgi->setup_gsdl();
|
---|
[23404] | 42 |
|
---|
[19293] | 43 | my $gsdlhome = $ENV{'GSDLHOME'};
|
---|
| 44 | $gsdl_cgi->checked_chdir($gsdlhome);
|
---|
| 45 |
|
---|
| 46 | require cgiactions::metadataaction;
|
---|
| 47 |
|
---|
| 48 |
|
---|
| 49 | # Useful debug statement for seeing what packages have been included
|
---|
| 50 | #### printf("%-45s%-s\n",$_,$INC{$_}) foreach (sort keys %INC);
|
---|
| 51 |
|
---|
| 52 |
|
---|
| 53 | $gsdl_cgi->parse_cgi_args();
|
---|
| 54 |
|
---|
| 55 | # We don't want the gsdlCGI module to return errors and warnings in XML
|
---|
| 56 | $gsdl_cgi->{'xml'} = 0;
|
---|
| 57 |
|
---|
| 58 | my $action = new metadataaction($gsdl_cgi,$iis6_mode);
|
---|
| 59 |
|
---|
| 60 | $action->do_action();
|
---|
| 61 |
|
---|
| 62 |
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 |
|
---|
| 66 |
|
---|
| 67 | &main();
|
---|
Note:
See
TracBrowser
for help on using the repository browser.