[svn:mod_parrot] r569 - mod_parrot/trunk/lib/ModParrot/HLL

[email protected] Thu, 1 Jan 2009 16:11:01 -0800 (PST)
Newsgroups perl.cvs.mod_parrot
Message-ID <[email protected]>
Author: jhorwitz
Date: Thu Jan  1 16:11:00 2009
New Revision: 569

Modified:
   mod_parrot/trunk/lib/ModParrot/HLL/pipp.pir

Log:
store superglobals in 'pipp' namespace


Modified: mod_parrot/trunk/lib/ModParrot/HLL/pipp.pir
==============================================================================
--- mod_parrot/trunk/lib/ModParrot/HLL/pipp.pir	(original)
+++ mod_parrot/trunk/lib/ModParrot/HLL/pipp.pir	Thu Jan  1 16:11:00 2009
@@ -56,7 +56,7 @@
     .local int status
     .local pmc query_parse
     .local pmc get_hash, post_hash
-    .local pmc interp
+    .local pmc interp, oldin, oldout, newin, newout
 
     ap_const = get_root_global [ 'ModParrot'; 'Apache'; 'Constants' ], 'table'
 
@@ -78,7 +78,7 @@
     query_parse = get_hll_global [ 'CGI'; 'QueryHash' ], 'parse'
     get_hash = new 'Hash'
     get_hash = query_parse(args)
-    set_hll_global '$_GET', get_hash
+    set_root_global ['pipp'], '$_GET', get_hash
 
     # parse POST data
     $S0 = r.'method'()
@@ -94,19 +94,17 @@
     data = $P1
     post_hash = new 'Hash'
     post_hash = query_parse(data)
-    set_hll_global '$_POST', post_hash
+    set_root_global ['pipp'], '$_POST', post_hash
     
   run_script:
     php_file = r.'filename'()
-    interp.'capture_stdout'(1)
-    run_php_file(php_file)
+    oldout = interp.'stdout'(r)
+    oldin = interp.'stdin'(r)
     r.'content_type'("text/html")
-
-    $S0 = interp.'dump_stdout'()
-    interp.'capture_stdout'(0)
-    r.'puts'($S0)
+    run_php_file(php_file)
+    interp.'stdout'(oldout)
+    interp.'stdin'(oldin)
 
     status = ap_const['OK']
-
     .return(status)
 .end