1 #----------------------#
3 #----------------------#
8 Has only one function: doit(), which ties the hashes %get, %post, %fields and %header in
9 PLP::Script. Also generates %cookie immediately.
13 This module is part of the PLP internals. Don't use it yourself.
18 tie %PLP::Script::get, 'PLP::Tie::Delay', 'PLP::Script::get', sub {
21 $get = $ENV{QUERY_STRING};
23 for (split /[&;]/, $get) {
24 my @keyval = split /=/, $_, 2;
25 PLP::Functions::DecodeURI(@keyval);
26 $get{$keyval[0]} = $keyval[1] unless $keyval[0] =~ /^\@/;
27 push @{ $get{'@' . $keyval[0]} }, $keyval[1];
33 tie %PLP::Script::post, 'PLP::Tie::Delay', 'PLP::Script::post', sub {
37 $post = Apache->request->content;
39 read(*STDIN, $post, $ENV{CONTENT_LENGTH});
41 if (defined($post) && $post ne '' &&
42 ($ENV{CONTENT_TYPE} eq '' || $ENV{CONTENT_TYPE} eq 'application/x-www-form-urlencoded')){
43 for (split /&/, $post) {
44 my @keyval = split /=/, $_, 2;
45 PLP::Functions::DecodeURI(@keyval);
46 $post{$keyval[0]} = $keyval[1] unless $keyval[0] =~ /^\@/;
47 push @{ $post{'@' . $keyval[0]} }, $keyval[1];
53 tie %PLP::Script::fields, 'PLP::Tie::Delay', 'PLP::Script::fields', sub {
54 $PLP::Script::get{PLPdummy}, $PLP::Script::post{PLPdummy}; # Trigger creation
55 return {%PLP::Script::get, %PLP::Script::post}
58 tie %PLP::Script::header, 'PLP::Tie::Headers';
60 if (defined($ENV{HTTP_COOKIE}) && $ENV{HTTP_COOKIE} ne ''){
61 for (split /; ?/, $ENV{HTTP_COOKIE}) {
62 my @keyval = split /=/, $_, 2;
63 $PLP::Script::cookie{$keyval[0]} ||= $keyval[1];