Re: [PATCH] Getopt with longopts and windows support - part 2

From: Date: Tue, 07 Aug 2007 17:12:45 +0000
Subject: Re: [PATCH] Getopt with longopts and windows support - part 2
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-31479@lists.php.net to get a copy of this message
On Tue, 2007-08-07 at 19:13 +0300, Jani Taskinen wrote: > Thread safe for CGI and CLI ? :) > Or do you find the function useful outside those SAPIs? Well David's plan is to use the implementation for PHP-level getopt() and I can imagine doing crazy stuff, so if we can make it thread-safe in a good way we should do that - I've seen to many people doing too crazy stuff... Of course that's not high priority... johannes > --Jani > > > Johannes Schlüter kirjoitti: > > David, > > > > On Mon, 2007-08-06 at 09:57 -0400, David Soria Parra wrote: > >> Hi internals, > >> > >> so based on a discussion of php.pecl we thought about using the php_getopt > >> for the PHP_FUNCTION(getopt) instead of the system provided getopt. Here > >> is the patch for that. Hopefully someone is reviewing and commiting the > >> patch as i don't have karma. > > > > The idea is good imo, but there are a few things we have to do: > > > > - We need more tests, as far as I saw using grep we just have a single > > testcase for getopt() which is certainly not enough when replacing the > > implementation. > > > > - The current implementation is not thread-safe, I don't know about the > > glibc implementation but if we use our own implementation for > > PHP's getopt function that should be threadsafe. > > > > - If you move php_getopt to main you have to mark it as PHPAPI so the > > SAPIs can use it. > > > > Maybe there's more, didn't do a deeper review of the patch, yet, since > > I'd like to wait a) until Jani moved the files and b) we have more > > tests :-) > > > > johannes > > >

« previous php.internals (#31479) next »