richter 01/11/02 03:06:44
Modified: . Embperl.pod EmbperlD.pod MANIFEST Makefile.PL
Added: . embpfastcgi.pl.templ
Removed: . embpfastcgi.pl
Log:
FastCGI docs & script
Revision Changes Path
1.77 +7 -0 embperl/Embperl.pod
Index: Embperl.pod
===================================================================
RCS file: /home/cvs/embperl/Embperl.pod,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- Embperl.pod 2001/11/02 10:03:48 1.76
+++ Embperl.pod 2001/11/02 11:06:43 1.77
@@ -79,6 +79,8 @@
B<embpcgi.bat>
Use embpcgi.pl on Unix systems and embpcgi.bat on Win32 systems.
+You can also run Embperl with B<FastCGI>, in this case use embpfastcgi.pl
+as cgi script. You must have FCGI.pm installed.
If C<embpcgi.pl/embpcgi.bat> is invoked without any parameters and the
environment variable B<PATH_TRANSLATED> is set, it runs itself as a CGI
@@ -1804,6 +1806,11 @@
to zero. (only 1.3b6 and above)
=over 4
+
+=item B<$escmode = 8 (or 15)> (2.0b4 and above)
+
+The result of a Perl expression is always XML-escaped (e.g., `>'
+becomes `>' and ' become ').
=item B<$escmode = 3 (or 7)>
1.49 +8 -2 embperl/EmbperlD.pod
Index: EmbperlD.pod
===================================================================
RCS file: /home/cvs/embperl/EmbperlD.pod,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- EmbperlD.pod 2001/11/02 10:03:48 1.48
+++ EmbperlD.pod 2001/11/02 11:06:43 1.49
@@ -110,8 +110,9 @@
Um I<Embperl> als B<CGI Skript> zu nutzen, m�ssen Sie die Datei
C<embpcgi.pl> (bzw. C<embpcgi.bat> unter Windows) in Ihr CGI
-Verzeichnis kopieren (oft C</cgi-bin>). Zum Aufrufen verwenden Sie
-die URL
+Verzeichnis kopieren (oft C</cgi-bin>). Zur Benutzung mit FastCGI
+zusammen, verwenden Sie die Datei embpfastcgi.pl.
+Zum Aufrufen verwenden Sie die URL
http://www.domain.de/cgi-bin/embpcgi.pl/uri/ihres/embperl/dokuments
@@ -1716,6 +1717,11 @@
B<Hinweis 2:>Um bin�re Daten auszugeben mu� escmode auf Null gesetzt werden (ab
1.3b6)
=over 4
+
+=item B<$escmode = 8 (oder 15)> (2.0b4 und h�her)
+
+Das Resultat von Perlausdr�cken wird immer XML Kodiert
+(z.B. '>' wird zu '>' und ' zu ').
=item $escmode = 3 (oder 7)
1.71 +1 -0 embperl/MANIFEST
Index: MANIFEST
===================================================================
RCS file: /home/cvs/embperl/MANIFEST,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- MANIFEST 2001/09/08 13:23:21 1.70
+++ MANIFEST 2001/11/02 11:06:43 1.71
@@ -50,6 +50,7 @@
epocgi.pl.templ
epocgi.bat.templ
epocgi.test.pl.templ
+embpfastcgi.pl.templ
ep.h
epdat.h
epio.c
1.54 +136 -30 embperl/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/embperl/Makefile.PL,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- Makefile.PL 2001/09/08 13:23:21 1.53
+++ Makefile.PL 2001/11/02 11:06:43 1.54
@@ -1,8 +1,9 @@
#
# Building Makefile for Embperl
#
-# (C) 1997-1999 G.Richter ([EMAIL PROTECTED]) / ECOS
+# (C) 1997-2001 G.Richter ([EMAIL PROTECTED]) / ECOS
#
+# $Id: Makefile.PL,v 1.54 2001/11/02 11:06:43 richter Exp $
#
@@ -181,12 +182,23 @@
my $txt = $self -> MM::c_o (@_) ;
- $txt =~ s/\$\*/-o \$*.o \$*/ ;
+ $txt =~ s/\$\*/-o \$*\$(OBJ_EXT) \$*/g ;
+ my @txt = split (/\n/, $txt) ;
+ my $cpp = 0 ;
+ foreach (@txt)
+ {
+ if (/\$\*\.cpp/)
+ {
+ s/\$\(CCCMD\)/\$(CPPCMD) \$(CPPFLAGS)/ ;
+ }
+ }
+ $txt = join ("\n", @txt) ;
return $txt ;
}
+
sub MY::cflags
{
my $self = shift ;
@@ -197,6 +209,18 @@
return $txt ;
}
+sub MY::const_cccmd
+ {
+ my $self = shift ;
+
+ my $txt = $self -> MM::const_cccmd (@_) ;
+ my $txt2 = $txt ;
+ $txt2 =~ s/\$\(CC\)/\$(CPP)/ ;
+ $txt2 =~ s/CCCMD/CPPCMD/ ;
+
+ return "$txt\n\n$txt2" ;
+ }
+
sub MY::post_initialize
{
@@ -229,6 +253,20 @@
$self -> MM::post_initialize (@_) ;
}
+
+ sub MY::post_constants
+ {
+ my $self = shift ;
+
+
+ my $txt = $self -> MM::post_constants (@_) ;
+
+ $txt .= "\n# Change name of dynamic lib, in case we need two of them (with
and w/o Apache support)\nINST_DYNAMIC =
\$(INST_ARCHAUTODIR)\\\$(DLBASE).NoApache.\$(DLEXT)\n" if ($EPNOAPACHELIB) ;
+
+ return $txt ;
+
+ }
+
## ----------------------------------------------------------------------------
sub GetString
@@ -274,14 +312,14 @@
my ($key, $path) = @_ ;
- open FH, $path or return undef ;
+ open CFGFH, $path or return undef ;
- while (<FH>)
+ while (<CFGFH>)
{
return $1 if (/^$key\s*(?:=|\s)\s*(.*?)$/) ;
}
- close FH ;
+ close CFGFH ;
return undef ;
}
@@ -323,11 +361,11 @@
$cmd =~ s/\//\\/g if ($win32) ;
- open FH, "$cmd|" or die "\nCannot start $cmd\nPlease make sure you have build
Apache and mod_perl before makeing Embperl\n" ;
+ open STFH, "$cmd|" or die "\nCannot start $cmd\nPlease make sure you have build
Apache and mod_perl before makeing Embperl\n" ;
- my @x = <FH> or die "\nCannot start $cmd\nPlease make sure you have build
Apache and mod_perl before makeing Embperl\n" ;
+ my @x = <STFH> or die "\nCannot start $cmd\nPlease make sure you have build
Apache and mod_perl before makeing Embperl\n" ;
- close FH ;
+ close STFH ;
return @x ;
}
@@ -344,13 +382,13 @@
$cmd =~ s/\//\\/g if ($win32) ;
- open FH, "$cmd|" or return 1 ;
+ open STFH, "$cmd|" or return 1 ;
- my @x = <FH> ;
+ my @x = <STFH> ;
#print "@x" ;
- my $code = close FH ;
+ my $code = close STFH ;
#print "Code = $code ; ? = $?\n" ;
return $? ;
@@ -440,10 +478,11 @@
}
}
+eval 'do "test/conf/config.pl"' ;
+
+
if (!$apache && $apache_src eq '')
{
- eval 'do "test/conf/config.pl"' ;
-
$apache_src = $EPAPACHESRC ;
$loadmodules = $EPMODPERL ;
}
@@ -588,11 +627,18 @@
$o = '' ;
}
$d = "-DAPACHE" ;
-
+ $EPNOAPACHELIB = 0 ;
}
else
{
$apache = 0 ;
+ if ($win32 && ($EPAPACHESRC || $EPNOAPACHELIB) && -f
'blib/arch/auto/HTML/Embperl/Embperl.dll')
+ {
+ print "\nYou have already build Embperl with support for Apache mod_perl\n"
;
+ $EPNOAPACHELIB = GetYesNo ("Do you want to build a separate dynamic library
for use without Apache?", 'y') ;
+ }
+
+
print "Will build without mod_perl support\n" ;
$i = '' ;
$d = '' ;
@@ -602,9 +648,9 @@
if ($win32 && $apache)
{ # borrowed from mod_perl
- local *FH;
- open FH, ">dirent.h" || die "can't write dirent.h $!";
- print FH <<EOF;
+ local *DEFH;
+ open DEFH, ">dirent.h" || die "can't write dirent.h $!";
+ print DEFH <<EOF;
/* major kludge to workaround conflict(s) between perl's dirent.h and apache's
readdir.h */
#ifdef WIN32
@@ -615,7 +661,7 @@
#endif
EOF
- close FH;
+ close DEFH;
if ($ENV{APACHE_PERL_DLL})
{
@@ -668,9 +714,12 @@
}
else
{
- $EPHTTPD = "$EPHTTPDDLL/Apache.exe" ;
- $EPHTTPD =~ s#core([rd])/Apache.exe#Apache$1/Apache.exe#i ;
- $EPHTTPD =~ s#libexec/Apache.exe#Apache.exe#i ;
+ if (!$EPHTTPD || !-e $EPHTTPD)
+ {
+ $EPHTTPD = "$EPHTTPDDLL/Apache.exe" ;
+ $EPHTTPD =~ s#core([rd])/Apache.exe#Apache$1/Apache.exe#i ;
+ $EPHTTPD =~ s#libexec/Apache.exe#Apache.exe#i ;
+ }
$EPUSER = 'www' ; # dummy value
$EPGROUP = 'www' ;
if (!-e $EPHTTPD)
@@ -924,6 +973,7 @@
print FH "\$EP2='$EP2';\n" ;
print FH "\$EPMODPERLVERSION='$MPVer';\n" ;
print FH "\$EPC_ENABLE='$epc_enable';\n" ;
+ print FH "\$EPNOAPACHELIB='$EPNOAPACHELIB';\n" ;
if ($win32)
{
print FH "\$EPNULL='nul';\n" ;
@@ -935,7 +985,6 @@
- close FH ;
}
else
{
@@ -965,7 +1014,13 @@
print FH "\$EPSESSIONXVERSION='$SessXVer';\n" ;
print FH "\$EPSSLDISABLE='$EPSSLDISABLE' ;\n" ;
print FH "\$EP2='$EP2';\n" ;
- close FH ;
+ print FH "\$EPNOAPACHELIB='$EPNOAPACHELIB';\n" ;
+ print FH "\$EPC_ENABLE='$epc_enable';\n" ;
+ print FH "\$EPHTTPD='" . cnvpath($EPHTTPD) . "' ;\n" ;
+ print FH "\$EPHTTPDDLL='" . cnvpath($EPHTTPDDLL) . "' ;\n" ;
+ print FH "\$EPWIN32='$win32' ;\n" ;
+ print FH "\$EPAPACHESRC='" . cnvpath($EPAPACHESRC) . "' ;\n" ;
+ print FH "\$EPMODPERL='" . cnvpath2unix($loadmodules) . "';\n" ;
}
# $d .= ' -DPERL_IS_5_6 ' if $] >= 5.006;
@@ -983,19 +1038,19 @@
my $os_h = "$inc_dir/os.h" ;
$os_h = "$inc_dir/../os/win32/os.h" if (!-e $os_h) ;
- if (open FH, $os_h )
+ if (open FH2, $os_h )
{
- my @conf = <FH> ;
- close FH ;
+ my @conf = <FH2> ;
+ close FH2 ;
if (grep (/winsock2\.h/, @conf))
{
$d .= ' -D_WINSOCK2API_ -D_MSWSOCK_ ' ;
}
- elsif (open FH, "$inc_dir/ap_config.h")
+ elsif (open FH2, "$inc_dir/ap_config.h")
{
- @conf = <FH> ;
- close FH ;
+ @conf = <FH2> ;
+ close FH2 ;
if (grep (/winsock2\.h/, @conf))
{
@@ -1013,7 +1068,56 @@
$dynlib->{'OTHERLDFLAGS'} .= " $lddebug" ;
+#
+# See if we need to link to any other libraries
+#
+
+my $makemacros = {} ;
+if ($EP2)
+ {
+ opendir DH, "driver" or die "Cannot open directory driver ($!)" ;
+ my @files = readdir DH ;
+ closedir DH ;
+ my @makefiles = grep (/\.MAKEPL$/, @files) ;
+
+ foreach my $makepl (@makefiles)
+ {
+ #print "Exec driver/$makepl\n" ;
+ my $result = do "driver/$makepl" ;
+ if ($@)
+ {
+ print $@ ;
+ next ;
+ }
+ if (ref $result)
+ {
+ #while (my ($k, $v) = each %$result)
+ # {
+ # print "$k = $v\n" ;
+ # }
+ $libs .= ' ' . $result->{libs} ;
+ $i .= ' ' . $result->{cflags} ;
+ $d .= ' ' . $result->{defines} ;
+ $o .= ' ' . $result->{objects} ;
+ $makemacros->{CPP} = $result->{cpp} if ($result->{cpp}) ;
+ $makemacros->{CPPFLAGS} = $result->{cppflags} if ($result->{cppflags}) ;
+ if ($result->{save})
+ {
+ while (($k, $v) = each (%{$result->{save}}))
+ {
+ print FH "$k='" . $v . "';\n" ;
+ }
+ }
+ }
+ }
+
+ }
+
+
+close FH ;
+
+
WriteMakefile(
'NAME' => 'HTML::Embperl',
'VERSION_FROM' => 'Embperl.pm', # finds $VERSION
@@ -1030,7 +1134,8 @@
'PREREQ_PM' => { 'File::Spec' => 0.8 },
'ABSTRACT' => 'Embed Perl code in HTML documents',
'AUTHOR' => 'Gerald Richter <[EMAIL PROTECTED]>',
-
+ 'macro' => $makemacros,
+ $EP2?('depend' => { 'Embperl.c' => 'Embperl.xs DOM.xs Cmd.xs Syntax.xs'
}):(),
);
@@ -1041,6 +1146,7 @@
@bins = ('embpexec.pl','embpexec.bat',
'embpcgi.pl', 'embpcgi.test.pl', 'embpcgi.bat',
+ 'embpfastcgi.pl',
'epocgi.pl', 'epocgi.test.pl', 'epocgi.bat') ;
1.1 embperl/embpfastcgi.pl.templ
Index: embpfastcgi.pl.templ
===================================================================
#!/usr/bin/perl
###################################################################################
#
# Embperl - Copyright (c) 1997-2001 Gerald Richter / ECOS
#
# You may distribute under the terms of either the GNU General Public
# License or the Artistic License, as specified in the Perl README file.
# For use with Apache httpd and mod_perl, see also Apache copyright.
#
# THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# $Id: embpfastcgi.pl.templ,v 1.1 2001/11/02 11:06:44 richter Exp $
#
###################################################################################
use FCGI ;
use HTML::Embperl;
my $request = FCGI::Request ;
while ($request -> Accept() >= 0)
{
my $rc = HTML::Embperl::runcgi ;
if ($rc)
{
$time = localtime ;
print <<EOT;
Status: $rc
Content-Type: text/html
<HTML><HEAD><TITLE>Embperl Error</TITLE></HEAD>
<BODY bgcolor=\"#FFFFFF\">
<H1>embpcgi Server Error: $rc</H1>
Please contact the server administrator, $ENV{SERVER_ADMIN} and inform them of
the time the error occurred, and anything you might have done that may have caused the
error.<P><P>
$ENV{SERVER_SOFTWARE} HTML::Embperl $HTML::Embperl::VERSION [$time]<P>
</BODY></HTML>
EOT
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]