Re: PerlInitHandler and PerlSetEnv

2001-07-11 Thread Gerald Richter

 
  There is no directory, .htaccess in the context and that's like it
really
  behaves. (unless they changed it in a very recent version and didn't
update
  the docs, which I don't expect)
 
  PerlSetEnv is the only chance to have different values in different
  directories.

 i think the docs are out-of-date, seems to work inside location:


Doug, you are right. It apears in the Apache CHANGES file for 1.3.7, but the
docs still not updated

Gerald

P.S. I have made a bug report, so hopefully the docs will get updated also

-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925131
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-





RE: PerlInitHandler and PerlSetEnv

2001-07-10 Thread Michael Barry

Doug,
   Thanks for the quick turn around. The patch works
great.
-MikeB.

-Original Message-
From: Doug MacEachern [mailto:[EMAIL PROTECTED]]


this patch should fix the problem.  you should also be able to
s/PerlSetEnv/SetEnv/g, unless Embperl needs these variables before the
fixup phase.





Re: PerlInitHandler and PerlSetEnv

2001-07-10 Thread Doug MacEachern

On Tue, 10 Jul 2001, Gerald Richter wrote:
 
 The docs says:
 
 SetEnv directive
 Syntax: SetEnv variable value
 Context: server config, virtual host
 Status: Base
 Module: mod_env
 Compatibility: SetEnv is only available in Apache 1.1 and later.
 Sets an environment variable, which is then passed on to CGI scripts and SSI
 pages. Example:
 
 There is no directory, .htaccess in the context and that's like it really
 behaves. (unless they changed it in a very recent version and didn't update
 the docs, which I don't expect)
 
 PerlSetEnv is the only chance to have different values in different
 directories.

i think the docs are out-of-date, seems to work inside location:

--- t/conf/httpd.conf~  Mon Jul  9 20:23:10 2001
+++ t/conf/httpd.conf   Tue Jul 10 08:35:03 2001
@@ -160,6 +160,7 @@
 /Location
 
 Location /perl/perl-status
+SetEnv mod_env location
 PerlSetVar StatusOptionsAll On
 SetHandler perl-script
 PerlHandler +Apache::Status

% GET 'http://localhost:8529/perl/perl-status?env' | grep mod_env
mod_env = location





Re: PerlInitHandler and PerlSetEnv

2001-07-09 Thread Doug MacEachern

this patch should fix the problem.  you should also be able to
s/PerlSetEnv/SetEnv/g, unless Embperl needs these variables before the
fixup phase.

Index: src/modules/perl/mod_perl.c
===
RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v
retrieving revision 1.140
diff -u -r1.140 mod_perl.c
--- src/modules/perl/mod_perl.c 2001/06/19 03:12:44 1.140
+++ src/modules/perl/mod_perl.c 2001/07/10 03:19:27
@@ -1388,6 +1388,14 @@
cfg-setup_env = 0; /* just once per-request */
 }
 
+if (cfg-dir_env != cld-env) {
+/* PerlSetEnv
+ * update only if the table changes across a request
+ */
+mod_perl_dir_env(r, cld);
+cfg-dir_env = cld-env;
+}
+
 if(callbacks_this_request++  0) return;
 
 if (!r-main) {
@@ -1397,9 +1405,6 @@
 */
(void)perl_request_rec(r);
 }
-
-/* PerlSetEnv */
-mod_perl_dir_env(r, cld);
 
 /* SetEnv PERL5LIB */
 if (!MP_INCPUSH(cld)) {
Index: src/modules/perl/mod_perl.h
===
RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.h,v
retrieving revision 1.109
diff -u -r1.109 mod_perl.h
--- src/modules/perl/mod_perl.h 2001/06/19 03:12:45 1.109
+++ src/modules/perl/mod_perl.h 2001/07/10 03:19:30
@@ -1064,6 +1064,7 @@
 typedef struct {
 HV *pnotes;
 int setup_env;
+table *dir_env;
 array_header *sigsave;
 } perl_request_config;
 




Re: PerlInitHandler and PerlSetEnv

2001-07-09 Thread Gerald Richter



 this patch should fix the problem.

Yes, this fixes the problem :-)

 you should also be able to
 s/PerlSetEnv/SetEnv/g, unless Embperl needs these variables before the
 fixup phase.


Embperl doesn't need them before the fixup phase, but sometimes you want
different values for the environment variables for different directories,
which doesn't work with SetEnv

Thanks for the fast fix

Gerald



-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925131
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-






Re: PerlInitHandler and PerlSetEnv

2001-07-09 Thread Doug MacEachern

On Tue, 10 Jul 2001, Gerald Richter wrote:
 
 Yes, this fixes the problem :-)

cool.
 
 Embperl doesn't need them before the fixup phase, but sometimes you want
 different values for the environment variables for different directories,
 which doesn't work with SetEnv

really?  glancing at mod_env.c looks like it should work.
 
 Thanks for the fast fix

would have been sooner but i was on an airplane the past 6 hours :)





Re: PerlInitHandler and PerlSetEnv

2001-07-09 Thread Gerald Richter


  Embperl doesn't need them before the fixup phase, but sometimes you want
  different values for the environment variables for different
directories,
  which doesn't work with SetEnv

 really?  glancing at mod_env.c looks like it should work.


The docs says:

SetEnv directive
Syntax: SetEnv variable value
Context: server config, virtual host
Status: Base
Module: mod_env
Compatibility: SetEnv is only available in Apache 1.1 and later.
Sets an environment variable, which is then passed on to CGI scripts and SSI
pages. Example:

There is no directory, .htaccess in the context and that's like it really
behaves. (unless they changed it in a very recent version and didn't update
the docs, which I don't expect)

PerlSetEnv is the only chance to have different values in different
directories.


  Thanks for the fast fix

 would have been sooner but i was on an airplane the past 6 hours :)


Then you are even faster :-)

Gerald



-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925131
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-