source: main/trunk/greenstone2/cgi-bin/experimental-ocr-server.pl@ 24872

Last change on this file since 24872 was 24872, checked in by ak19, 12 years ago

First set of changes to do with migration of cgi-bin into common-src, so that upon make install, common-src\cgi-bin will be installed in cgi-bin\GSDLOS(GSDLARCH). After this commit (to do with the contents of the files), cgi-bin itself will be moved.

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!C:\Perl\bin\perl -w
2
3##!/usr/bin/perl -w
4##!C:\\Perl\\bin\\perl -w
5
6# If not explicitly associating .pl filename ending with Perl in the
7# web server's configuration file, then need to specify the full path of
8# Perl above
9
10use strict;
11
12BEGIN {
13 # Line to stop annoying child DOS CMD windows from appearing
14 Win32::SetChildShowWindow(0)
15 if defined &Win32::SetChildShowWindow;
16
17}
18
19# Set this to 1 to work around IIS 6 craziness
20my $iis6_mode = 0;
21
22
23# IIS 6: for some reason, IIS runs this script with the working
24# directory set to the Greenstone directory rather than the cgi-bin
25# directory, causing lots of stuff to fail
26if ($iis6_mode)
27{
28 # Change into cgi-bin\<OS> directory
29 chdir("cgi-bin");
30 if(defined $ENV{'GSDLARCH'}) {
31 chdir($ENV{'GSDLOS'}.$ENV{'GSDLARCH'});
32 } else {
33 chdir($ENV{'GSDLOS'});
34 }
35}
36
37
38# We use require and an eval here (instead of "use") to catch any
39# errors loading the module (for IIS)
40eval('require "./gsdlCGI.pm"');
41if ($@)
42{
43 print STDOUT "Content-type:text/plain\n\n";
44 print STDOUT "ERROR: $@\n";
45 exit 0;
46}
47
48sub main
49{
50 my $gsdl_cgi = new gsdlCGI();
51 $gsdl_cgi->setup_gsdl();
52
53 my $gsdlhome = $ENV{'GSDLHOME'};
54 $gsdl_cgi->checked_chdir($gsdlhome);
55
56 require cgiactions::ocraction;
57
58 $gsdl_cgi->parse_cgi_args();
59 $gsdl_cgi->{'xml'} = 0;
60
61 my $action = new ocraction($gsdl_cgi,$iis6_mode);
62 $action->do_action();
63}
64
65&main();
Note: See TracBrowser for help on using the repository browser.