Re: [PHP-DEV] Re: output buffering problem

2002-12-19 Thread Wez Furlong
Please ask these questions on the php-general list.

--Wez.

On Thu, 19 Dec 2002, electroteque wrote:

 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();
 Electroteque [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  hi guys i have the latest cvs , my function used to work now it doesnt
 
  function
  progressbar_percentage($i,$files,$newwin,$moviename,$status,$sleep=null){
   if (is_array($files)) $per = $i/count($files); else $per = $i/$files;
   $per = $per*100;
   $buffer = script language=\javascript\\n;
   $buffer .= var movie=.$newwin..document..$moviename.;\n;
   $buffer .= movie.TGotoFrame(\_root.Status\, 1);\n;
   $buffer .= movie.SetVariable(\_root.Status.processing\,
  \.$status.\);\n;
   $buffer .= movie.TSetProperty(\_root.Bar\,2, .ceil($per).);\n;
   $buffer .= movie.SetVariable(\_root.Percent.per\, \.ceil($per).
  %\);\n;
   $buffer .= /script\n;
   print ($buffer);
   flush();
   sleep(1);
  }
 
  this i meant to flush on every loop and show a progress percentage
 although
  now php wont flush anything until half way through the loop and causes
  javascript errors as it never flushed until too late , what could be the
  problem ?
 
 



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





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




Re: [PHP-DEV] Re: output buffering

2002-10-08 Thread Zeev Suraski

I think we have a bit of a language gap, which is fine, but let's settle 
for that:
Please make sure that if you have a small doubt regarding a certain 
behavior, especially in a core component of PHP such as the output 
buffering layer or the session module - you ask the relevant author(s) 
about it, CCing php-dev.  Worst case - you'll ask a bit more than 
necessary, but that's much better than not asking enough.

Let's look forward now...

Zeev

At 03:32 08/10/2002, Yasuo Ohgaki wrote:
Zeev Suraski wrote:
Really?  Yasuo, people have been requesting that we disable your write 
access to the full php4 tree, and uptil now I was against it.  But this 
attitude is making me reconsider my stand on this.
This is the 2nd time in the last couple of days that I notice that your 
unverified assumptions introduced inconsistencies/bugs/misbehaviors, and 
if you don't realize that it needs to be fixed, we have a bit of a 
problem here.
Please reconsider.

Zeev,

I think you know my attitude. I usually ask when it's not clear bug or 
simple bug. I'm write if I'm not sure which Sascha said people don't
read code shouldn't comment. I agree and I usually follow this basic
rule.

There is misunderstanding that I thought you were willing to have
flushing while you are not. This resulted that mess we had.

I think it has been resolved, isn't it?

  No. I don't think I need to ask.

This line should be read

No. I don't think I need to ask if it is problem or not.
It is problem which I'm not willing to be fixed.

It does not work as it is supposed in limited case. We have
options, leave code and document limitation, modify code to
resolve small issue or just ignore it.
Flushing is problematic and we know well :)

--
Yasuo Ohgaki



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




Re: [PHP-DEV] Re: output buffering

2002-10-08 Thread Hartmut Holzgraefe

Zeev Suraski wrote:
 
 Aha, ok, that actually makes quite a bit of sense.  If there's a bit of 
 output that remains inside the buffers, and the session module gets 
 deactivated before this output is flushed, we're in trouble...  I'll 
 take a look at it.

i think i've been bitten by this using apxs ... :(

at least i've been suffering xml output missing some bytes at the end
in a project where a trans-sid session was started for the xml 
generating script by an included file (although there was no actual
need for a session, so 'fixing' the problem was easy in that case)


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




Re: [PHP-DEV] Re: output buffering

2002-10-07 Thread Zeev Suraski

At 10:55 07/10/2002, Yasuo Ohgaki wrote:
As I said before, I don't touch any of chunk size related code.
You've removed all applicable lines regarding to implicit flush
thing.

No implicit flush please.  Enough.  It's over.  Seriously, please, it's 
really getting on my nerves already :) [*]

Anyway, using unlimited size of buffer makes sense to me.
Unless it buffers whole contents, URL rewriter may fail to
modify HTML correctly.

I don't read code, so I cannot make comment on this.
But, I guess it is working as before w/o adding output
control functions.

Well, you should have at least assumed that considering it's been working 
with chunked buffering for  months and months, maybe, just possibly, it's 
supposed to work that way.  The least you should do is ask either Sascha or 
me how come it uses chunked buffering, and whether it's not a bug.  You 
would have gotten a pretty clear response saying that it fully supports 
chunked buffering.

Zeev

[*] The reason I'm edgy is that on top of the public discussion about 
implicit flush, there was also a fairly long email exchange between Yasuo 
and me regarding that subject...


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




Re: [PHP-DEV] Re: output buffering

2002-10-07 Thread Yasuo Ohgaki

Zeev Suraski wrote:
 The least you should do is 
 ask either Sascha or me how come it uses chunked buffering, and whether 
 it's not a bug.  You would have gotten a pretty clear response saying 
 that it fully supports chunked buffering.

No. I don't think I need to ask.
It may be able to be called fully supports chunked buffering, but
the code is still missing some.

pseudo code

while($html = read($fp, 100)) {
   print($html);
   ob_flush();
}

You see?

--
Yasuo Ohgaki


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




Re: [PHP-DEV] Re: output buffering

2002-10-07 Thread Zeev Suraski

At 14:51 07/10/2002, Yasuo Ohgaki wrote:
Zeev Suraski wrote:
The least you should do is ask either Sascha or me how come it uses 
chunked buffering, and whether it's not a bug.  You would have gotten a 
pretty clear response saying that it fully supports chunked buffering.

No. I don't think I need to ask.

Really?  Yasuo, people have been requesting that we disable your write 
access to the full php4 tree, and uptil now I was against it.  But this 
attitude is making me reconsider my stand on this.

This is the 2nd time in the last couple of days that I notice that your 
unverified assumptions introduced inconsistencies/bugs/misbehaviors, and if 
you don't realize that it needs to be fixed, we have a bit of a problem here.

Please reconsider.

Zeev


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




Re: [PHP-DEV] Re: output buffering

2002-10-07 Thread Rasmus Lerdorf

 Zeev Suraski wrote:
  The least you should do is
  ask either Sascha or me how come it uses chunked buffering, and whether
  it's not a bug.  You would have gotten a pretty clear response saying
  that it fully supports chunked buffering.

 No. I don't think I need to ask.

Sometimes you do.  If you are touching other peoples' code, and especially
if that code is rather critical you need to make really damn sure you know
what you are doing before you change it.  A quick summary of what you
have in mind sent to php-dev and/or the author(s) of the code in question
is all it takes.  It doesn't take very long and it is common courtesy if
nothing else.

-Rasmus


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




Re: [PHP-DEV] Re: output buffering

2002-10-07 Thread David Reid

Agreed, it's only common courtesy.

david

  Zeev Suraski wrote:
   The least you should do is
   ask either Sascha or me how come it uses chunked buffering, and
whether
   it's not a bug.  You would have gotten a pretty clear response saying
   that it fully supports chunked buffering.
 
  No. I don't think I need to ask.

 Sometimes you do.  If you are touching other peoples' code, and especially
 if that code is rather critical you need to make really damn sure you know
 what you are doing before you change it.  A quick summary of what you
 have in mind sent to php-dev and/or the author(s) of the code in question
 is all it takes.  It doesn't take very long and it is common courtesy if
 nothing else.

 -Rasmus



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




Re: [PHP-DEV] Re: output buffering

2002-10-07 Thread Zeev Suraski

At 17:53 07/10/2002, David Reid wrote:
Agreed, it's only common courtesy.

At minimum.  When we're dealing with the core of an application as popular 
as PHP, it's also an issue of responsibility.

Zeev


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




Re: [PHP-DEV] Re: output buffering

2002-10-07 Thread Zeev Suraski

At 18:43 07/10/2002, Sascha Schumann wrote:
On Mon, 7 Oct 2002, Zeev Suraski wrote:

  Can you see if calling php_end_ob_buffers() in the session deactivate
  function, in case BG(url_adapt_state_ex).active is true, solves this 
 problems?

 Note the condition here:

   There is an even weirder bug, at least in the 4.2.3/CGI case
   ^

Yeah I know, I thought it also existed in the 4.3 tree.  I think that the 
solution would be similar in the 4.2 branch - call php_end_ob_buffers() in 
case the session module started an output buffering layer...

 I got the other error:

   In HEAD, this yields:
  
   if (!OG(ob_nesting_level)) {
   php_error_docref(ref.outcontrol TSRMLS_CC, E_NOTICE, failed to
   flush buffer. No buffer to flush.);

 ..only because I had wiped out my php.ini for the 4.2.3 test
 and did not reinstantiate it properly for the HEAD test.
 ob_flush together with session.use_trans_sid enabled works in
 the latest CVS.

I understand, but what if you don't call ob_flush()?  Does it work properly?

Zeev


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




Re: [PHP-DEV] Re: output buffering

2002-10-07 Thread Sascha Schumann

 I understand, but what if you don't call ob_flush()?  Does it work properly?

The bug from 4.2.3 does not reappear here.  The rewriter
kicks in using the final combination of ini settings.

- Sascha


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




Re: [PHP-DEV] Re: output buffering

2002-10-07 Thread Yasuo Ohgaki

Zeev Suraski wrote:
 Really?  Yasuo, people have been requesting that we disable your write 
 access to the full php4 tree, and uptil now I was against it.  But this 
 attitude is making me reconsider my stand on this.
 
 This is the 2nd time in the last couple of days that I notice that your 
 unverified assumptions introduced inconsistencies/bugs/misbehaviors, and 
 if you don't realize that it needs to be fixed, we have a bit of a 
 problem here.
 
 Please reconsider.

Zeev,

I think you know my attitude. I usually ask when it's not clear bug or 
simple bug. I'm write if I'm not sure which Sascha said people don't
read code shouldn't comment. I agree and I usually follow this basic
rule.

There is misunderstanding that I thought you were willing to have
flushing while you are not. This resulted that mess we had.

I think it has been resolved, isn't it?

  No. I don't think I need to ask.

This line should be read

No. I don't think I need to ask if it is problem or not.
It is problem which I'm not willing to be fixed.

It does not work as it is supposed in limited case. We have
options, leave code and document limitation, modify code to
resolve small issue or just ignore it.
Flushing is problematic and we know well :)

--
Yasuo Ohgaki



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