RE: [PHP] flush output error

2002-12-19 Thread Ford, Mike [LSS]
 -Original Message-
 From: electroteque [mailto:[EMAIL PROTECTED]]
 Sent: 19 December 2002 07:52
 
 sorry about the false alarm , if you go here u will see a 
 working example
 
 http://galleries.dyndns.org:1023/progress.php
 
 i had to add both flush functions together to work , 
 obviosuly flsuh is not
 emptying the buffer within a loop, is this still a bug ?
 
 flush();
  ob_flush();

Well, if you use PHP's output buffering, you actually have two buffers: the output 
buffer which can be manipulated and accessed from within your script using the ob_*() 
functions, and what might be called the connection buffer which exists in the 
general PHP environment and is not accessible to your script, but can be flushed with 
the flush() function or by setting implicit_flush to on.

When you do ob_flush(), this flushes the output buffer to the connection buffer; 
flush() flushes the connection buffer, via the HTTP connection, to your browser.  (The 
browser may then buffer it itself, e.g. whilst waiting for a /table tag to show up, 
but that's another matter!)  So, yes, if you have output buffering on you need both 
ob_flush() and flush() (in that order!) to flush all pending output to the browser.

For your application, I would question whether you need output buffering on -- it 
seems to be causing you problems rather than solving them!

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP] flush output error

2002-12-18 Thread Wico de Leeuw
At 20:41 18-12-02 +1100, you wrote:

hi guys i have a little problem with flushing the buffer output, in this
loop it should be downloading a file and changing the progress of a progress
bar, although it waits until the shell_exec of all the files are done and
then flushes the buffer which will start @ 95% , so it wont start until
shell_exec is finished , is this a bug ?


php can't multitask, so it's not a bug
what you can try:

page1: (start process)
put an ignore_user_abort on it
put a header location on it to page2
start the command and let it write to a file where it is

page 2 :
read the file and display a processbar
(with javascript or meta refresh)
when done goto page3

page3:
continue




foreach ($filename as $file){
 shell_exec(curl -O .$url.$file);
 //shell_exec(wget .$url.$file);
 //echo $file;

$bar-progressbar_percentage($i,$filename,'NewWin','Percentage','Downloading
'.$file);
 $i++;
  }



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



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




Re: [PHP] flush output error

2002-12-18 Thread electroteque
no this has been working before, it stopped working ever since i upgraded to
4.3 , whats there to multitask ? i'm simply executing curl and then
executing the funtion after not at the same time but should both be
executing within the same loop , it was working before especially for image
uploads but now it isnt ??

Wico De Leeuw [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 At 20:41 18-12-02 +1100, you wrote:
 hi guys i have a little problem with flushing the buffer output, in this
 loop it should be downloading a file and changing the progress of a
progress
 bar, although it waits until the shell_exec of all the files are done and
 then flushes the buffer which will start @ 95% , so it wont start until
 shell_exec is finished , is this a bug ?

 php can't multitask, so it's not a bug
 what you can try:

 page1: (start process)
 put an ignore_user_abort on it
 put a header location on it to page2
 start the command and let it write to a file where it is

 page 2 :
 read the file and display a processbar
 (with javascript or meta refresh)
 when done goto page3

 page3:
 continue



 foreach ($filename as $file){
   shell_exec(curl -O .$url.$file);
   //shell_exec(wget .$url.$file);
   //echo $file;
 

$bar-progressbar_percentage($i,$filename,'NewWin','Percentage','Downloadin
g
 '.$file);
   $i++;
}
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




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




Re: [PHP] flush output error

2002-12-18 Thread electroteque
sorry about the false alarm , if you go here u will see a working example

http://galleries.dyndns.org:1023/progress.php

i had to add both flush functions together to work , obviosuly flsuh is not
emptying the buffer within a loop, is this still a bug ?

flush();
 ob_flush();

Wico De Leeuw [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 At 20:41 18-12-02 +1100, you wrote:
 hi guys i have a little problem with flushing the buffer output, in this
 loop it should be downloading a file and changing the progress of a
progress
 bar, although it waits until the shell_exec of all the files are done and
 then flushes the buffer which will start @ 95% , so it wont start until
 shell_exec is finished , is this a bug ?

 php can't multitask, so it's not a bug
 what you can try:

 page1: (start process)
 put an ignore_user_abort on it
 put a header location on it to page2
 start the command and let it write to a file where it is

 page 2 :
 read the file and display a processbar
 (with javascript or meta refresh)
 when done goto page3

 page3:
 continue



 foreach ($filename as $file){
   shell_exec(curl -O .$url.$file);
   //shell_exec(wget .$url.$file);
   //echo $file;
 

$bar-progressbar_percentage($i,$filename,'NewWin','Percentage','Downloadin
g
 '.$file);
   $i++;
}
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




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