11
11
use Apache::Const -compile => 'OK';
18
my $env = $r->subprocess_env;
21
# subprocess_env in void context populates the same as +SetEnv
22
ok_false($r, 'REMOTE_ADDR');
24
ok_true($r, 'REMOTE_ADDR');
26
$env = $r->subprocess_env; #table may have been overlayed
31
$r->subprocess_env(FOO => undef);
34
$r->subprocess_env(FOO => 1);
19
# subprocess_env in void context with arguments does
22
my $env = $r->subprocess_env;
28
$r->subprocess_env($key => 1); # void context but with args
32
ok ! $ENV{$key}; # %ENV not populated yet
35
# subprocess_env in void context with no arguments
36
# populates the same as +SetEnv
38
my $env = $r->subprocess_env;
40
my $key = 'REMOTE_ADDR';
42
ok_false($r, $key); # still not not there yet
44
ok ! $ENV{$key}; # %ENV not populated yet
46
$r->subprocess_env; # void context with no arguments
50
ok $ENV{$key}; # mod_cgi emulation
53
# handlers can use a void context more than once to force
54
# population of %ENV with new table entries
56
my $env = $r->subprocess_env;
60
$env->set($key => 1); # new table entry
64
ok ! $ENV{$key}; # shouldn't affect %ENV yet
66
$r->subprocess_env; # now called in in void context twice
68
ok $ENV{$key}; # so %ENV is populated with new entry
72
my $env = $r->subprocess_env; # table may have been overlayed
76
$env->set($key => 1); # direct call to set()
80
ok ! $ENV{$key}; # shouldn't affect %ENV
82
$r->subprocess_env($key => undef);
84
ok_false($r, $key); # removed
86
$r->subprocess_env($key => 1);
88
ok_true($r, $key); # reset
90
ok ! $ENV{$key}; # still shouldn't affect %ENV