perl.cvs.mod_parrot
[Top] [All Lists]

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

Subject: [svn:mod_parrot] r348 - mod_parrot/trunk/lib/ModParrot/HLL
From: jhorwitz@xxxxxxxxxxxx
Date: Thu, 12 Jun 2008 07:42:12 -0700 (PDT)
Newsgroups: perl.cvs.mod_parrot

Author: jhorwitz
Date: Thu Jun 12 07:42:06 2008
New Revision: 348

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

Log:
use ModParrot;Interpreter to capture stdout


Modified: mod_parrot/trunk/lib/ModParrot/HLL/plumhead.pir
==============================================================================
--- mod_parrot/trunk/lib/ModParrot/HLL/plumhead.pir     (original)
+++ mod_parrot/trunk/lib/ModParrot/HLL/plumhead.pir     Thu Jun 12 07:42:06 2008
@@ -38,15 +38,18 @@
     .param string php_file
     .local pmc r
     .local pmc ap_const
-    .local pmc pio
     .local string args
     .local int status
     .local pmc query_parse
     .local pmc get_hash, post_hash
+    .local pmc interp
 
     # get the request_rec object
     r = ctx.'request_rec'()
 
+    # get the interpreter object
+    interp = ctx.'interp'()
+
     # parse query string
     args = r.'args'()
     query_parse = get_hll_global [ 'CGI'; 'QueryHash' ], 'parse'
@@ -55,14 +58,12 @@
     set_hll_global '$_GET', get_hash
     
     php_file = r.'filename'()
-    pio = getstdout
-    push pio, "string"
+    interp.'capture_stdout'(1)
     status = run_php_file(php_file)
     r.'content_type'("text/html")
 
-    # XXX limited to 1024 bytes of output for now
-    $S0 = read pio, 1024
-    $S1 = pop pio
+    $S0 = interp.'dump_stdout'()
+    interp.'capture_stdout'(0)
     r.'puts'($S0)
 
     ap_const = get_root_global [ 'Apache'; 'Constants' ], 'ap_constants'

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:mod_parrot] r348 - mod_parrot/trunk/lib/ModParrot/HLL, jhorwitz <=