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 {
22 $get = Apache->request->args;
24 $get = $ENV{QUERY_STRING}
27 for (split /[&;]/, $get) {
28 my @keyval = split /=/, $_, 2;
29 PLP::Functions::DecodeURI(@keyval);
30 $get{$keyval[0]} = $keyval[1] unless $keyval[0] =~ /^\@/;
31 push @{ $get{'@' . $keyval[0]} }, $keyval[1];
37 tie %PLP::Script::post, 'PLP::Tie::Delay', 'PLP::Script::post', sub {
41 $post = Apache->request->content;
43 read(*STDIN, $post, $ENV{CONTENT_LENGTH});
45 if (defined($post) && $post ne '' &&
46 ($ENV{CONTENT_TYPE} eq '' || $ENV{CONTENT_TYPE} eq 'application/x-www-form-urlencoded')){
47 for (split /&/, $post) {
48 my @keyval = split /=/, $_, 2;
49 PLP::Functions::DecodeURI(@keyval);
50 $post{$keyval[0]} = $keyval[1] unless $keyval[0] =~ /^\@/;
51 push @{ $post{'@' . $keyval[0]} }, $keyval[1];
57 tie %PLP::Script::fields, 'PLP::Tie::Delay', 'PLP::Script::fields', sub {
58 $PLP::Script::get{PLPdummy}, $PLP::Script::post{PLPdummy}; # Trigger creation
59 return {%PLP::Script::get, %PLP::Script::post}
62 tie %PLP::Script::header, 'PLP::Tie::Headers';
64 if (defined($ENV{HTTP_COOKIE}) && $ENV{HTTP_COOKIE} ne ''){
65 for (split /; ?/, $ENV{HTTP_COOKIE}) {
66 my @keyval = split /=/, $_, 2;
67 $PLP::Script::cookie{$keyval[0]} ||= $keyval[1];