php-general Digest 14 Oct 2009 03:08:03 -0000 Issue 6389

2009-10-13 Thread php-general-digest-help
php-general Digest 14 Oct 2009 03:08:03 - Issue 6389 Topics (messages 298878 through 298886): Re: Insult my code! 298878 by: David Otton Bug in php-cgi.exe 298879 by: loki Re: How to bypass (pipe) curl_exec return value directly to a file? 298880 by: Andrea

Re: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Lars Torben Wilson
2009/10/12 m.hasibuan magda.hasib...@yahoo.co.uk: Newbie question. I need to download a very large amount of xml data from a site using CURL. How to bypass (pipe) curl_exec return value directly to a file, without using memory allocation? set_time_limit(0); $ch = curl_init($siteURL);

[PHP] Bug in php-cgi.exe

2009-10-13 Thread loki
Hello, i thing i found a bug in PHP-cgi.exe I use Php-cgi as fastCgi php-cgi.exe -b host:port i set in environement variables this : PHP_FCGI_CHILDREN=8 PHP_FCGI_MAX_REQUESTS=1000 in the task manager i see only one Php-cgi.exe process (when normaly i must see 9 process no?) and after i

RE: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Andrea Giammarchi
I guess this should work set_time_limit(0); $ch = curl_init($siteURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); curl_setopt($ch, CURLOPT_FILE, 'stream.bin'); curl_exec($ch); Regards From:

RE: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Andrea Giammarchi
$ch = curl_init($url); $fp = fopen('/tmp/curl.out', 'w'); curl_setopt($ch, CURLOPT_FILE, $fp); curl_exec($ch); Error checking etc. is of course left up to you. :) oops, I sent directly the file name. Let me reformulate the code then: set_time_limit(0); $fp = fopen('stream.bin',

Re: [PHP] Re: Insult my code!

2009-10-13 Thread David Otton
2009/10/13 Eric Bauman baum...@livejournal.dk: *sigh* sometimes I really wish PHP allowed one to be a bit more heavy-handed with types (optional real type hinting would be nice). There's a scalar type-hinting patch floating around somewhere, but then your code would only work on machines with

Re: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Lars Torben Wilson
2009/10/13 Andrea Giammarchi an_...@hotmail.com: $ch = curl_init($url); $fp = fopen('/tmp/curl.out', 'w'); curl_setopt($ch, CURLOPT_FILE, $fp); curl_exec($ch); Error checking etc. is of course left up to you. :) oops, I sent directly the file name. Let me reformulate the code then:

RE: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Andrea Giammarchi
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); I wouldn't recommend setting this to 0 unless you're very sure that the connection will succeed; otherwise, your script will hang indefinitely waiting for the connection to be made. agreed, it's just he set timeout to zero so I guess he meant

Re: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Lars Torben Wilson
2009/10/13 Andrea Giammarchi an_...@hotmail.com: curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); I wouldn't recommend setting this to 0 unless you're very sure that the connection will succeed; otherwise, your script will hang indefinitely waiting for the connection to be made. agreed, it's

RE: [PHP] How to bypass (pipe) curl_exec return value directly to a file?

2009-10-13 Thread Andrea Giammarchi
uhm, right, I should have better explain that option ... still, if timelimit is 0, I guess connection timeout matters, maybe I am wrong. Thanks. Regards Date: Tue, 13 Oct 2009 11:31:00 -0700 Subject: Re: [PHP] How to bypass (pipe) curl_exec return value directly to a file? From:

[PHP] Signing (hand-written signature) pdf document

2009-10-13 Thread nashrul
Hi... I'm thinking about a document management system that can put user signature on the created digital document. Here's the app-flow I can imagine ... My php application creates a pdf document. The pdf document is displayed to user. Using the digital pen, the user will put his/her signature on

[PHP] SimpleXML var_dump() weirdness

2009-10-13 Thread Mattias Thorslund
Hi, It seems that var_dump() of a SimpleXMLElement does not show an attribute of elements that contain text content? I hope my examples might show what I mean: $xml = 'root rootattr=root valueinner attr=value//root'; $simple = new SimpleXMLElement($xml); var_dump($simple); echo