[PHP] Re: Buffering

2004-12-16 Thread Lorderon
Richard Lynch [EMAIL PROTECTED] wrote in message:
  I need to store chunks of output into files.

 Which output and why?
any output of the program that goes to php://stdout.. if from echo, print,
var_dump, code breaking, etc... why? cuz I want to get chunks of output into
variables to make a cache system..

 What is the Big Picture here?
I want to build a cache system and store there not the whole page, but
chunks of the page.. the chunks are started then ended in some point.. all
the output between the start and stop points is a chunk and I want to get it
into variable... that's exactly using ob_start() then ob_get_contents() to
get the chunk data then ob_end_flush()... But, when using ob_* funcs.. when
calling ob_start() all output afterwards is buffered till flushing.. what i
need is to to allow output being transfered imediately but still get the
chunks in variables..

thanks,
Lorderon.

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



[PHP] Buffering

2004-12-16 Thread Lorderon
Hi,

Richard Lynch [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Lorderon wrote:
  What I want to do is catch the output buffer, but do not delay the
  buffer

 It occurs to me that maybe you should tell us WHY you want this, because
 there could be existing alternatives outside the scope of PHP that we
 could recommend...

I need to store chunks of output into files. I can get the chunk output by
using ob_get_contents(), but after calling ob_start() the output is only
buffered and not sent till flushing. The delay from echoing to flushing is
exactly what I want to avoid. I want to echo the output imediatly and not
just on flushing, but still be able to buffer the chunk and get the output
into variable.

I hope it's clearer now..

thanks,
Lorderon.

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


Re: [PHP] Output buffering - saving + echoing

2004-12-15 Thread Lorderon
Hi,

Brent Baisley [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Not exactly sure what your question is. You want to catch the buffer,
 but don't delay the buffer to be sent???
 If your question is that you want to hold the contents of the buffer
 and send it only when you are ready, don't use ob_end_flush, use
 ob_end_clean. The buffer is cleared without sending anything to the
 client. The buffer contents are still retained in the variable $buf.
 When you are ready, you can just echo $buf.

Thanks, but this is now what i meant for.
I want the script to output data as regular like not using buffering. But I
want to catch output chunks in variables. How this can be done?

thanks,
Lorderon.

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



Re: [PHP] Output buffering - saving + echoing

2004-12-15 Thread Lorderon
Hi,

Brent Baisley [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Not exactly sure what your question is. You want to catch the buffer,
 but don't delay the buffer to be sent???
 If your question is that you want to hold the contents of the buffer
 and send it only when you are ready, don't use ob_end_flush, use
 ob_end_clean. The buffer is cleared without sending anything to the
 client. The buffer contents are still retained in the variable $buf.
 When you are ready, you can just echo $buf.

Thanks, but this is now what i meant for.
I want the script to output data as regular like not using buffering. But I
want to catch output chunks in variables. How this can be done?

thanks,
Lorderon.

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



[PHP] Re: Output buffering - saving + echoing

2004-12-15 Thread Lorderon
Hi,

Richard Lynch [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Lorderon wrote:
  What I want to do is catch the output buffer, but do not delay the
  buffer

 It occurs to me that maybe you should tell us WHY you want this, because
 there could be existing alternatives outside the scope of PHP that we
 could recommend...

I need to store chunks of output into files. I can get the chunk output by
using ob_get_contents(), but after calling ob_start() the output is only
buffered and not sent till flushing. The delay from echoing to flushing is
exactly what I want to avoid. I want to echo the output imediatly and not
just on flushing, but still be able to buffer the chunk and get the output
into variable.

I hope it's clearer now..

thanks,
Lorderon.

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


[PHP] Output buffering - saving + echoing

2004-12-14 Thread Lorderon
Hi,

When using ob_start(), the output is buffered and not sent till
ob_end_flush() is called or got to end of the script. Also before flushing
you can get the buffer contents by ob_get_contents().

?
//start buffering, from now on no output.
//NEED: start buffering, but output imediatly when echo.
ob_start();

//this is not echoed now.
//NEED: echo this now, but still buffer it too.
echo Hello, World!;

//getting the buffer contents.
//NEED: getting the buffer contents.
$buf=ob_get_contents();

//the buffer is echoed just now.
//NEED: stop the buffering, and not output all the buffer now.
ob_end_flush();
?

What I want to do is catch the output buffer, but do not delay the buffer
to be sent. How is it done?


thanks in advance,
Lorderon.

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



[PHP] PHP Heap

2004-12-01 Thread Lorderon
Hi,

I searched the web but couldn't find an implementation class of HEAP in PHP.
If someone has anything that is like, please let me know.

Thanks in advance :)

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



[PHP] Heap implementation

2004-12-01 Thread Lorderon
Hi,

I searched the web but couldn't find an implementation class of HEAP in PHP.
If someone has anything that is like, please let me know.

Thanks in advance :)

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



[PHP] constructing class

2004-12-01 Thread Lorderon
Hi,

I want to create an instance of a class and construct it with different
params. The class name is a variable and the params change in each class. Is
there a way to pass params to the constructor of a class like you pass
params in the function call_user_func_array() ?


BTW, there's a solution for it using eval, but looking for a better cleaner
way...
With eval:

$cls=MyClass;
$construct_params=array(10,true);
$eval_str=return new $cls(;
for ($i=0; $icount($construct_params); $i++)
$eval_str.=\$construct_params[$i],;
$eval_str=substr($eval_str,-1).);;
$obj=eval($eval_str);

thanks in advance,
Lorderon.

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



[PHP] constructing class

2004-12-01 Thread Lorderon
Hi,

I want to create an instance of a class and construct it with different
params. The class name is a variable and the params change in each class. Is
there a way to pass params to the constructor of a class like you pass
params in the function call_user_func_array() ?


BTW, there's a solution for it using eval, but looking for a better cleaner
way...
With eval:

$cls=MyClass;
$construct_params=array(10,true);
$eval_str=return new $cls(;
for ($i=0; $icount($construct_params); $i++)
$eval_str.=\$construct_params[$i],;
$eval_str=substr($eval_str,-1).);;
$obj=eval($eval_str);

thanks in advance,
Lorderon.

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



[PHP] creating XML with simpleXML

2004-11-18 Thread Lorderon
Hi,

I know how to parse XML files with simpleXML. It also allows to edit/modify
elements contents.
But, is there a way to create an XML from scratch using simpleXML?

-thanks, Lorderon.

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



[PHP] strftime

2004-02-17 Thread Lorderon
Hi All,

I'm using the next code:

?
setlocale(LC_TIME,he);//returns Hebrew_Israel.1255
echo strftime(%A);//I see only question marks: ??? ?
?

The browser encoding is set on Windows-1255..
what's the problem?

-thanks, Lorderon

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



Re: [PHP] Unix-Apache: running apache as different user

2004-01-28 Thread Lorderon

Mike Migurski [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I have PHP installed on Apache and Unix with several vhosts so each vhost
 has its own user account on Unix. Now when accessing a webpage, Apache
 runs with user httpd.. but I want it to run as the user of the vhost
 account.. How can I do that?

 http://httpd.apache.org/docs/suexec.html


The SuEXEC is not good for my purpose, since I want to run PHP as Apache
Module (and not CGI).
I'm using Apache 1.3... does the User / Group directives change the
user/group in case I use Apache Module for PHP?

Also, I read about the AssignUserID directive, but couldn't figure out if it
affects Apache Module or only CGI module for PHP?


thanks in advance
-Lorderon

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