Re: [PHP] Fork and zombies

2009-03-17 Thread Per Jessen
Waynn Lue wrote: > Here's pseudo code for what I'm trying to do: > > foreach ($things as $thing) { > info = getInfo($thing); // uses a db connection > makeApiCall(info); > } > > makeApiCall(info) { > $pid = pcntl_fork(); > if ($pid == -1) { > die("could not fork"); > } else if ($pid) {

Re: [PHP] Re: strcmp() versus ==

2009-03-17 Thread Robert Cummings
On Tue, 2009-03-17 at 08:09 +0200, Alpár Török wrote: > 2009/3/17 Shawn McKenzie : > > Shawn McKenzie wrote: > >> Paul M Foster wrote: > >>> I had never completely read over the rules with regard to comparisons in > >>> PHP, and was recently alarmed to find that $str1 == $str2 might not > >>> compa

Re: [PHP] Fork and zombies

2009-03-17 Thread Waynn Lue
> > > Here's pseudo code for what I'm trying to do: > > > > foreach ($things as $thing) { > > info = getInfo($thing); // uses a db connection > > makeApiCall(info); > > } > > > > makeApiCall(info) { > > $pid = pcntl_fork(); > > if ($pid == -1) { > > die("could not fork"); > > } else if ($

Re: [PHP] Fork and zombies

2009-03-17 Thread Per Jessen
Waynn Lue wrote: > I actually tried this in the meantime: > > $pid = pcntl_fork(); > if ($pid == -1) { > die("could not fork"); > } else if ($pid) { > // parent, return the child pid > echo "child pid $pid waiting\n"; > pcntl_waitpid($pid, $status); > if (pcntl_wifexited

[PHP] Re: strcmp() versus ==

2009-03-17 Thread Clancy
On Mon, 16 Mar 2009 17:06:35 -0500, nos...@mckenzies.net (Shawn McKenzie) wrote: >Shawn McKenzie wrote: >> Paul M Foster wrote: >>> I had never completely read over the rules with regard to comparisons in >>> PHP, and was recently alarmed to find that $str1 == $str2 might not >>> compare the way I

Re: [PHP] Fork and zombies

2009-03-17 Thread Per Jessen
Waynn Lue wrote: > Ah, I was changing it to waiting for each child to finish in order to > see if I could narrow down my db problem, because I figure this should > be more or > less equivalent to running it synchronously. Even like this, though, > it still causes the db problem. I think the data

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Per Jessen
Waynn Lue wrote: > (Apologies for topposting, I'm on my blackberry). Hm, so you think > exiting from the child thread causes the db resource to get reclaimed? > Yeah, something like that. The connection is definitely closed when the child exits. /Per -- Per Jessen, Zürich (8.9°C) -- PHP Ge

Re: [PHP] Fork and zombies

2009-03-17 Thread Waynn Lue
> > I think your waitpid() is in the wrong place, and at least you need use > WNOHANG - unless you specifically want to wait for each child to finish > before starting another one. > > > But it still has the same problem, and I'm also trying to avoid > > pcntl_wait or pcntl_waitpid at all because I

[PHP] Re: Studying IF statements

2009-03-17 Thread Gary
Shawn Thanks for the help, and your right, I peeked ahead and the lesson goes in that direction. Thanks again Gary "Shawn McKenzie" wrote in message news:cf.57.22219.f310f...@pb1.pair.com... > Shawn McKenzie wrote: >> Gary wrote: >>> Shawn >>> >>> Thanks for your reply. Some of what you are

Re: [PHP] Anyone know of a project like Redmine written in PHP?

2009-03-17 Thread Jan G.B.
Yes, recently the developer of "JotBug" anounced his project. I guess the project still needs help. All I have is the public CVS acces so far.. Check out http://www.jotbug.org/projects http://code.google.com/p/jotbug/ byebye 2009/3/17 mike : > http://www.redmine.org/ > > Looks pretty useful; I wa

[PHP] Re: Fork and zombies

2009-03-17 Thread Waynn Lue
(Apologies for topposting, I'm on my blackberry). Hm, so you think exiting from the child thread causes the db resource to get reclaimed? On 3/17/09, Per Jessen wrote: > Waynn Lue wrote: > >> Ah, I was changing it to waiting for each child to finish in order to >> see if I could narrow down my db

[PHP] Multithreading in PHP

2009-03-17 Thread Manoj Singh
Hi Guys, I am creating a page which submits the form through Ajax request & the submitted page is sending the mails to n number of users. Now until the mail sends or the page process completed the end user has to wait. Is it possible that server sends the response to the client & then start proce

Re: [PHP] Multithreading in PHP

2009-03-17 Thread Manoj Singh
Hi Alpar, Thanks for reply. Actually the form is submitted through ajax request and the validation is checking on the server side. So if any error occurs on submission of form, then we are displaying the errors to the user. And is there is no error, then the submitted page started processing. So

[PHP] "/home/{user}/directory"

2009-03-17 Thread George Larson
In my scripts, I usually define a boolean constant DEBUG. True looks for local copies of includes and echoes queries as they're used. My question is: Is there any way for me to reflect the actual home folder of the person running the script? So it will be "/home/george/foo" when I run it but, f

Re: [PHP] Multithreading in PHP

2009-03-17 Thread Alpár Török
2009/3/17 Manoj Singh : > Hi Guys, > > I am creating a page which submits the form through Ajax request & the > submitted page is sending the mails to n number of users. Now until the mail > sends or the page process completed the end user has to wait. > > Is it possible that server sends the respo

Re: [PHP] Multithreading in PHP

2009-03-17 Thread Jo�o C�ndido de Souza Neto
My suggestion is that you can start a second ajax as soon as the response about validating data is returned to process everithing you need and so your user wont wait until the process is finished. João Cândido "Manoj Singh" escreveu na mensagem news:3859a530903170639m6c2af2b2s941446a31103c.

Re: [PHP] "/home/{user}/directory"

2009-03-17 Thread Thiago H. Pojda
On Tue, Mar 17, 2009 at 10:42 AM, George Larson wrote: > In my scripts, I usually define a boolean constant DEBUG. True looks for > local copies of includes and echoes queries as they're used. > > My question is: > > Is there any way for me to reflect the actual home folder of the person > runnin

Re: [PHP] "/home/{user}/directory"

2009-03-17 Thread George Larson
Thanks! On Tue, Mar 17, 2009 at 9:46 AM, Stuart wrote: > 2009/3/17 George Larson > > In my scripts, I usually define a boolean constant DEBUG. True looks for >> local copies of includes and echoes queries as they're used. >> >> My question is: >> >> Is there any way for me to reflect the actua

Re: [PHP] "/home/{user}/directory"

2009-03-17 Thread George Larson
That is correct. PHP on CLI. Thanks! On Tue, Mar 17, 2009 at 9:51 AM, Thiago H. Pojda wrote: > On Tue, Mar 17, 2009 at 10:42 AM, George Larson > wrote: > >> In my scripts, I usually define a boolean constant DEBUG. True looks for >> local copies of includes and echoes queries as they're used.

Re: [PHP] Multithreading in PHP

2009-03-17 Thread Sudheer Satyanarayana
Manoj Singh wrote: Hi Guys, I am creating a page which submits the form through Ajax request & the submitted page is sending the mails to n number of users. Now until the mail sends or the page process completed the end user has to wait. Is it possible that server sends the response to the clie

Re: [PHP] Multithreading in PHP

2009-03-17 Thread Manoj Singh
Hi Sudheer, Can you please put more focus or sample code for the second option which you have suggested "Send the email after you flush the output.". Regards, Manoj On Tue, Mar 17, 2009 at 7:28 PM, Sudheer Satyanarayana < sudhee...@binaryvibes.co.in> wrote: > Manoj Singh wrote: > >> Hi Guys, >>

Re: [PHP] Multithreading in PHP

2009-03-17 Thread Sudheer Satyanarayana
Manoj Singh wrote: Hi Sudheer, Can you please put more focus or sample code for the second option which you have suggested "Send the email after you flush the output.". http://binaryvibes.co.in, Tech stuff: http://techchorus.net, Personal: http://sudheer.net -- PHP General Mailing List (h

Re: [PHP] "/home/{user}/directory"

2009-03-17 Thread Stuart
2009/3/17 George Larson > In my scripts, I usually define a boolean constant DEBUG. True looks for > local copies of includes and echoes queries as they're used. > > My question is: > > Is there any way for me to reflect the actual home folder of the person > running the script? So it will be "

[PHP] Re: strcmp() versus ==

2009-03-17 Thread Shawn McKenzie
Clancy wrote: > On Mon, 16 Mar 2009 17:06:35 -0500, nos...@mckenzies.net (Shawn McKenzie) > wrote: > >> Shawn McKenzie wrote: >>> Paul M Foster wrote: I had never completely read over the rules with regard to comparisons in PHP, and was recently alarmed to find that $str1 == $str2 might

[PHP] Check this out - Videos on how to protect your website against hackers

2009-03-17 Thread Arne1983
Hi! Thank you for checking out this thread. I'm working on some killer videos right now that will explain in detail how you can protect your website against hackers. The first part of the video series is live right now and it covers Cross-Site Request Forgery (CSRF). Go ahead and check them out

[PHP] Re: Anyone know of a project like Redmine written in PHP?

2009-03-17 Thread Micah Gersten
mike wrote: > http://www.redmine.org/ > > Looks pretty useful; I want one in PHP though. > > Anyone? Mantis Bug Tracker has some of the features you are looking for: http://www.mantisbt.org/ -- Micah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/

Re: [PHP] Re: mail() is duplicating

2009-03-17 Thread Ashley Sheridan
On Fri, 2009-03-13 at 22:54 -0300, Manuel Lemos wrote: > Hello, > > on 03/13/2009 05:37 PM Rick Pasotto said the following: > > I have several forms on my site that use the same sequence of events: > > The first script displays and validates the form data, the second > > reformats and asks for con

[PHP] Re: Multithreading in PHP

2009-03-17 Thread Manuel Lemos
Hello, on 03/17/2009 10:14 AM Manoj Singh said the following: > I am creating a page which submits the form through Ajax request & the > submitted page is sending the mails to n number of users. Now until the mail > sends or the page process completed the end user has to wait. > > Is it possible

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Jochem Maas
Per Jessen schreef: > Waynn Lue wrote: > >> (Apologies for topposting, I'm on my blackberry). Hm, so you think >> exiting from the child thread causes the db resource to get reclaimed? >> > > Yeah, something like that. The connection is definitely closed when the > child exits. > I can confirm

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread George Larson
If "Fork and Zombies" was a diner... I would totally eat there. On Tue, Mar 17, 2009 at 5:00 PM, Jochem Maas wrote: > Per Jessen schreef: > > Waynn Lue wrote: > > > >> (Apologies for topposting, I'm on my blackberry). Hm, so you think > >> exiting from the child thread causes the db resource to

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Ashley Sheridan
On Tue, 2009-03-17 at 17:06 -0400, George Larson wrote: > If "Fork and Zombies" was a diner... I would totally eat there. For fork sake... ;) Ash www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Per Jessen
Jochem Maas wrote: > Per Jessen schreef: >> Waynn Lue wrote: >> >>> (Apologies for topposting, I'm on my blackberry). Hm, so you think >>> exiting from the child thread causes the db resource to get >>> reclaimed? >>> >> >> Yeah, something like that. The connection is definitely closed when >> t

Re: [PHP] Re: mail() is duplicating

2009-03-17 Thread Manuel Lemos
Hello, on 03/17/2009 05:34 PM Ashley Sheridan said the following: >>> I have several forms on my site that use the same sequence of events: >>> The first script displays and validates the form data, the second >>> reformats and asks for confirmation or editing, and the third script >>> sends the d

[PHP] Form to pdf

2009-03-17 Thread Gary
Is it possible to create an online form, that when filled out the fields will can be placed in a pdf form? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Jochem Maas
Per Jessen schreef: > Jochem Maas wrote: > >> Per Jessen schreef: >>> Waynn Lue wrote: >>> (Apologies for topposting, I'm on my blackberry). Hm, so you think exiting from the child thread causes the db resource to get reclaimed? >>> Yeah, something like that. The connection is

[PHP] assign associative array values to variables?

2009-03-17 Thread PJ
I have been tearing out my hair to figure out a way to place array values into $variables with not much luck. I can echo the array to the screen but I can not manipulate the results. I have searched wide and far all day on the web and I find nothing that points the way how to extract values from an

[PHP] preg_replace() question

2009-03-17 Thread PJ
1. What is the overhead on preg_replace? 2. Is there a better way to strip spaces and non alpha numerical characters from text strings? I suspect not... maybe the Shadow does ??? :-D -- unheralded genius: "A clean desk is the sign of a dull mind. "

Re: [PHP] assign associative array values to variables?

2009-03-17 Thread Chris
PJ wrote: I have been tearing out my hair to figure out a way to place array values into $variables with not much luck. I can echo the array to the screen but I can not manipulate the results. I have searched wide and far all day on the web and I find nothing that points the way how to extract va

Re: [PHP] preg_replace() question

2009-03-17 Thread Chris
PJ wrote: 1. What is the overhead on preg_replace? Compared to what? If you write a 3 line regex, it's going to take some processing. 2. Is there a better way to strip spaces and non alpha numerical characters from text strings? I suspect not... maybe the Shadow does ??? For this, preg_re

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Waynn Lue
> > > Yeah, something like that. The connection is definitely closed when the > > child exits. > > > > I can confirm this. you definitely need to open a connection for each child > process. > if you require a db connection in the parent process, you should close > it before forking (and then reopen

Re: [PHP] Re: Fork and zombies

2009-03-17 Thread Waynn Lue
> > > Yeah, something like that. The connection is definitely closed when the >> > child exits. >> > >> >> I can confirm this. you definitely need to open a connection for each >> child process. >> if you require a db connection in the parent process, you should close >> it before forking (and then

Re: [PHP] assign associative array values to variables?

2009-03-17 Thread PJ
Chris wrote: > PJ wrote: >> I have been tearing out my hair to figure out a way to place array >> values into $variables with not much luck. I can echo the array to the >> screen but I can not manipulate the results. >> I have searched wide and far all day on the web and I find nothing that >> poin

Re: [PHP] assign associative array values to variables?

2009-03-17 Thread PJ
dg wrote: > If I'm understanding your question correctly, this may help: > > > $array = array("value_one" => "red", "value_two" => "blue"); > extract($array); > print "$value_one, $value_two"; > Thanks for the suggestion. I've seen that example and have tried it as well as about a dozen others. Th

Re: [PHP] assign associative array values to variables?

2009-03-17 Thread Chris
PJ wrote: Chris wrote: PJ wrote: I have been tearing out my hair to figure out a way to place array values into $variables with not much luck. I can echo the array to the screen but I can not manipulate the results. I have searched wide and far all day on the web and I find nothing that points

Re: [PHP] Anyone know of a project like Redmine written in PHP?

2009-03-17 Thread Jim Lucas
Hmmm needs some help indeed... http://www.jotbug.org/help Jan G.B. wrote: Yes, recently the developer of "JotBug" anounced his project. I guess the project still needs help. All I have is the public CVS acces so far.. Check out http://www.jotbug.org/projects http://code.google.com/p/jotbug

Re: [PHP] Form to pdf

2009-03-17 Thread 9el
On Wed, Mar 18, 2009 at 3:48 AM, Gary wrote: > Is it possible to create an online form, that when filled out the fields > will can be placed in a pdf form? Yes possible. But you wrote the query in a bit confused way. Trying to rephrase yours: you want a form which will let user choose a working

[PHP] Calendar/Date

2009-03-17 Thread Jason Todd Slack-Moehrle
Hi All, Does anyone have code and/or advice for how to get get the current week (with a passed current day, say) and what then end date is at Saturday. So take today: Tuesday March 17, 2009 I want to get: Sunday March 15, 2009 Monday March 16, 2009 Tuesday March 17, 2009 Wednesday March 18

[PHP] php-general-sc.1237291233.npmhceaklghpccnefjed-born2victory=gmail....@lists.php.net

2009-03-17 Thread Born2Win

Re: [PHP] Calendar/Date

2009-03-17 Thread Paul M Foster
On Tue, Mar 17, 2009 at 08:52:11PM -0700, Jason Todd Slack-Moehrle wrote: > Hi All, > > Does anyone have code and/or advice for how to get get the current > week (with a passed current day, say) and what then end date is at > Saturday. > > So take today: Tuesday March 17, 2009 > > I want to get: >

[PHP] PHP Quiz

2009-03-17 Thread satya narayan
Hello Friends, I have started a FREE site for quizzes for PHP. I need your kind help, if possible please visit the site and take some quizzes, and then let me know your feedback. Should I add any thing else in that site? link: http://www.testmyphp.com Thanks in advance. -- Satya Bangalore.