Re: [PHP] output buffer with Chrome issue.

2009-05-01 Thread Robert Cummings
On Fri, 2009-05-01 at 10:24 -0400, Dan Joseph wrote:
 Hi Everyone,
 
 I'm trying to get Chrome to output html information as it comes thru.  We
 have an iframe running a php script, and when the php script receives
 information, it outputs it.  FF, IE, and Safari all work just fine, displays
 the info as it comes in.  However, Chrome is not.  It will only display the
 information after the php script stops executing.
 
 I am outputting this after every echo:
 
 echo str_pad( , 4096 ) . \n;
 
 flush();
 ob_flush();
 
 ob_implicit_flush();
 
 Has anyone else had this issue?  Anyone know how to fix it?

Have you tried a bigger pad? Try... oh I dunno... 40096. if that works
then you can chop back until you find the threshold. Seems to be though
that it might be better done as AJAX.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] output buffer with Chrome issue.

2009-05-01 Thread Dan Joseph
On Fri, May 1, 2009 at 10:29 AM, Robert Cummings rob...@interjinn.comwrote:


 Have you tried a bigger pad? Try... oh I dunno... 40096. if that works
 then you can chop back until you find the threshold. Seems to be though
 that it might be better done as AJAX.


Hi,

I tried that, didn't work at all even up to 144096 on the pad, but no dice.
Ajax unfortunately isn't an option in this particular case.

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.


Re: [PHP] output buffer with Chrome issue.

2009-05-01 Thread Robert Cummings
On Fri, 2009-05-01 at 10:34 -0400, Dan Joseph wrote:

 Ajax unfortunately isn't an option in this particular case.

Why? Maybe you're thinking about it wrong.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] output buffer with Chrome issue.

2009-05-01 Thread Dan Joseph
On Fri, May 1, 2009 at 10:40 AM, Robert Cummings rob...@interjinn.comwrote:

 On Fri, 2009-05-01 at 10:34 -0400, Dan Joseph wrote:
 
  Ajax unfortunately isn't an option in this particular case.

 Why? Maybe you're thinking about it wrong.


Maybe, I'm open to suggestions:

Here's the basic way the application works.   main index renders, javascript
runs to create an iframe, and set the src='phpfile.php' that runs in a
continuous loop.  it connects to the server, and then listens for output.

Disconnecting from the server isn't an option at all, or else the
application will not function properly.  It needs to have the constant
stream to the server.

Is there a better solution for this?

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.


Re: [PHP] output buffer with Chrome issue.

2009-05-01 Thread Robert Cummings
On Fri, 2009-05-01 at 10:42 -0400, Dan Joseph wrote:
 On Fri, May 1, 2009 at 10:40 AM, Robert Cummings rob...@interjinn.comwrote:
 
  On Fri, 2009-05-01 at 10:34 -0400, Dan Joseph wrote:
  
   Ajax unfortunately isn't an option in this particular case.
 
  Why? Maybe you're thinking about it wrong.
 
 
 Maybe, I'm open to suggestions:
 
 Here's the basic way the application works.   main index renders, javascript
 runs to create an iframe, and set the src='phpfile.php' that runs in a
 continuous loop.  it connects to the server, and then listens for output.
 
 Disconnecting from the server isn't an option at all, or else the
 application will not function properly.  It needs to have the constant
 stream to the server.
 
 Is there a better solution for this?

I presume your backend script is running something that passes the data
to the browser un-interrupted... maybe a shell script? You can wrap this
in popen() or proc_open() and read the output as you would a file. This
can then be queued for consumption by an AJAX script.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] output buffer with Chrome issue.

2009-05-01 Thread Dan Joseph
On Fri, May 1, 2009 at 10:55 AM, Robert Cummings rob...@interjinn.comwrote:


 I presume your backend script is running something that passes the data
 to the browser un-interrupted... maybe a shell script? You can wrap this
 in popen() or proc_open() and read the output as you would a file. This
 can then be queued for consumption by an AJAX script.


Ah ok, I've never used either of those before.  I am going to give that a
shot and will let you know how it goes.  I should be able to bolt that on
quickly.  Thanks!

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.